Difference between revisions of "Translation for developers/es"

From Kiwix
Jump to navigation Jump to search
(Created page with "Tendrás que hacer eso en dos lugares. En primer lugar en los archivos "kiwix/chrome/locale/en/main/" main.dtd o main.properties. De esa manera la aplicación Kiwix reconoce q...")
(Created page with "=== Archivos de actualización Translatewiki ===")
Line 40: Line 40:
Tendrás que hacer eso en dos lugares. En primer lugar en los archivos "kiwix/chrome/locale/en/main/" main.dtd o main.properties. De esa manera la aplicación Kiwix reconoce que mostrar si el idioma de la interfaz de usuario es el Inglés.
Tendrás que hacer eso en dos lugares. En primer lugar en los archivos "kiwix/chrome/locale/en/main/" main.dtd o main.properties. De esa manera la aplicación Kiwix reconoce que mostrar si el idioma de la interfaz de usuario es el Inglés.


=== Update Translatewiki files ===
=== Archivos de actualización 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:
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:

Revision as of 11:31, 4 February 2015

Other languages:
Bahasa Melayu • ‎English • ‎català • ‎español • ‎français • ‎galego • ‎italiano • ‎magyar • ‎português • ‎русский • ‎日本語

Además del propio trabajo de traducción, el código fuente de Kiwix necesita sincronizarse con Translatewiki.

Esta sincronización con Translatewiki necesita tres tipos de operaciones:

  • Agregar una cadena a Kiwix y Translatewiki, es decir. la introducción de una cadena dinámica que será sustituido por la correspondiente traducción en tiempo de ejecución.
  • Actualización de las cadenas de kiwix con las traducciones procedentes de Translatewiki.
  • Añadir un nuevo, y completamente traducido, lenguaje Translatewiki a Kiwix .

Requerimientos

Necesitarás un Sistema Operativo GNU/Linux Sistema. Es posible hacerlo con otro sistema operativo, pero es más complicado obtener un entorno de trabajo.

Deberas tener algunas cosas en mente:

  • Los archivos de traducción de kiwix están todos en el directorio "kiwix/chrome/locale".
  • Hay dos tipos de archivos de traducción para traducir la interfaz de usuario (Echa un vistazo a los * .js y archivos * .xul en kiwix/chrome/content/main para entender cómo funciona):
    • "Main.dtd", ofrece traducciones de todos los archivos * .xul
    • "Main.properties", que proporciona traducciones para todos * .js.
  • Las traducciones Translatewiki se importan por separado en el repositorio de código Kiwix una vez por semana y siempre se deben sincronizar los archivos con el código Kiwix en ambas direcciones (KW-> TW y TW -> KW).

ADVERTENCIA: Antes de que cualquier modificación del código fuente Kiwix, actualiza los repositorios de código locales con "git pull origin master" en cada uno de ellos.

Obtenga el código y empieza con Kiwix

Antes de comenzar a trabajar en la integración de nuevas cadenas en el código Kiwix, es preferible lograr compilar Kiwix:

  • Copiar el código inestable
  • Compilarlo
  • Ejecutar yendo al subdirectorio kiwix y el lanzador de kiwix .

Nota: Si no eres capaz de compilar Kiwix, o no tienes xulrunner disponible (si es el caso, por ejemplo, en Ubuntu oniric y superior) todavía podrás iniciar kiwix y obtener una interfaz aunque la aplicación no funcionará correctamente, sin embargo, con esto es suficiente, por ejemplo, para manipular los archivos XUL. En este caso, tendrás que hacer algunos pasos adicionales como agregar una línea nueva con "maxVersion = 42.*" en kiwix/application.ini y lanzar Kiwix usando este comando en el directorio "kiwix" "firefox -app application.ini" .

Añadir una cadena para las traducciones

Encuentra una cadena para localizar

Ve a los * .xul y * .js para encontrar cadenas harcodeadas (en Inglés).

Si encuentras una que tu necesitas para encontrar un identificador de cadena (foobar por ejemplo), echa un vistazo a la cadena ya localizada para ver cómo debería ser. Lo más importante que hay que saber es que en los archivos *.xul, deberían verse como "&foobar"; y en los *.js como "getProperty('foobar')".

Traducir en el idioma Inglés master

Tendrás que hacer eso en dos lugares. En primer lugar en los archivos "kiwix/chrome/locale/en/main/" main.dtd o main.properties. De esa manera la aplicación Kiwix reconoce que mostrar si el idioma de la interfaz de usuario es el Inglés.

Archivos de actualización 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:

git pull origin master

You have now on your computer the translatewiki translations. What you need is only to update the "en" file which is the master language file for Translatewiki. So simply add your new string following the examples of other already inserted strings and commit your "en" file.

Someone from Translatewiki check each week the "en" file for new strings and synchronized Translatewiki with this file if necessary.

Create stub translation of you new string for all languages

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):

./TW2KW.pl --path=/full/path/to/the/kiwix/code/directory --allLanguages=kw

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:

git status kiwix/chrome/locale

After checking everything is OK, you can commit your modifications: ie. the kiwix/chrome/locale directory and the *.xul and/or *.js files you have modified.

Update Kiwix translations

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:

cd /full/path/to/the/kiwix/maintenance_tools/translatewiki
./TW2KW.pl --path=/full/path/to/the/kiwix/code/directory --allLanguages=kw
git commit /full/path/to/the/kiwix/code/directory/kiwix/chrome/locale
git push origin master

The full path should be the moulinkiwix directory, not the kiwix directory in it.

Add a new supported language to 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:

./TW2KW.pl --path=/full/path/to/your/kiwix/code/base/directory/ --language=your_language_iso_code

After that, you need go to the Kiwix source code directory in "kiwix/chrome" and edit with your preferred text editor the "chrome.manifest" and "chrome.manifest.prod" files. No explanation here, just do like for the already supported languages.

Next edit chrome/content/main/js/languages.js and here also add the new languages.

Now update CHANGELOG and make a notice about the addition of the new supported languages.

Add the new language directory and commit like this:

git add kiwix/chrome/locale/language_iso_code
git commit CHANGELOG kiwix/chrome/chrome.manifest kiwix/chrome/chrome.manifest.prod kiwix/chrome/locale/ kiwix/chrome/content/main/js/gui.js
git push origin master

Véase también