Opened 10 years ago

Last modified 10 years ago

#2649 new enhancement

Atlas internationalization

Reported by: historic_bruno Owned by:
Priority: Should Have Milestone: Backlog
Component: Atlas editor Keywords:
Cc: Patch:

Description

Now that the game engine has internationalization, it would be nice to have in Atlas as well :) It looks like wxWidgets is designed with gettext integration in mind, so we should be able to make it work in our i18n/l10n pipeline. If possible, it would support wxWidgets 2.8-3.0.

Attachments (1)

atlas-l10n-wip.patch (27.4 KB ) - added by historic_bruno 10 years ago.

Download all attachments as: .zip

Change History (3)

comment:1 by Stan, 10 years ago

Maybe we should get it to work on Mac before doing this. Don't you use 3.0.1 now ?

by historic_bruno, 10 years ago

Attachment: atlas-l10n-wip.patch added

comment:2 by historic_bruno, 10 years ago

From a quick investigation, here are some of the issues with translating Atlas:

  • Translations are performed by either _() (mark and translate) or wxTRANSLATE() (mark wo/ translate, for static and global variables), so the attached WIP patch adds a messages.json that extracts strings from those functions.
  • wxWidgets loads compiled .mo files, not .po files.
  • wxWidgets expects a certain folder structure: prefix/<lang>/catalogname.mo, where <lang> is an ISO 639 code (e.g. de, en, fr), and catalogname is something like "atlas" that identifies the set of translations. The documentation isn't really clear on whether e.g. "en_GB" is also a valid lang, but it references such codes.
  • We may need a default "en" or "en_US" translation.
  • It searches in OS-dependent "standard" locations, /usr/share/locale on *nix, 0ad.app/Contents/Resources/*.lproj/ on OS X. However, we can call wxLocale::AddCatalogLookupPathPrefix to add our own paths inside the game's install directory. I'm thinking binaries/data/tools/atlas/l10n is a decent location, as it's used for other Atlas-only data.
  • We can add custom user-defined languages with wxLocale::AddLanguage.
  • In wxWidgets 2.9+, we can define our own custom translations loader, but that doesn't exist in 2.8.
  • Translations are set by initializing wxLocale.
Last edited 10 years ago by historic_bruno (previous) (diff)
Note: See TracTickets for help on using tickets.