Languages Support - X-Hax/SA-Mod-Manager GitHub Wiki
Languages Support
SA Mod Manager does support multi languages for most of its UI, this means it can be translated into another language.
Table of Contents
- How does the localisation system work
- Creating a new translation
- Uploading the translation
- Updating translations
How does the localisation system work
The language system is built using XAML files which contain all the strings needed. When you download the repo, you can find the files in SA-Mod-Manager/Languages
named with the first two letters of the ISO 639-1 code for the language followed by a dash (-) and then the first two letters of the ISO 3166-1 code for the region ending with the file extension of ".xaml". Example: "es-ES.xaml" and "es-MX.xaml", both are Spanish language, but not the same region. If you aren't sure about your language region, Google is your friend.
Note: SA Mod Manager works in a way so if a string isn't translated, it will show the English version instead, so there is no risk of empty text or error.
Creating a new translation
Requirement:
- Download and Install Visual Studio Community (you can pick net 8.0 runtime during the installation.)
- a GitHub Account so you can fork this repo and download it to make your own modification before submitting them.
Once you have made your fork and downloaded it, you will need to create a new language file. In order to do this, you can look for the Languages folder in the SA-Mod-Manager folder and then simply copy "en-EN.xaml" and rename it to match the language you are adding, you can repeat this step in each sub folder.
After creating the language files, you can edit them with your favorite text editor or Visual Studio itself. Once opened, you will only need to translate the strings within the XML elements. If you aren't sure how that works, please learn the basics of XML or check other language files.
Note: Please do not remove or edit value like: {0}
those are placeholders for data.
After you're done translating, you need to add your language in the list so users will be able to select it. In order to do that, simply look for the "languages.xaml" file in the language folder and open it to add your new language by following how the others are set up. (Just copy one of them and rename with your language really).
Finally, you can start testing it by opening the project with Visual Studio (the .sln file) and then simply press F5, this will build the project and open the Manager automatically. After that, you can test and check if your translation work and if not, just make the changes needed until you're happy with.
Uploading the translation
After you have finished translating, you will need to upload your changes to your fork. This can be done from Visual Studio using the Git Changes tab in the Solution Explorer, or you can do it with GitHub Desktop, whatever is the best for you. Finally, create a Pull Request on this repo so we can add your translation.
Updating translations
If you want to update your existing translation, either because of error or just for the new strings, you can update the file and upload it. Once it's done, just open a new Pull Request.
If you need any help in this process, feel free to join the X-Hax discord.