Add support for translations
Disclaimer
We are not accepting translations right now as this is still a work in progress - only after we finalise everything and merge this into the main branch we will start accepting translations via pull requests or the web page (see below).
Description
Implements a translation system to support different languages in all relevant places. We are using our own custom translation system to prevent meteor being detected by servers via the translation exploit.
We have set up a web page at https://translations.meteordev.org where users can create an account and submit translations - we will periodically merge this into the master branch. It would be useful to set up some incentives for translating, e.g. after translating 25 keys they can be added to meteor.lang.translators or after 100 keys they get access to a translator cape.
Information for developers
This will break every addon that currently exists and will not only require addon authors update their existing addons, but places more to do on the authors when creating new features in the first place, as meteor will now expect user facing strings like names and descriptions to be placed in the language file.
Todo fill this out, maybe create a Translations.md file.
- Modules can no longer have spaces in their name and doing so will throw a runtime exception - follow
kebab-casenaming as with meteor
Things to do
- [x] Map any remaining hardcoded strings to the lang file.
- [x] Add translatable keys to the lang file that aren't already in there (config, hud, macros, profiles, probably more).
- [x] Fix issues with the font renderer once and for all - #333, #4763.
- [ ] Allow
ChatUtilsto accept translatableTextcomponents - we can't just pass in a translatedStringsince they do not update with the language. - If there is any way to deduplicate translation keys, it would probably be helpful for anyone trying to translate the project, as at the time of writing there are 3,275 keys and that is only going to increase. Should deduplicate:
- [ ] Hud elements
- [ ] Marker shapes
- [x] Contact owners of existing translation projects (e.g. dingzhen-vape/Meteor-I18n-Support-plugin) to include their translations in meteor.
- [ ] allow overriding the settings name and description for when we dont want to provide a translatable one
- We should probably bundle some scripts with meteor and the addon template to make updating and maintaining features easier. Examples of what would be useful:
- For updating addons - scanning the project for places where we expect translatable text (settings, modules, commands, categories, hud elements, etc.) and automatically extracting relevant strings into the lang files (names, descriptions, etc.)
- For already updated addons - after creating new modules/commands/hud elements, scan the language files to ensure they have translation keys and append them if they are not present.
- Scanning the lang file for duplicated, unused, or illegal/misnamed keys and reporting them to the developer.
- For multilingual projects, something to scan one primary language file (en_us) and ensure the keys are consistent between it and all other language files present.
Related issues
closes #5282 closes #5864 closes #2141 closes #5563
Also solves #5563?
The Simplified Chinese translation is done! :)
The Simplified Chinese translation is done! :)
@Wide-Cat https://github.com/MeteorDevelopment/meteor-client/pull/6029/commits/9f3c172a3a03c5fe17677d393f19e5b14f6a8fb0 A lot of https://github.com/Nippaku-Zanmu/meteor-translation-addon project seems to be machine-translated and feels very weird. I suggest checking out this project instead: https://github.com/xingke0/meteor_chinese/blob/master/src/main/resources/assets/meteor-translation-addon/lang/zh_cn.json