the-butterfly-effect / tbe

The Butterfly Effect, a realistic physics simulation game
http://the-butterfly-effect.org
GNU General Public License v2.0
95 stars 13 forks source link

Improve Level i18n system #307

Open kaa-ching opened 7 years ago

kaa-ching commented 7 years ago

The current way of i18n for level translations, as implemented in Milestone B:

  1. levels contain only English texts
  2. tbe_levels_i18n.sh extracts the strings and creates a tbe_levels.pot file
  3. this is uploaded to Transifex
  4. the Transifex community translates the strings
  5. we download the various *.po files from Transifex
  6. during build, these PO files are translated to LC_MESSAGES files
  7. these are used by the gettext() to translate the strings

There are several issues with the current mechanism:

  1. step 7 above requires working gettext support on all platforms (partial issue on MacOSX) (partial issue on Windows) (real issue on Win64 with Visual Studio)
  2. character translation in step 7 fails with QML - see the post-its of level picnic-0 in German: i18n-qml-fail
  3. shipping two different i18n systems feels wrong and bloated.
amarsman commented 7 years ago

Totally agree with this ticket, the introduction of this "feature" causes that currently a macOS build is tightly coupled to a specific macOS release. We need to get rid of gettext, I assume you want to keep Transifex support? Does Transifex support the Qt way of working?

kaa-ching commented 7 years ago

Yes, Transifex supports the QT translation mechanism as well - it's in use for translating the strings in the main application.

My suggestion would be to write small tools that read the level XML (based on CleanLevels.cpp in the i18n directory?) and generate the tbe_levels_en.ts file - this will the base file for Transifex. Note that we'll also have to teach Transifex the existing translations for levels, otherwise a lot of work might go to waste... Not sure how to do that.

By the way, in case you want to check it out, here's the link to Transifex: https://www.transifex.com/Magic/thebutterflyeffect/ you can use your github login as a login mechanism. The dutch translation can use some help ;-)

Wuzzy2 commented 7 years ago

My opinion as a translator: Neutral. Whether it's the Qt I18N system or Gettext or a mixture of both, I don't care, I can work with either. Both are very good and mature translation systems IMO, so I don't really care which of those two you choose, as long it is working at the end. That having said, do whatever you think is neccessary for the project.

glixx commented 7 years ago

If you want to use TS files only, then you should open POT/PO file in Linguist and save as TS file. So convertation is easy.

kaa-ching commented 7 years ago

yay, thanks for the tip, glixx!

kaa-ching commented 7 years ago

It looks like pull request #312 by @glixx generates TS files out of POT files, right?

kaa-ching commented 7 years ago

Just to make clear: I'm all in favour of fixing this, but I'm only going to do that after I've completed the big change to QML. So expect second half of November.

glixx commented 7 years ago

Yes, I propose to use lconvert for converting POT file into TS file. So you don't need special tool to generate the tbe_levels_en.ts file.

kaa-ching commented 7 years ago

I've merged #312.