0

Acoording to an answer it is possible to add your own resource localisation for a library (AvalonDock):

AvalonDock supports localisation using the standard resource mechanism. The binary download already contains English, Italian and German translations. You can add your own.

How do I do that?


What I have tried:

  1. Add NuGet the Extended.Wpf.Toolkit package
  2. create a of copy one of the AvalonDock official examples
  3. add new a Resources.resx
  4. add one of the keys in the documentation, Document_Close : "It works!"

However, nothing gets translated. I have tried bunch of other variations: adding a .resx for unknown language, setting culture to the language and changing namespace of the .resx to Xceed.Wpf.AvalonDock.Properties.

wondra
  • 3,271
  • 3
  • 29
  • 48

1 Answers1

0

If you download and re-compile from source you would have to add only a resx file, for instance, Xceed.Wpf.AvalonDock/Properties/Resources.es.resx for Spanish. To make it work though, you have to use the correct ISO base extension on the resx file.

Notice that es translates into Spanish and Resources.zh-Hant.resx (to give you another example) translates into Chinese (Taiwan). So, you have to pick the right extension for you language and also translate the strings inside the original Resources.resx file.

These names are based on ISO standards - here is a list of sample names. The culture name in the format languagecode2-country/regioncode2. languagecode2 is a lowercase two-letter code derived from ISO 639-1. country/regioncode2 is derived from ISO 3166 and usually consists of two uppercase letters, or a BCP-47 language tag.

So, you basically:

  1. copy the original file,
  2. rename the copy to to match your target language,
  3. translate the strings and add the resx file into the project.

Rebuild the project and select you target language at run-time...

user8276908
  • 1,051
  • 8
  • 20