Localizing a ReSharper 9.1 extension

Hey guys,

I have the feeling I'm the only one that is posting questions in this forum, but as long as someone is answering and I'm not speaking with myself, this is fine for me :p

I'm currently thinking about localizing my ReSharper 9.1 extension and I cannot not find any documentation on how to do it.

Taking one step back: Localizing a WPF application is straight-forward (see minimal example [1]): Just add the default locale to the AssemblyInfo and provid three resource files. My machine is set to an "en-US" locale, so when I start the application, the main window contains three labels that reflect the information available in the resource files: "LabelA (de-DE)", "LabelB (en)", and "LabelC (en-US)".

Back to topic: I created a minimal R#9.1 extension which I would like to localize [2]. I created Action+Descriptor+Registrar that are necessary to display a WPF based tool window and then added the default locale to the AssemblyInfo. The XAML designer view displays the localized strings for the labels(!), but when I start the extension, all labels in the tool window are localized with "de-DE", the other resource files are ignored, even though my locale is set to "en-US"

I do not understand why the latter one is not working and I would appreciate any help or pointers. Thanks!

best
Sebastian

[1] https://github.com/proksch/localized-wpf-minimal
[2] https://github.com/proksch/localized-rs91-minimal

3 comments
Comment actions Permalink

I'm not really familiar with localisation, but isn't this line: https://github.com/proksch/localized-rs91-minimal/blob/master/Properties/AssemblyInfo.cs#L17 telling the ResourceManager to use the "de-DE" resources for the neutral culture (i.e. your normal culture)?  https://msdn.microsoft.com/en-us/library/system.resources.neutralresourceslanguageattribute.aspx

0
Comment actions Permalink

Yes, it is. But I also provide resources for "en" and "en-US" so every label should contain a more specific localization than the preceding one.

A colleague of mine already pointed out the mistake I made... I missed to include the generated assembly satelites in my .nuspec file [1].

Now that I fixed it, localization works like a charm... (and it is really easy to do, you should have a look at it ;))

best
Sebastian

[1] https://github.com/proksch/localized-rs91-minimal/blob/master/Localized.RS91.Example.1.0.0-alpha1.nuspec#L17

0

Please sign in to leave a comment.