OpenRA
OpenRA copied to clipboard
Translation support
Prerequisites for initial translations:
- [x] Engine support:
- [x] Translation support for yaml-defined strings. [~~#3929 #18959~~] [#18965]
- [x] Translation support for code-defined strings. [#18965]
- [x] Translation support for Lua-defined strings. [#18965]
- [x] Change server messages to send a string ID and arguments to translate client-side. [#19847]
- [ ] Tooling:
- [x] Automated chrome string extraction. [~~#5152 #18959 #20594~~] [#21134]
- [x] Automated format string sanity checks (verify that strings with formatting parameters define the same number across all translations). [#19847]
- [ ] Utility command for showing missing translation strings. [#19847 #21490 #21525]
- [x] Extract hardcoded strings from C# code into English translation. [#20048 #20142 #20380 #20262 #20876]
- [x] Extract hardcoded strings from Lua code into English translation. [#20265 #20387 #20390]
- [ ] Extract yaml strings into English translation. [#20393 #20400 #20585 #20725 #21204 #21241 #21385 #21386 #21484 #21489 #21526]
- [X] Include language setting in crash logs. #20391
Later improvements:
- [x] Support for detecting/downloading/installing foreign content bundles (sound/art). Related to the ongoing mod browser / installation work. [#11375 and followups]
- [ ] Support for switching art/sounds based on translation.
- [ ] Per language font initialisation [#17794]
#11375 and followups check off support for detecting/downloading/installing foreign content bundles.
I believe the whole approach taken may be a dead end. Instead of building our own incompatible translation system we should try to hook up something standardized like https://github.com/neris/NGettext where tooling already exists.
I played a bit with https://crowdin.com/project/openra and yml is supported although we don't adhere to the Ruby translation system. We will need tooling that converts our @PLACEHOLDERS@ to English, generate English to Language files for the web interface and converter Language to @PLACEHOLDERS@ back.
Is adding translation support to the auto generated documentation also considered as part of this ticket?
It is not, and I would argue against adding that (but not in this ticket).
There's font problem too, the default fonts don't support CJK characters. There should be some way of providing additional fonts for the translations.
Why not do a translation like this: there is a file "ra|chrome/ingame-player.yaml" and need a translation for "XXX". So try to load it from ".\mods\ra\languages\XXX\chrome\ingame-player.yaml", if there is no file try to load ".\mods\ra\chrome\ingame-player.yaml" then the load error is mod.
another option: try load "mods\ra\languages\XXX\mod.yaml" instead of "mods\ra\mod.yaml". And in it to register instead of "ra|chrome/ingame-player.yaml" already "ra|languages/XXX/chrome/ingame-player.yaml". Also, in the file "mod.yaml" mark the files for translation with a comment.
Translation for the yaml files has been solved for a long time. The issue is with all of the strings hardcoded in the game code. That has also been solved in principle, we just don't have anybody willing to do the work.
In principle I'd be willing to, but I'll need some help getting my head around the "how to". That's something for "later this year" at best, though.
True, I took a look in the past but I have no idea how.
I'm trying to translate the code-defined strings. Translated by LogoStripeLoadScreen.cs, IngameMenuLogic.cs, SettingsLogic.cs and ChromeLayout. https://github.com/Sav87/OpenRA/commit/8792fefcbfcc952652bfe05bf0dc5c694b24f700 Continue the translation?
That is pretty much the right idea, but there is an important point that you will need to consider and change. When you have a line like line.GetText = () => FieldLoader.Translate("STRING-ID") this is actually a function that is called every time the game renders. You really don't want to be retranslating these strings 60 times per second!
Instead use a pattern like this:
var translatedStringID = FieldLoader.Translate("STRING-ID");
line.GetText = () => translatedStringID;
We will also need to support for map-defined translations, so your changes to LoadTranslations will need to be reworked.
I understand the translation of MissionBriefing? and where should it be recorded? if the file 'languages/*.yaml' then this should not be a problem. If in these files there is a necessary line that without a difference for what it to use: a maps, code, chromeLayout...
We may want (or perhaps even need) to adopt something like https://projectfluent.org/ (developed by Mozilla) to be able to cleanly handle the dynamic messages in the chrome logic. This should also help with the availability of standard tooling for translators.
There is now a $15 usd bounty on this issue. https://www.bountysource.com/issues/29755626-translation-support
I just saw this project today and I played it. It feels really good. If you have multi-language support, then more people should be able to experience such a great project, so I support $15 in multi-language support. I am a red alert game enthusiast, and also a program developer. If the multi-language module starts to develop, I can also join the localization translation.
https://github.com/cookgreen/Yuris-Revenge has a Chinese translation.
Hey guys, i just translate the text files from rules and the sound files are german now... Later i make a download file ... Maybe someone can implate this into the game :/
https://youtu.be/mSk2vXAVkKE
any progress on this, or guidance / ideas how we can help?
https://github.com/cookgreen/Yuris-Revenge has a Chinese translation.
Another translation about RA2 mod. Download page. Hope it can be set in games in the future
How's translation system going? I want to help with Russian if it works :p
Hi! We are still not ready, but hopefully we could be in in time for next release.
Hi! We are still not ready, but hopefully we could be in in time for next release.
Oh this is nice to read. And this all really took 8 years to implement? woah
it only properly started about 2 years ago