Package org.openbravo.erpCommon.ad_forms
Class TranslationManager
- java.lang.Object
-
- org.openbravo.erpCommon.ad_forms.TranslationManager
-
public class TranslationManager extends Object
Class for import/export languages. The tree of languages is: {attachmentsDir} {laguageFolder} {moduleFolder} Example: /opt/attachments/ en_US/ <trl tables from core> module1/ <trl tables from module1>
-
-
Field Summary
Fields Modifier and Type Field Description static String
CONTRIBUTORS_FILENAME
-
Constructor Summary
Constructors Constructor Description TranslationManager()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static OBError
exportTrl(ConnectionProvider conn, String exportDirectory, String strLang, String strClient, String uiLanguage)
Export all the trl tables that refers to tables with ad_module_id column or trl tables that refers to tables with a parent table with ad_module_id column For example: If a record from ad_process is in module "core", the records from ad_process_trl and ad_process_para_trl are exported in "core" modulestatic OBError
exportTrl(ConnectionProvider conn, String exportDirectory, String strLang, String strClient, String uiLanguage, boolean isReducedVersion)
Export all the trl tables that refers to tables with ad_module_id column or trl tables that refers to tables with a parent table with ad_module_id column For example: If a record from ad_process is in module "core", the records from ad_process_trl and ad_process_para_trl are exported in "core" modulestatic OBError
importTrlDirectory(ConnectionProvider cp, String directory, String strLang, String strClient, String uiLanguage)
The import process insert in database all the translations found in the folder of the defined language RECURSIVELY.
-
-
-
Field Detail
-
CONTRIBUTORS_FILENAME
public static final String CONTRIBUTORS_FILENAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
exportTrl
public static OBError exportTrl(ConnectionProvider conn, String exportDirectory, String strLang, String strClient, String uiLanguage)
Export all the trl tables that refers to tables with ad_module_id column or trl tables that refers to tables with a parent table with ad_module_id column For example: If a record from ad_process is in module "core", the records from ad_process_trl and ad_process_para_trl are exported in "core" module- Parameters:
exportDirectory
- Directory for trl's xml filesstrLang
- Language to export.strClient
- Client to export.uiLanguage
- Language to be used for translating error messages- Returns:
- Message with the error or with the success
-
exportTrl
public static OBError exportTrl(ConnectionProvider conn, String exportDirectory, String strLang, String strClient, String uiLanguage, boolean isReducedVersion)
Export all the trl tables that refers to tables with ad_module_id column or trl tables that refers to tables with a parent table with ad_module_id column For example: If a record from ad_process is in module "core", the records from ad_process_trl and ad_process_para_trl are exported in "core" module- Parameters:
exportDirectory
- Directory for trl's xml filesstrLang
- Language to export.strClient
- Client to export.uiLanguage
- Language to be used for translating error messagesisReducedVersion
- If true then the export will only take into account elements that are related with a Menu entry that is checked to be translated. If false, everything will be exported to the translation- Returns:
- Message with the error or with the success
-
importTrlDirectory
public static OBError importTrlDirectory(ConnectionProvider cp, String directory, String strLang, String strClient, String uiLanguage)
The import process insert in database all the translations found in the folder of the defined language RECURSIVELY. It don't take into account if a module is marked o no as isInDevelopment. Only search for trl's xml files corresponding with trl's tables in database.- Parameters:
directory
- Directory for trl's xml filesstrLang
- Language to importstrClient
- Client to importuiLanguage
- Language to be used for translating error messages- Returns:
- Message with the error or with the success
-
-