Editing MG/Translations

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 43: Line 43:
  
 
== Translating techtrees==
 
== Translating techtrees==
Please refer to the separate page on [[MG/Translations/Techtrees|translating techtrees]].
+
Since MegaGlest 3.8.0-dev+r4436 (that is between 3.7.1 and 3.8.0-beta1, so definitely version 3.8.0-beta1 and newer) the game fully supports (initial support was available in 3.8.0-dev+r3285) translating all the techtree related strings such as unit or structure titles and unit/attack properties which display on the graphical user interface.
[[Category:MG]]
+
===Translation of distributed techtrees===
[[Category:Translations]]
+
 
 +
Techtrees which are distributed and installed with MegaGlest - that's currently the ''Megapack'' only - can and should be translated by editing the [https://www.transifex.com/projects/p/megaglest/resource/megapack/ Megapack resource on Transifex] . Should there be more techtrees distributed with MegaGlest in the future, they will be added as separate resources on Transifex. Should we forget to do so, please bring it up on the translation mailing list (see below).
 +
===Translation of non-distributed techtrees===
 +
Normally, techtrees not distributed with MegaGlest need to be localized manually. However, a growing number of techtrees can now be translated on Transifex. 
 +
====Translation on Transifex====
 +
 
 +
Non-distributed techtrees such as those listed on the mod menu, can now be translated on the [https://www.transifex.com/projects/p/megaglest-mods-techtrees/ megaglest-mods-techtrees project] on Transifex. Please read [[MG/Translations/Unofficial Techtree Translations|Unofficial Transifex's project of Techtree Translations]] for more information.
 +
 
 +
====Manual translation - Initialization====
 +
Before starting with a manual translation process, please get in touch with the MegaGlest project maintainers on Transifex (they usually have [https://forum.megaglest.org/index.php?action=mlist;sa=search forum accounts] , too) or [http://megaglest.org/contact.html the MegaGlest project] itself and explain that you would like to translate a techtree (and which one). They may then grant you access to the translation project on Transifex, and this should make things considerably easier for you and other translators. 
 +
 
 +
If you would still like to manually translate, please read on. First of all, a techtree needs to be prepared for localization. This only needs to be done the first time a techtree is localized, or when units / structures / resources / upgrades have changed in the techtree's XML files.
 +
 
 +
This process creates / updates the (English) source language files containing all techtree related translation keys, based on values found in the techtrees' (already existing) XML files. To do the initialization for an example techtree ''MyTechtree'' whose main XML file is ''mytechtree.xml'', change into the directory MegaGlest is installed in and run the executable binary file as follows (again replace ''mytechtree'' by the name of your techtree):
 +
=====Linux, OS X=====
 +
./megaglest --translate-techtrees=mytechtree
 +
=====Windows=====
 +
megaglest.exe --translate-techtrees=mytechtree
 +
====Editing====
 +
 
 +
Once initialized, the techtree can be localized by manually editing the files:
 +
 
 +
* For a given techtree ''MyTechtree'' create a subdirectory named ''lang'' within the ''mytechtree'' (techtree) directory, i.e. <tt>techs/''mytechtree''/lang/</tt> - if this directory does not exist then this techtree has not been initialized for localization, yet.
 +
 
 +
* In this new directory, create a new create a new copy of the source translation file  <tt>''mytechtree''_english.lng</tt> as <tt>''mytechtree''_''language''.lng</tt> where ''language'' is the localization you wish to create (skip this step if the target file already exists). Have a look at how it's done for Megapack if you'd like to get a better idea of what the file / directory structure should look like.
 +
 
 +
* Edit the newly created file <tt>''mytechtree''_''language''.lng</tt>. You will notice that there are several keys in this format:
 +
** <tt>ResourceTypeName_''food''=Yummies</tt>
 +
** <tt>UnitTypeName_''archer''=Stealth Minion</tt>
 +
** <tt>UpgradeTypeName_''advanced_architecture''=Fancy Science</tt><br />
 +
:: Here, ''food'', ''archer'' and ''advanced_architecture'' are examples. You need to use the keywords this very techtree defines there. At runtime, the game will display any localized resource, unit, structure, upgrade, ... titles available on those localization files (make sure you have not misspelled the keys and target language / file name - check against those in Megapack). If no mathcing localizations are found or for the currently selected language there is no techtree localization, yet, the game will defaults to the source language strings.
 +
==== Related forum discussions====
 +
* [https://forum.megaglest.org/index.php?topic=8845 Support for 100% translation]
 +
* [https://forum.megaglest.org/index.php?topic=8292 Translatable techtrees]
  
 
== Keep yourself in the loop==
 
== Keep yourself in the loop==

Please note that all contributions to MegaGlest are considered to be released under the Creative Commons Attribution Share Alike (see MegaGlest:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)