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)
Change History (3)
comment:1 by , 10 years ago
by , 10 years ago
Attachment: | atlas-l10n-wip.patch added |
---|
comment:2 by , 10 years ago
From a quick investigation, here are some of the issues with translating Atlas:
- Translations are performed by either
_()
(mark and translate) orwxTRANSLATE()
(mark wo/ translate, for static and global variables), so the attached WIP patch adds amessages.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 thinkingbinaries/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.
Note:
See TracTickets
for help on using tickets.
Maybe we should get it to work on Mac before doing this. Don't you use 3.0.1 now ?