-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Localization
First thing, check if the translation isn't already done! Or up to date.
- A text editor or maybe Visual Studio.
- The
StringResources.en.xaml
file, that contains all the translatable text. - The language code (
LCID
) of your translation, something likept-BR
oren
. It can be specific to a region or generic to an entire language branch.
A generic translation acts as a fallback resource if a specific translation bound to the region of your environment is not present.
##Acquiring the translatable texts
- Head over to the Localization folder.
- Download/copy any of the xaml files. (I recommend to download the English version or the Brazilian Portuguese because they are always updated)
- When saving the text, please use the UTF-8 encoding.
It looks easy, but there's a lot to translate.
Each <s:String...
tag represents a translatable string, you just need to translate the content of that tag:
<s:String x:Key="Yes">Yes</s:String>
English to Brazilian Portuguese.
<s:String x:Key="Yes">Sim</s:String>
To represent a new line, you can use and to represent a carriage return + new line, use
<s:String x:Key="Editor.File.SaveProject">Save as
Project</s:String>
Simple, name like (replace with your LCID):
StringResources.pt-BR.xaml
You can test your translations by using the importer.
Go to **Options **> **Language **> Bottom of the page, **Import ** and import your custom xaml
file.
The resource that is located at the last position (bottom) of the resource list will be used as the main source for the strings.
There's a fallback mechanism, if one resource is not found within the last resource, it will search inside the previous.
- You can send the
xaml
file as attachment to [email protected]. - Or make a pull request using Git.
- Microsoft Windows 7 SP1/8.1/10/11
- .NET 6 (Desktop Runtime) or newer.
- Visual Studio 2022
- .NET 6