MG/Translations

From MegaGlest
Revision as of 16:51, 2 September 2011 by 78.53.43.39 (talk) (add hint on translations mailing list)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Some of the existing translation are not very well maintained and, so far, only a couple languages are supported. So it's great that you're interested in working on this.

How it Works

There are several language files. These language files contain several lines which always take the same pattern:

keyword=translation string

These key words are referenced in the source code of the game. Depending on the language the user has chosen, when these keywords are met during execution of the game, the translation string which matches this keyword is taken from the language file and printed on screen.

Sometimes the core developers need to add or remove new translation strings to the language files. Whenever this happens, they update the english.lng file to make this work for english language. When they do, they either remove lines which are no longer referenced in the game (and thus no longer needed) or add new lines (for newly introduced texts) to english.lng. Sometimes, but not usually, they also add any newly added lines to the other translation files (but using the english language translation). So the reference file, the file all translations should check to make sure they contain the right keywords, is english.lng.

The latest version of english.lng is usually the one in trunk. There could theoretically be newer ones in (other) branches of the subversion source code repository but that's rather unlikely and if this should happen the core developers should be telling you (feel free to check, though).

Now to update an existing translation, you need get the latest copy of the existing translation file, which is usually the one in trunk, too.

To update for example galego.lng, based on english.lng, you need to:

  • Make sure you use a text editor which supports Unix style line endings (such as every editor on Linux does, and also Notepad++ on Windows (but not the original Ms Windows Notepad!)) and the ISO-8859-1 character encoding (we do not support UTF-8, yet :-/ )
  • Remove any lines from galego.lng which contain keywords which are not contained in english.lng.
  • Add any lines to galego.lng which contain keywords which are contained in english.lng (but have not been contained in galego.lng so far).
  • Replace the english translation strings by a galician translation. Try to use one which is not or just a little bit longer than the english string because the text will need to fit into a given place on screen.
  • Save the file using ISO-8859-1 character encoding.
  • Run the game with your new translation and see whether your new translations really make sense where they are used. It can easily happen that you add a translation which does not make sense in the given context. Also make sure that your translation really fits well on screen with the default font size. You may add "\n" to your translation strings to wrap the text across multiple lines (but make sure what this doesn't break the looks either).
  • Make a final check to verify it's all ok.
  • Paste your new/updated translation on http://megaglest.pastebin.com/ and paste the resulting internet address on the MegaGlest forums as a new bug. Alternatively, send the translation file to one of the core developers (by email). Please provide information on how you would like to be credited in the next release.

When you completed your translation, please make sure you also subscribe to the megaglest-translations mailing list. This announcement-only mailing list is only used to notify translators that we will soon release a new version, so they have a chance to ensure that their translation is complete. Note that during development it will happen that new translation keys are added, and possibly old ones removed, so it is very likely that changes need to be made to existing translations to make them complete for the next release.

See Also