I am thinking aloud on the translation process of TMW.
Translation of client
Already being done. A few things to keep in mind for hackers:
- Keep sentences complete, while your clever solution at dynamically creating text strings may work in English, it will most likely not do that in other languages.
- Always include variables in the strings, they may need to be rearranged.
- Please include all kind of punctuation marks in the strings, different languages may use other marks.
- Do not include unnecessary spaces, tabs and similar blanks in the strings.
- Try to keep almost identical strings identical.
Translation of server
It might be preferable to keep translateable text minimal and instead put most of that in the client or data modules/repositories.
Translation of client/server data
Currently the client and server data are not translateable, and while many methods could be used to achieve it, gettext is preferred as that is the translation system already used elsewhere.
It seems there already is gettext support for Lua. For the Athena and magic scripts a custom gettext extraction tool probably is needed. There probably exists some scripts for XML and gettext somewhere already.
The scope
The following current data files could potentially be translated:
- XML scripts in tmwdata
emotes.xml
(emote names)hair.xml
(hair colour names)items.xml
(item names, descriptions and effects)monsters.xml
(monster names)skills.xml
(skill names)status-effects.xml
(text messages)units.xml
(unit names)
- XML scripts in tmwserv-data
runes.xml
(rune names)
- Lua scripts in tmwserv-data
scripts/*.lua
(text messages et cetera)
- Athena scripts in tmw-eathena-data
npc/*.txt
(text messages)
- Magic scripts in tmw-eathena-data
conf/magic.conf (text messages)
- Possibly other
conf/*.conf
files, such asmotd.conf
A few questions:
- Where are the element names defined?
- Add human readable versions of the spell names to
magic.conf[.template]
?
Similar approaches
Wesnoth has used a similar approach for their own mark-up language (WML), see for instance:
Translation of the web interface
The PHP files in the tmwweb module should be made translateable with gettext as well, see http://www.php.net/manual/en/book.gettext.php for instance. Currently a non-gettext solution is used, which does not scale very well.