Class 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>
    • Constructor Detail

      • TranslationManager

        public TranslationManager()
    • 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 files
        strLang - 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 files
        strLang - Language to export.
        strClient - Client to export.
        uiLanguage - Language to be used for translating error messages
        isReducedVersion - 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 files
        strLang - Language to import
        strClient - Client to import
        uiLanguage - Language to be used for translating error messages
        Returns:
        Message with the error or with the success