OpenRA icon indicating copy to clipboard operation
OpenRA copied to clipboard

Translation support

Open pchote opened this issue 9 years ago • 24 comments

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]

pchote avatar Jan 10 '16 23:01 pchote

#11375 and followups check off support for detecting/downloading/installing foreign content bundles.

pchote avatar Jun 26 '16 22:06 pchote

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.

Mailaender avatar Sep 04 '16 06:09 Mailaender

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.

Mailaender avatar Sep 25 '16 05:09 Mailaender

Is adding translation support to the auto generated documentation also considered as part of this ticket?

abcdefg30 avatar Sep 29 '16 11:09 abcdefg30

It is not, and I would argue against adding that (but not in this ticket).

pchote avatar Sep 29 '16 14:09 pchote

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.

forcecore avatar Jan 18 '17 03:01 forcecore

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.

Sav87 avatar May 04 '18 13:05 Sav87

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.

pchote avatar May 04 '18 14:05 pchote

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.

reaperrr avatar May 04 '18 20:05 reaperrr

True, I took a look in the past but I have no idea how.

forcecore avatar May 05 '18 01:05 forcecore

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?

Sav87 avatar May 10 '18 16:05 Sav87

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.

pchote avatar May 10 '18 16:05 pchote

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...

Sav87 avatar May 10 '18 16:05 Sav87

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.

pchote avatar Jul 01 '18 10:07 pchote

There is now a $15 usd bounty on this issue. https://www.bountysource.com/issues/29755626-translation-support

xan2622 avatar Oct 05 '18 18:10 xan2622

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.

wshon avatar Jul 07 '19 09:07 wshon

@pchote Translate Yaml or Fluent?

Sav87 avatar Sep 28 '19 17:09 Sav87

https://github.com/cookgreen/Yuris-Revenge has a Chinese translation.

Mailaender avatar Dec 30 '19 20:12 Mailaender

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

akpellablok avatar May 04 '20 09:05 akpellablok

any progress on this, or guidance / ideas how we can help?

AngryUbuntuNerd avatar May 06 '20 22:05 AngryUbuntuNerd

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

BackMountainDevil avatar Jan 05 '22 02:01 BackMountainDevil

How's translation system going? I want to help with Russian if it works :p

Blueberryy avatar Aug 20 '23 21:08 Blueberryy

Hi! We are still not ready, but hopefully we could be in in time for next release.

penev92 avatar Aug 21 '23 05:08 penev92

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

Blueberryy avatar Aug 21 '23 08:08 Blueberryy

it only properly started about 2 years ago

PunkPun avatar Aug 21 '23 08:08 PunkPun