Difference between revisions of "Translation for developers/en"

Jump to navigation Jump to search
Importing a new version from external source
(Importing a new version from external source)
(Importing a new version from external source)
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{translations}}
{{translations}}
Beside the pure [[translation]] part of the work, the '''Kiwix source code needs to be synchronized with Translatewiki'''.
Beside the pure [[{{ll|translation}}]] part of the work, the '''Kiwix source code needs to be synchronized with Translatewiki'''.


This synchronization with Translatewiki needs three types of operations:
This synchronization with Translatewiki needs three types of operations:
Line 21: Line 21:
== Checkout the code and start Kiwix ==
== Checkout the code and start Kiwix ==


Before starting to work on the integration of new strings in the Kiwix code, it's preferable to [[compilation|achieve to compile Kiwix]]:
Before starting to work on the integration of new strings in the Kiwix code, it's preferable to [[{{ll|compilation}}|achieve to compile Kiwix]]:
* Get the unstable code
* Get the unstable code
* Compile it
* Compile it
* Run it by going to the kiwix subdirectory and launching ''kiwix''.
* Run it by going to the kiwix subdirectory and launching ''kiwix''.


''Remark: If you are not able to compile Kiwix, or do not have xulrunner available (is the case for example on Ubuntu Oneiric and further) you will still be able to be able to start kiwix and get an interface although the application won't work correctly, but that's enough for example to manipulate the XUL files. In this case you will have to make a few additional stuff like add "MaxVersion=42.*" as new line to kiwix/application.ini and launch Kiwix using this command in the "kiwix" directory "firefox -app application.ini"''.
''Remark: If you are not able to compile Kiwix, or do not have xulrunner available (is the case for example on Ubuntu Oneiric and further) you will still be able to start kiwix and get an interface although the application won't work correctly, but that's enough for example to manipulate the XUL files. In this case you will have to make a few additional steps like add "MaxVersion=42.*" as new line to kiwix/application.ini and launch Kiwix using this command in the "kiwix" directory "firefox -app application.ini"''.


== Add a string to the translations ==
== Add a string to the translations ==
Line 34: Line 34:
Go through the *.xul and *.js files to find hardcoded strings (in English).
Go through the *.xul and *.js files to find hardcoded strings (in English).


If you find one you need to find a string identifier (foobar for example), have a look to the already localised string to see how it should looks like. the most important to know is that in the *.xul files, it should looks like "&foobar;" and in the *.js like "getProperty('foobar')".
If you find one you need to find a string identifier (foobar for example), have a look to the already localized string to see how it should look like. The most important to know is that in the *.xul files, it should look like "&foobar;" and in the *.js like "getProperty('foobar')".


=== Translate it in the master language English ===
=== Translate it in the master language English ===
Line 42: Line 42:
=== Update Translatewiki files ===
=== Update Translatewiki files ===


But you also need to tell Translatewiki to add this string in the list of string it has to provide (for the Translatewiki translators) to translate. For that you need to checkout an other part of Kiwix code repository. Please run outside of your local kiwix code directory following console command:
But you also need to tell Translatewiki to add this string in the list of string it has to provide (for the Translatewiki translators) to translate. For that you need to checkout another part of Kiwix code repository. Please run outside of your local kiwix code directory following console command:


<source lang="bash">
<source lang="bash">
Line 54: Line 54:
=== Create stub translation of you new string for all languages ===
=== Create stub translation of you new string for all languages ===


The last thing you need to do is creating stub translation of your new localised string for all supported user interface languages in Kiwix. If you do not that, Kiwix won't be able to work correctly in another language as English.
The last thing you need to do is creating stub translation of your new localized string for all supported user interface languages in Kiwix. If you don't do that, Kiwix won't be able to work correctly in a language other than English.


For that purpose you need to use the script TW2PL.pl (this is a perl script, so perl needs to be installed) like following (go in the translatewiki file directory):
For that purpose you need to use the TW2PL.pl script (this is a perl script, so perl needs to be installed) like following (go in the translatewiki file directory):


<source lang="bash">
<source lang="bash">
Line 63: Line 63:


=== Commit the new Kiwix translation files ===
=== Commit the new Kiwix translation files ===
Now, all the locale file in kiwix/chrome/locale should be update and you should have a lot of (modified) files listed by typing:
Now, all the locale file in kiwix/chrome/locale should be updated and you should have a lot of (modified) files listed by typing:


<source lang="bash">
<source lang="bash">
Line 73: Line 73:
== Update Kiwix translations ==
== Update Kiwix translations ==


One other task is to update already supported Kiwix languages with the last string updated coming from Translatewiki. The first thing to know about that is that in the remote subversion repository, the Translatewiki file (in maintenance/translatewiki) are each two weeks updated from a Translatewiki contributors. That means, you only need to update your local repository and update and commit the kiwix code translation files like following:
Another task is to update already supported Kiwix languages with the last strings updated coming from Translatewiki. The first thing to know about that is that in the remote subversion repository, the Translatewiki file (in maintenance/translatewiki) is updated every two weeks from a Translatewiki contributors. That means, you only need to update your local repository and update and commit the kiwix code translation files like this:


<source lang="bash">
<source lang="bash">
Line 85: Line 85:
== Add a new supported language to Kiwix ==
== Add a new supported language to Kiwix ==


Kiwix tries to add only 100% translated languages coming from Translatewiki. So it happens often that they are more languages in the "maintenance_tools/translatewiki" directory than in the "kiwix/kiwix/chrome/locale" directory. In such a case, that simply mean the the Translatewiki language was still not integrated in Kiwix code base. We explain now how to do that.
Kiwix tries to add only 100% translated languages coming from Translatewiki. So it happens often that there are more languages in the "maintenance_tools/translatewiki" directory than in the "kiwix/kiwix/chrome/locale" directory. In such a case, that simply means the Translatewiki language was still not integrated in Kiwix code base. We explain now how to do that.


First of all you need to create the translation files in a new directory at "kiwix/kiwix/chrome/locale/your_language_iso_code" like this:
First of all you need to create the translation files in a new directory at "kiwix/kiwix/chrome/locale/your_language_iso_code" like this:
Line 108: Line 108:


== See also ==
== See also ==
* [[Translation]]
* [[{{ll|Translation}}|Translation]]
* [[Compilation]]
* [[{{ll|Compilation}}|Compilation]]


[[Category:Developer's Guide]]
[[Category:Developer's Guide]]
4,922

edits

Navigation menu