View source | Discuss this page | Page history | Printable version   
Toolbox
Main Page
Upload file
What links here
Recent changes
Help

PDF Books
Add page
Show collection (0 pages)
Collections help

Search

Translating Openbravo/es

Contents

Introducción

Este documento explica el proceso de traducir y mantener traducciones de Openbravo ERP en diferentes idiomas.

El proceso consta de cinco pasos:

  1. Crear un nuevo idioma.
  2. Copiar las traducciones del idioma base.
  3. Exportar los archivos XML a traducir.
  4. Traducir los archivos.
  5. Finalmente, importar las nuevas traducciones en el sistema.


Creando un Idioma

Para traducir Openbravo ERP, el primer paso es crear un lenguaje o activar un idioma previamente definido. Es más, hay muchos lenguajes listados así que el usuario solo tiene que activar el que quiere traducir.

El usuario debe ingresar a Openbravo ERP usando el role de "Administrador de Sistema". Seguido a esto debe ir a "Configuración General > Aplicación > Lenguaje".

Translating1.png

Acá debe escoger el idioma deseado de la lista (si el usuario no está en la vista "Grid", él o ella deberá dar clic en el icono de grid) o crearlo. Si un nuevo lenguaje va a ser creado deberá seguir la conversión de país y lenguaje de Java: el lenguaje deberá crearse con dos letras minúsculas seguidas por un guion bajo (_) y el país con dos letras mayúsculas (por ejemplo: fr_CN seria para Francés Canadiense). Al marcar la opción "Lenguaje del Sistema" de esta pantalla y guardarlo, el usuario activara el lenguaje a traducir y hasta este punto, aparecerá en las preferencias del usuario.

El siguiente paso es copiar todo el texto desde el lenguaje base hacia el nuevo lenguaje. El lenguaje base es el lenguaje que se usa al punto de inicio de la traducción de la aplicación, y este está en Ingles (en_US). Al hacer clic en "Verificar Lenguajes" todas las cadenas de texto del lenguaje base serán copiadas al nuevo lenguaje.

Paquete de Idioma

Estructura

A language pack is a set of XML files containing the translations for a desired language. Each file contains the translation for a single table in the database and is given the same name as the table which contains its corresponding translation.

These language packs are stored in a server directory by language using the convention of language and country (e.g. en_US, es_ES...). They are inside a lang directory in the folder that is defined to contain all attachments. This is defined in your local build.xml file (for 2.3x versions) or Openbravo.properties file (for 2.4x versions), is requested during the installation process and, by default, is /attachments. An example of a complete path for Spanish_Spain could be /attachments/lang/es_ES.

The structure of the XML is as follows:

The following piece of code is an example for /attachments/lang/es_ES/AD_TASK_TRL_es_ES.xml file:


<?xml version="1.0" encoding="UTF-8"?>
<compiereTrl language="es_ES" table="AD_TASK">
  <row id="102" trl="Y">
    <value column="Name" original="Java Version">Versión de java</value>
    <value column="Description" original="Displays the version of the default Java VM">Muestra la versión de la java VM por defecto</value>
    <value column="Help" original="The java version used by the application might be different."/>
  </row>
  <row id="103" trl="N">
    <value column="Name" original="Database Export">Exportar BD</value>
    <value column="Description" original="Export (save) the database">Exportar (guardar) la base de datos</value>
    <value column="Help" original="Run this command from the server">Run this command from the server</value>
  </row>
</compiereTrl>

The complete list of XML files that compose a language pack called lg_CT, where lg stands for language and CT for country, is:

  1. AD_ALERTRULE_TRL_lg_CT.xml: Translations for AD_AlertRule.
  2. AD_ELEMENT_TRL_lg_CT.xml: Translations for the AD_Element table. This table contains all the elements of the application. They are used in order to have centrally maintained a description and help of the elements.
  3. AD_FIELDGROUP_TRL_lg_CT.xml: Translations for AD_FieldGroup. Field groups are used to group a fields in a window.
  4. AD_FIELD_TRL_lg_CT.xml: Translations for the AD_Field table. This table holds the information about the fields that are shown in each window of the application.
  5. AD_FORM_TRL_lg_CT.xml: Translations for the AD_Form table, where are defined the name, description and help for all the forms of the application. A form is a manually generated window.
  6. AD_MENU_TRL_lg_CT.xml: Translations for AD_Menu table. Here can be found the menu tree that appears on the left side of the application.
  7. AD_MESSAGE_TRL_lg_CT.xml: Translations for AD_Message table. This table defines all the messages that application displays.
  8. AD_PROCESS_PARA_TRL_lg_CT.xml: Translations for the AD_Process_Para table.
  9. AD_PROCESS_TRL_lg_CT.xml: Translations for AD_Process table. Here appears the name, description and help for the processes invoked from the application.
  10. AD_REFERENCE_TRL_lg_CT.xml: Translations for AD_Reference table. In this table are all the references. References are used to define data types, lists of values or tables.
  11. AD_REF_LIST_TRL_lg_CT.xml: Translations for AD_Ref_List. In this table are found the values for the references of list type.
  12. AD_TAB_TRL_lg_CT.xml: Translations for AD_Tab table. This table contains the name, description and help for all the tabs in the application.
  13. AD_TASK_TRL_lg_CT.xml: Translations for AD_Task. Definition of system tasks.
  14. AD_TEXTINTERFACES_TRL_lg_CT.xml: Translations for AD_TextInterfaces table. This table holds the texts that will be displayed in all the manually generated windows.
  15. AD_WF_NODE_TRL_lg_CT.xml: Translations for AD_WF_Node. This table contains the workflow nodes.
  16. AD_WINDOW_TRL_lg_CT.xml: Translations for AD_Window table. AD_Window has names, descriptions and helps of the WAD generated windows.
  17. AD_WORKFLOW_TRL_lg_CT.xml: Translations for AT_Command. Name, description and help for the defined workflows.
  18. AT_COMMAND_TRL_lg_CT.xml: Translations for AD_Workflow. This table is not used at this moment.
  19. C_COUNTRY_TRL_lg_CT.xml: Translations for C_Country. This table holds a list of countries.
  20. C_CURRENCY_TRL_lg_CT.xml: Translations for C_Currency. This table holds a list of currencies.
  21. C_DOCTYPE_TRL_lg_CT.xml: Translations for C_DocType. Description of the document types.
  22. C_ELEMENTVALUE_TRL_lg_CT.xml: Translations for C_PaymentValue table. This table contains the values for the elements used in accounting.
  23. C_GREETING_TRL_lg_CT.xml: Translations for C_Greeting.
  24. C_PAYMENTTERM_TRL_lg_CT.xml: Translations for C_PaymentTerm. Name and description for payment terms.
  25. C_TAXCATEGORY_TRL_lg_CT.xml: Translations for C_TaxCategory table. Name and description for the tax categories.
  26. C_TAX_TRL_lg_CT.xml: Translations for C_Tax table. Name and description for taxes.
  27. C_UOM_TRL_lg_CT.xml: Translations for C_OUM table. This table contains the Units of Measure.
  28. M_PRODUCT_TRL_lg_CT.xml: Translations for M_Product table. A table containing the different products.


Traducir usando archivos PO

PO (Portable Object) is a very popular format for storing and translating many open source applications. Openbravo ERP uses XML to import and export translations. However, with little effort, these XML files can be converted into PO files, that are more easy and friendly to work with.

PO files have a very simple structure. They look like:

#: AD_MENU_TRL_en_US.xml:1(value) 
msgid "original text"
msgstr "translated text"

There is detailed description of the format in the GNU gettext utilities manual.


Software requerido

To translate Openbravo using PO files, the following software is required:


Generando un archivo PO desde un archivo XML

Language files are exported from Openbravo ERP in XML format, in order to translate these files efficiently it is necessary to transform them into PO format files.

Detailed instructions on using this tool can be found at Openbravo2PO User Documentation

To transform xml files to po format use the following ant command

ant runXML2PO -DinpFold= -DoutFold= -DmsgStr= -Dfile=""

add values as required to the various target arguments. If the -DinpFold is given and the -Dfile is empty the tool will generate PO files for all XML files in the input folder, otherwise only those files included in the -Dfile argument will be transformed. The -Dfile argument can take multiple files separated by a space character but must be enclosed in "".

e.g. to transform all xml files in a folder to po files

ant runXML2PO -DinpFold=/home/openbravo/translations/xml_base/ -DoutFold=/home/openbravo/translations/po_out/ -DmsgStr=false

e.g. to transform a single xml file

ant runXML2PO -DinpFold=/home/openbravo/translations/xml_base/ -DoutFold=/home/openbravo/translations/po_out/ -DmsgStr=false -Dfile="AD_TASK_TRL_es_ES.xml"


Traduciendo archivos PO

To translate a PO into your language you can use one of the many open source tools and editors available. Some of the most popular are:


Generando un archivo XML desde un archivo PO

Once the translation is complete you have to put the translations back into XML format.

Detailed instructions on using this tool can be found at Openbravo2PO User Documentation

To generate the XML files from the PO files use the following ant target

ant runPO2XML -DinpFold= -DoutFold=  -Dfile=""

Again specifying the inpFold and not the file names will parse all PO files into the relevant xml files ready to be imported back into Openbravo ERP. The -Dfile argument can take multiple files separated by a space character but must be enclosed in "".

e.g. to process a complete folder

ant runPO2XML -DinpFold=/home/openbravo/translations/po_out/ -DoutFold=/home/openbravo/translations/xml_trl 

e.g. to process specific file(s)

ant runPO2XML -DinpFold=/home/openbravo/translations/po_out/ -DoutFold=/home/openbravo/translations/xml_trl -Dfile="AD_TASK_Name_es_ES.po AD_TASK_Help_es_ES.po AD_TASK_Description_es_ES.po"


Exportar/Importar

To export or import a language the user must log into the application as System Administrator and go to General Setup > Application > Import/Export Translations ( the language must be activated in the system first).

Here the user can choose one of the languages defined as System Language.

The desired language XML files are located in the following directory: attachments/lang/en_US

Translating3.png

See the Installing a new translation section if you are importing translations.


Manteniendo una Traducción

If the user does not want to make a complete translation nor significant changes, he or she can modify a translation in a different way, without exporting/modifying/importing XML files. Every table that has a translation (the ones that are exported into XML files), also has in its window a tab called Translation. Here, translations can be edited for each row of the table. For example, if the user simply wants to change the Spanish translation for AccountType element, this change is made by going to the Application Dictionary > Setup > Element > Translation tab. Once there, changes can be made.

Translating4.png


Instalando una nueva traducción

To install a new translation in Openbravo follow these steps:

Translation1.png
Translation.png
Translation2.png
Translation3.png
Translation4.png
Translation5.png

Once the translation is imported or changes have been made, the modifications do not take effect until Openbravo ERP is recompiled and a new openbravo.war is deployed.

service tomcat stop
ant compile.complete

Important note: if you find this error

compileSqlc:
BUILD FAILED
...AppsOpenbravo/build.xml:85: The following error occurred
while executing this line: ...AppsOpenbravo/src/build.xml:176:
srcdir "...AppsOpenbravo/build/javasqlc/srcAD/org/openbravo/er
pCommon/reference" does not exist!

try to run "ant core.lib wad.lib trl.lib" and if success, run "ant compile.complete" again

This process compiles and translates every window in the application.

ant war
ant deploy
service tomcat start

Important note: at this point, you should have inside Apache Tomcat webapps folder (C:\Apache Software Foundation\Tomcat5.5\webapps\ or C:\Tomcat5.5\webapps\ in Microsoft Windows and /var/lib/tomcat5.5/webapps/ in Linux):

  • A your_context_name folder (e.g., openbravo).
    • A src-loc/design sub-folder with the english_USA version of Openbravo ERP.
    • A src-loc/lg_CT sub-folder with your language_COUNTRY version of Openbravo ERP (e.g., src-loc/de_DE for Germany, src-loc/es_ES for Spanish of Spain, etc...).

If this is not the case:

service tomcat stop
ant compile.complete
ant war
ant deploy
service tomcat start
Translation6.png

Retrieved from "http://wiki.openbravo.com/wiki/Translating_Openbravo/es"

This page has been accessed 21,418 times. This page was last modified on 14 March 2010, at 06:34. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.