Difference between revisions of "MG/Translations"

From MegaGlest
Jump to navigation Jump to search
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
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.
+
Some of the existing translations are not very well maintained and, so far, only a couple languages are supported, so keeping files up to date or adding new translations helps the [[MegaGlest]] community a great deal.
  
 
==How translations work==
 
==How translations work==
There are several language files. These language files contain several lines which always take the same pattern:
+
There are several language files for various languages and purposes. These language files contain several lines which always take the same pattern:
  
 
  keyword=translation string
 
  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.
+
These keywords (also dubbed 'translation keys') 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 keys (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 as a source). So the reference file, the file all translations should check to make sure they contain the right keywords, is ''english.lng''.
+
Sometimes the game developers and modders need to add or remove new translation keys (strings) to the language files. Whenever this happens, they update the english.lng file to make this work for English (but not for other languages). 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 text) to english.lng. Sometimes, but not usually, they also add any newly added lines to the other translation files (using the english language translation as a source). So the reference file, the file all translators should check to make sure they contain the right keywords, is <tt>english.lng</tt>.
  
The latest version of english.lng is usually [http://megaglest.svn.sourceforge.net/viewvc/megaglest/trunk/data/glest_game/data/lang/english.lng?revision=HEAD the one in trunk]. There could theoretically be newer ones in (other) [http://megaglest.svn.sourceforge.net/viewvc/megaglest/branches/ 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).
+
The latest version of <tt>english.lng</tt> is usually [http://megaglest.svn.sourceforge.net/viewvc/megaglest/trunk/data/glest_game/data/lang/english.lng?revision=HEAD the one in trunk]. There could theoretically be newer ones in (other) [http://megaglest.svn.sourceforge.net/viewvc/megaglest/branches/ branches] of the subversion source code repository but that's rather unlikely and if this should happen the developers should be telling you (feel free to check, though).
  
 
==How to provide translations==
 
==How to provide translations==
 +
Now to update an existing translation, you need to get the latest copy of the existing translation file, which is usually [http://megaglest.svn.sourceforge.net/viewvc/megaglest/trunk/data/glest_game/data/lang/?revision=HEAD the one in trunk], too.
  
Now to update an existing translation, you need get the latest copy of the existing translation file, which is usually [http://megaglest.svn.sourceforge.net/viewvc/megaglest/trunk/data/glest_game/data/lang/?revision=HEAD the one in trunk], too.
+
For example, to update for example <tt>galician.lng</tt>, based on <tt>english.lng</tt>, you need to:
 
+
* Make sure you use a text editor which supports Unix style line endings (such as every editor on Linux does and most editors on Windows — such as [http://notepad-plus-plus.org/ Notepad++]; Note that Microsoft's Notepad will '''not''' work) and the UTF-8 encoding.
For example, to update for example ''galego.lng'', based on ''english.lng'', you need to:
+
* Remove any lines from <tt>galician.lng</tt> which contain keywords which are not contained in <tt>english.lng</tt>.
* Make sure you use a text editor which supports Unix style line endings (such as every editor on Linux does, and also [http://notepad-plus-plus.org/ Notepad++] on Windows (but not the original Ms Windows Notepad!)) and the UTF-8 encoding.
+
* Add any lines to <tt>galician.lng</tt> which contain keywords which are contained in <tt>english.lng</tt> (but have not been contained in <tt>galician.lng</tt> so far).
* 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.
 
* 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 UTF-8 character encoding.
+
* Save the file using UTF-8 character encoding. In case this option is provided, please do not store the byte-order mark (BOM).
* 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''' (backslash and n) to your translation strings to wrap the text across multiple lines. But make sure what this does not break the looks either - you should test this at a 800x600 resolution.
+
* Run the game with your new translations 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 <tt>\n</tt> (backslash and 'n') to your translation strings to wrap the text across multiple lines. But make sure what this does not break the looks either - you should test this at a 800x600 resolution.
 
* Make a final check to verify it's all ok.
 
* Make a final check to verify it's all ok.
* Paste your new/updated translation on http://paste.megaglest.org and paste the resulting internet address on the MegaGlest forums as a new [bug]. Alternatively, send the translation file to [http://megaglest.org/contact.html the general contact e-mail address] or one of the main developers (by e-mail). Please provide information on how you would like to be credited in the documentation for the next release.
+
* Paste your new/updated translation on [http://paste.megaglest.org paste.megaglest.org] and paste the resulting internet address on the MegaGlest forums as a new translation. Alternatively, send the translation file to [http://megaglest.org/contact.html the general contact e-mail address] or one of the main developers (by e-mail). Please provide information on how you would like to be credited in the documentation for the next release - we usually credit people either by their first name, full name or nickname.
 +
 
  
 
== Keep your translation up to date==
 
== Keep your translation up to date==
After you completed your translation, please make sure you also subscribe to [https://lists.sourceforge.net/lists/listinfo/megaglest-translations 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.
+
After you completed your translation, please make sure you also subscribe to [https://lists.sourceforge.net/lists/listinfo/megaglest-translations the megaglest-translations mailing list]. This mailing list is 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==
 
==See Also==
Line 33: Line 33:
 
*[[MG/FAQ|Frequently Asked Questions]]
 
*[[MG/FAQ|Frequently Asked Questions]]
 
*[[Scenarios]]
 
*[[Scenarios]]
[[Category:MG]]
 
[[Category:XMLs]]
 
 
[[Category:MG]]
 
[[Category:MG]]
 
[[Category:XMLs]]
 
[[Category:XMLs]]

Revision as of 05:44, 15 November 2011

Some of the existing translations are not very well maintained and, so far, only a couple languages are supported, so keeping files up to date or adding new translations helps the MegaGlest community a great deal.

How translations work

There are several language files for various languages and purposes. These language files contain several lines which always take the same pattern:

keyword=translation string

These keywords (also dubbed 'translation keys') 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 game developers and modders need to add or remove new translation keys (strings) to the language files. Whenever this happens, they update the english.lng file to make this work for English (but not for other languages). 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 text) to english.lng. Sometimes, but not usually, they also add any newly added lines to the other translation files (using the english language translation as a source). So the reference file, the file all translators 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 developers should be telling you (feel free to check, though).

How to provide translations

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

For example, to update for example galician.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 most editors on Windows — such as Notepad++; Note that Microsoft's Notepad will not work) and the UTF-8 encoding.
  • Remove any lines from galician.lng which contain keywords which are not contained in english.lng.
  • Add any lines to galician.lng which contain keywords which are contained in english.lng (but have not been contained in galician.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 UTF-8 character encoding. In case this option is provided, please do not store the byte-order mark (BOM).
  • Run the game with your new translations 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 (backslash and 'n') to your translation strings to wrap the text across multiple lines. But make sure what this does not break the looks either - you should test this at a 800x600 resolution.
  • Make a final check to verify it's all ok.
  • Paste your new/updated translation on paste.megaglest.org and paste the resulting internet address on the MegaGlest forums as a new translation. Alternatively, send the translation file to the general contact e-mail address or one of the main developers (by e-mail). Please provide information on how you would like to be credited in the documentation for the next release - we usually credit people either by their first name, full name or nickname.


Keep your translation up to date

After you completed your translation, please make sure you also subscribe to the megaglest-translations mailing list. This mailing list is 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