Initializing the NLS Translation

Previous  Chapter  Next

To get the NLS Translation available in your Python script, you have to define different settings by calling the defineNLS() Method.

It provides several parameters for getting the desired translation.

 

defineNLS( language, project, alternativePath )

 

Parameter language :        can be set with the usual E2 languages english "EN",  german "DE",  french "FR",  chinese "CN",  japanese "JP"

                         If left empty "" the class tries to get the OSystem lanuage and link to this language. Default is english "EN"

 

Parameter project :                a desired name for the translation files can be set. If left empty "", by default "common" will be use.

                         Means, that the class is searching for translation files with the desired name (or "common")

                         The file naming convention is [name].[language].lng, e.g. report.fr.lng

 

Parameter alternativePath :        by default the class searches for language files in the E2 installation cenpylib folder, subfolder languages.

                         If customized files needed, no matter if already existing in the cenpylib folder or complete new ones, a path to a desired PlugIn can be defined.

 

 defineNLS() :                                                                no Args : get language from OS, Project "common", NLS in cenpylib\languages

 defineNLS(language) :                                                only language Arg : desired language, Project "common", NLS in cenpylib\languages

 defineNLS(altpath="__yourpath__") :                                        only path Arg : get language from OS, Project "common", NLS in altpath & cenpylib\languages

 defineNLS(language, altpath="__yourpath__") :                        language & path Arg : desired language, Project "common", NLS in altpath & cenpylib\languages

 defineNLS(language, project) :                                        language & project Arg : desired language or empty ""=OS, Project with desired Name, NLS in cenpylib\languages

 defineNLS(language, project, altpath) :                                language & project Arg : desired language or empty ""=OS, Project with desired Name, NLS in altpath & cenpylib\languages

 defineNLS(project="__yourproject__", altpath="__yourpath__") :        language=OS, Project with desired Name, NLS in altpath & cenpylib\languages

 

Note : be aware that in some cases the parameter description (altpath="...") might be needed

 

Default location of translation files :

NLS_LanguageLibLocation

 

Customized location, files beside the Python script

Language getting from the operating system, project name "mytrans", search in path of the caller script

NLS_CustomizedCall

 

NLS_LanguageCustLocation

 

 

When using an alternative path with language files that are already existing in the cenpylib folder, the class searches first in the alternative folder for the item, then in the cenpylib folder.

NLS_Filesdiff


Previous
Previous page
Chapter
Chapter page
Next
Next page