Localization

From iDempiere en
Jump to navigation Jump to search

Localization

Please read the references given in the reference section below.

Translation Import/Export

  • Use to quickly edit translations
  • Found in menu option Translation Import/Export
  • Don't select table - all translation tables are exported
  • Export / Import as a ZIP file
  • Only centrally maintained fields are exported for ad_field
  • Do synchronize terminology after import, to set the names of centrally maintained fields
  • java.util.zip.ZipException: error in opening zip file: when used linux ark to compress file, using command line worked fine.

Enabling translations on client documents

  • Tick Multi Lingual Translations on the Client window (set the language as well.) Run synchronize doc translations, restart app server. Translation tab shows on document window in client.
  • Add missing translations should also be run (see below)

Adding support for translation to a table

  • Remember to enable multi lingual translations for your client (see above)
  • Create table ending with _Trl
  • NB _Trl must begin with capital T
  • Look at ad_element_Trl for an example of columns you need in your table
  • The key of the table must be ticked 'parent link'
  • Make sure that the SQL definition of the table has a primary key defined (Parent_ID And Language as columns)
    • Otherwise, "No primary key found for table ..." error will be thrown.
  • Add a translation tab to your window, tab & field, with 'translation tab' ticked
  • Set the tab level to 1, or the applicable tab level
  • Set the parent link column
  • The column(s) to be translated (on the main table, not the _Trl table) must be ticked on the table & column as 'translated' (see under technical)
  • Login to System and open the Language window, find your language, and click on language maintenance. Select 'Add missing translations'
  • Remember: new translation records are not added using the translation window, but rather using 'Add missing translations', and also automatically, when a new main record is created.
    • Client level translations are added at the same time

How the default country on the location dialog is determined

  • Lookup the client's language under the client window.
  • Find the language under System, in the Language window.
  • Note the ISO Country code
  • Find the country by ISO Country Code, under System, in Country, Region & City window

Use translations to quickly change labels

Changing field labels on windows, menus, and tabs using the web interface can be time-consuming if you have a large number of changes to make. You can speed this up by exporting the language pack and editing the files manually using a text editor. You will also have a record of the changes that you can back up and re-apply to different instances of iDempiere.

Export the Language Pack

First, export the language pack:

  • Login as SuperUser with the System role;
  • Select the Menu option Translation Import/Export;
  • Export the zip file and save it locally: leave all fields as defaults to export all tables for all clients in the default language;
  • Browse to where you stored the zipped file and unzip it.

You will see a number of files, each corresponding to a database table. Generally, the ones you want start with AD_ because these correspond to the tables that hold the Application Dictionary:

  • AD_Element_Trl_en_US.xml: all system level Elements
  • AD_FieldGroup_Trl_en_US.xml: groups of Fields within a Window
  • AD_Field_Trl_en_US.xml: Fields used in Tabs
  • AD_Form_Trl_en_US.xml: Windows that are not automatically generated
  • AD_Menu_Trl_en_US.xml: Menu entries
  • AD_Message_Trl_en_US.xml: error Messages and alerts
  • AD_Process_Para_Trl_en_US.xml: used in Processes
  • AD_Process_Trl_en_US.xml: Processes that make changes to the system
  • AD_Reference_Trl_en_US.xml: References
  • AD_Ref_List_Trl_en_US.xml: list of References
  • AD_Tab_Trl_en_US.xml: Tabs used in Windows
  • AD_WF_Node_Trl_en_US.xml: Workflow Nodes
  • AD_Window_Trl_en_US.xml: Windows used in the application
  • AD_Workflow_Trl_en_US.xml: all the Workflows in the application

There may be other entries that you want to translate, in which case you should search through the contents of all the files for occurrences of the text.

Hint: you can limit your search to whole words by grepping as follows (where '\b' marks whitespace):

  grep '\btext-of-interest\b' *

Edit the contents

Each entry in the translation tables consists of two parts: the original installed text as an XML attribute, and the translation in the content, for example:

  <row id="287" trl="Y">
     <value column="Name" original="Print Format Detail">Print Format Detail</value>
     <value column="Description" original="Print Format Detail Report">Print Format Detail Report</value>
     <value column="Help" original="Print Format with Item details">Print Format with Item details</value>
  </row>

Be careful not to edit the original content, especially if you use Search-and-Replace.

Load the translation

Once you have made your changes:

  • Select all the files and zip them up (don't use Linux Ark to do the zip, just use the standard zip utility);
  • Select the Menu option Translation Import/Export again;
  • Import the zipped file and wait for it to load;
  • Reboot the application server to empty the cache and load the new text.

Jasper report translations

Use resource bundles to translate reports.

References