4,304
edits
(Updating to match new version of source page) |
|||
Line 2: | Line 2: | ||
Parallelamente alla pura [[translation/it|traduzione]], il '''codice sorgente di Kiwix necessita di essere sincronizzato con Translatewiki'''. | Parallelamente alla pura [[translation/it|traduzione]], il '''codice sorgente di Kiwix necessita di essere sincronizzato con Translatewiki'''. | ||
La sincronizzazione con Translatewiki consta di tre tipi di operazioni: | |||
* '' | *''Aggiungere una stringa'' a Kiwix e Translatewiki, per esempio introducenso una stringa dinamica che verrà rimpiazzata dalla traduzione corrispondente in fase di esecuzione. | ||
* '' | *''Aggiornare le stringhe di Kiwix'' con le traduzioni prese da Translatewiki. | ||
* '' | *''Aggiungere il supporto a Kiwix per una nuova lingua su Translatewiki''. | ||
== | == Requirements == | ||
You need a GNU/Linux Operating System. It is possible to do it in another operating system, but it is more complicated to get a working environment. | |||
You need to have a few things in mind: | You need to have a few things in mind: | ||
Line 26: | Line 26: | ||
*Avvialo andando nella sottocartella kiwix e eseguendo "kiwix". | *Avvialo andando nella sottocartella kiwix e eseguendo "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 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"''. | ||
== Aggiungi una stringa alle traduzioni == | == Aggiungi una stringa alle traduzioni == | ||
Line 34: | Line 34: | ||
Naviga tra i file *.xul e *.js per trovare stringhe con codice (in inglese). | Naviga tra i file *.xul e *.js per trovare stringhe con codice (in inglese). | ||
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 === | ||
You will need to do that on two places. First in the "kiwix/chrome/locale/en/main/" main.dtd or main.properties files. In that way the Kiwix application knows what to display if the user interface language is English. | |||
=== Aggiorna i file Translatewiki === | === Aggiorna i file Translatewiki === | ||
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: | ||
=== Crea una bozza di traduzione della tua nuova stringa per tutte le lingue === | === Crea una bozza di traduzione della tua nuova stringa per tutte le lingue === | ||
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 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 62: | Line 62: | ||
</source> | </source> | ||
=== | === Commit the new Kiwix translation files === | ||
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 72: | Line 73: | ||
== Aggiorna le traduzioni di Kiwix == | == Aggiorna le traduzioni di Kiwix == | ||
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 84: | Line 85: | ||
== Aggiungi a Kiwix il supporto ad una nuova lingua == | == Aggiungi a Kiwix il supporto ad una nuova lingua == | ||
Kiwix | 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: | |||
<source lang="bash"> | <source lang="bash"> |