I have a question regrading the localization of WinRT-Apps.
As far as I know the system works like that:
Strings || Resources
de-DE
Resources.resw
en-US
Resources.resw
etc.
Resources.resw
So far, this folder structure is implemented in my project.
In my Package.appxmanifest the "Default Language" is set to "en-US", so everything should be okay from my point of view, if language is not supported it should fall back to "en-US", since it's set there.
But if I compile the stuff, in the Output-Box from VS I get a warning from MakePRI
2>MakePRI : warning 0xdef01051: No default or neutral resource given for 'Resources/String'. The application may throw an exception for certain user configurations when retrieving the resources.
I searched so far and found only things that are related to the Advertising SDK from MS, which I don't use in my project, so the problem shouldn't be there.
Why is MakePRI giving me this message, where I'm wrong?
Just for the records: I had the same warning when building a Windows 8.1 Store Universal App (Windows + Windows Phone). My project contains a folder with images which are used as pinpoint markers on a map. The folder names were
Assets/marker/yes/foo.png
Assets/marker/yes/bar.png
Assets/marker/yes/baz.png
...
Assets/marker/no/foo.png
Assets/marker/no/bar.png
Assets/marker/no/baz.png
...
The separation in yes/no subfolders is appliation-specific. My program uses markers inidicating the presence/absence of something on a map.
For each element under Assets/marker I got twice the warning below - one for the Windows project and the other for the Windows Phone project.
MakePRI : warning 0xdef01051: No default or neutral resource given for ...
According to the MakerPRI documentation the resource indexing system tries to recognize language identifiers in folder and file names. I figured that the reason for the warning was the folder name "no". MakerPRI interpreted it as "Norwegian" and rightfully complaint that my project contains resources which are available in one language but not for all languages.
I changed the folder name "no" to something else and the warnings were gone. So bottomline is that one should be careful with file names and folder names which could be misinterpreted as language tags. Here is a list of all available language tags.
This error means that you have a localized string named "String" which is not defined in your default "en-US\Resources.resw" file.
If you look in your "de-DE\Resources.resw" file you should find the entry. You will have to report it to the default file or delete it if it is not needed.
All the strings which exist in your non-default localization files must have a default value in the default language file.
Related
In a Visual Studio resource file (.resx) for a C# project I've located strange entries which start with two greater-than signs (>>), e.g.:
<data name=">>$this.Type" xml:space="preserve">
<value>Framework.Forms.MyForm, Framework, Version=1.1.5127.0, Culture=neutral, PublicKeyToken=f4aaf1fba1062dc8</value>
</data>
These entries sort of reference various classes (MyForm, MyButton, etc.) in a custom framework library but in an outdated version.
Are these entries still valid? Should I change them so that they reference the current framework version? Do they have an impact on the project? Why does the name start with >>?
This is how .Net/Winforms stores text resources from Windows forms classes, if you have set "Localizable" to "True". This way, they are taken out of the .designer.cs code and are put into a resource file (one for every language supported) that can be switched, depending on the chosen language.
This is at least the one case I know, where resources appear that start with ">>".
I am building an application for UWP in Visual Studio 2017 (it is actually a Unity game, the solution is exported from Unity). During build, I get the following warnings, and the files which are reported as such do not show up in the final appxupload file, and thus cannot be found at runtime:
1>GENERATEPROJECTPRIFILE : warning PRI263: 0xdef01051 - No default or neutral resource given for 'Files/Data/GI/level1/ca51e77bb6146d425e0c9319844929a0.vis'. The application may throw an exception for certain user configurations when retrieving the resources.
There is a warning message for the resource situation in general, which reads like this:
1>GENERATEPROJECTPRIFILE : warning PRI257: 0xdef00522 - Resources found for language(s) 'be,ca,fa' but no resources found for default language(s): ''. Change the default language or qualify resources with the default language. http://go.microsoft.com/fwlink/?LinkId=231899
The languages that are reported as such are in folders which have language iso codes (for example, in the error message, the file is actually in the folder Files/Data/GI/level1/ca/). However, these folders are NOT language specific, they are named this way due to an internal indexing scheme of Unity which I cannot change.
So, what I am asking is this: How, and where, can I configure Visual Studio or whatever part of MSBuild is responsible to NOT treat these folders as language-specific? Or is there any other solution to this problem?
Thank you.
I found a solution/workaround. Part of the build is a call to makepri.exe which creates the Package Resource Index (PRI) files which more or less contain a directory of files in the build. Makepri, by default, looks for language-named folders and splits the build along the languages it finds - which moves the language-specific files into resource packs.
Luckily, this behavior can be configured, as is described here - makepri can be instructed to just place everything in one big resource file instead of splitting up. This is achieved by editing the .csproj file, and adding the following two lines to the configuration section for Master|x64:
<AppxBundleAutoResourcePackageQualifiers>
DXFeatureLevel
</AppxBundleAutoResourcePackageQualifiers>
<AppxDefaultResourceQualifiers>
Language=en-us;de-de;es-es
</AppxDefaultResourceQualifiers>
The first tag disables auto-language qualifiers (since "Language" is MISSING from the list of qualifiers). Since languages are now no longer auto-detected, they must be explicitly listed (second tag).
I've not found a way to do what I originally wanted - specifying that certain folders should not be considered language-specific - but this works for me.
Accoding to Andy Wigley on this video https://www.microsoftvirtualacademy.com/en-US/training-courses/a-developer-s-guide-to-windows-10-12618 (look in additional resources -> Localization), UPW apps download only the culture resources they need.
I'm writing an app that uses resource files not only to translate UI but also generate files for the user. User may want to generate files in different culture than the one the OS uses. How I can assure that e.g. if my system is in en-US I will be able to get resources in french?
I may use own XML files that all will be included in the app. But some of the resource for sure will be needed also in UI, so I don't want to duplicate the resources and have to translate them twice.
Rob's answer would work great for a new app, but it didn't work for me, as I had already shipped a previous version of the app as a bundled package. If you then try to switch to a non-bundled package, the store submission portal gives the error:
A previous submission for this app was released with a Windows 10 appxbundle. Subsequent submissions must continue to contain a Windows 10 appxbundle.
After reverse-engineering far too much of the build system, I found enough clues to discover this well-hidden documentation: https://msdn.microsoft.com/en-us/library/dn482043.aspx
Following the steps there, you'll still create a bundled package, but the toolchain won't use Language as a qualifier on which to separate out different bundles. In other words, the neutral package will have all the languages in it, while still bundling satellite packages for Scale (or whatever you like).
In case the MSDN page vanishes, the punchline is that you can override <AppxBundleAutoResourcePackageQualifiers> in your msbuild file to remove the Langauge qualifier:
<AppxBundleAutoResourcePackageQualifiers>Scale</AppxBundleAutoResourcePackageQualifiers>
If you do not want to separate out resources into separately downloadable bundles then you don't need to. When you build the app package you can choose to never create bundles so all resources are included in the main package.
See step six in Create an app package at https://msdn.microsoft.com/en-us/library/hh454036.aspx , but choose "never" instead of "always".
I have multi Language Application, first it was made in English only,
than one time i added support for German and Russian version and send resx files for translation to mates.
But while they do translation, i added few more checkboxes in GUI
and now when i copy their files and load German \ Russian GUI version those not translated checkboxes do not shown in in those languages.
My Question is:
Is there a way to update localized .resx files to version of main, as i can see it:
in Localized files if controls are missing - they will display in default language.
For translation they used: Zeta Resource Editor
Found answer by myself :) Maybe someone need it:
In this free program (Zeta Resource Editor) You can Add group of existing resources from Your VS Project - just select them an add, Zeta Resource Editor will auto show which strings are missing, so you can easily find them.
According to MSDN, one can add customized settings files to ones project for convenient management of groups of settings.
So I created a custom settings by visual designer, set all properties as a User Scoped to be able to save them.I bind some control properties to this customized settings. And change some values mannually through Properties.CustomSettings.MyValue = x;
But when I do Properties.CustomSettings.Default.Save() - nothing happens. The changes are not persisted between application run (I'm aware about Debug version change) .
I searched a file in the directorites that ConfigurationManager gives me (according to this post) but didn't find any track of this CustomSettings.
So, what is the trick with saving this Customized Settings Files and How to save Customized Settings Files?
Ok, now I've got a right answer. Everything is OK that this custom settings were created under the dll file.
The problem is with this question
Application.UserAppDataPath strange behaviour
If one have AssemblyVersion with automatic Build and Revision Numbers and have AssemblyFileVersion in AseemblyInfo.cs, say, of exe that uses this dll, then Application.UserAppDataPath will throw ArgumentException "Illegal characters in path." Application.UserAppDataPath is used to build path to this config file to save this CustomSettings.
But ApplicationSettingsBase just eats all exceptions that happens inside, so the file is just not saved and nobody could even think about AssemblyFileVersion in AseemblyInfo.cs of exe...
Ohhh my god... 8 hours of fighting with this ... feature...