This project is read-only.

error when also using default resource files

Aug 10, 2011 at 10:16 AM

Hi there,

When using this addon i am getting errors in the following situation:

i have the default ui-locale set to EN.
I have the following resource files in this directory: /properties/resources.resx and /properties/resources.en-US.resx
and i have the following translated resource files in this directory added by the easybamladdin: /translation/translate.resx and /translation/translate.en-US.resx

So i have translated the WPF forms using this addin. and i have a translated string in my code that i have placed in the properties/resource files.

everything goes fine if i force the UI-locale to "en-US". However when i force it to the default locale "en" i get errors that my application cant find the necessary resource files. It says it is searching for a file with "en" in it. However this translation data is placed in the files properties/resources.resx and translation/translate.resx.

 

anyone able to tell me why this isnt working?

 





Aug 10, 2011 at 12:37 PM

Hi!

I'll investigate this in nearest days.

It will be helpfull, if you can upload your solution sources.

Does error occur when UI is loaded or when you try to access string resource?

Please ensure also that assembly attribute "[assembly: NeutralResourcesLanguage" was set correctly.

Regards,

Konstantin

Aug 10, 2011 at 1:12 PM

it occurs the moment i try to access the string resource.

i will try to add a solution soon

Aug 10, 2011 at 1:25 PM

hereby the solution file:

http://www.megaupload.com/?d=3F147WMA

in this solution i forced the UI to "en-US" (This is the default UI in this solution). The translations for UI are in the properties/resources.resx and in the translations/translate.resx file.

 

Aug 12, 2011 at 8:47 PM
Edited Aug 12, 2011 at 8:48 PM

It appeared that when project with <UICulture> specified is compiled, neutral BAML resources goes to satellite assemblies, but neutral embedded resources stays in main assembly.

Possible ways to fix this incosistency:

1) embed neutral string resources into neutral satellite assembly;

2) don't use <UICulture> and embed neutral BAML resources in main assembly;

3) override NeutralResourcesLanguage attribute in resource managers, which load string or BAML resources.

I'm going to try (2) and hope to get some results in few days.

Aug 13, 2011 at 4:13 PM
Edited Aug 15, 2011 at 7:35 PM

Here's solution: CodePlexSample.zip

I'll integrate it in the next version of addin (1.0.9).

List of changes:

1) In BamlLocalization folder files are updated.

2) <UICulture> property removed from .cproj file.

3) NeutralResourcesLanguage attributes is not used (or if you wish to use it, must be with UltimateResourceFallbackLocation.MainAssembly).

 

Please note, that if you'll press "Configure Solution" in addin version 1.0.8, it will override these changes.

So I recommend to wait for 1.0.9 release.