Python scripting for NLS translations

NLS Utility methods

 

Methods

 

__init__(self):

 

Initialization.

 


 

defineNLS(self, language = "", project = "", altpath = ""):

 

Sets the desired Language, Project Name(optional) and PlugIn Path(optional)

     

     Args:

        language :        the desired NLS Language, if empty determine the Systems Language (optional)

                                 english "EN",  german "DE",  french "FR",  chinese "CN",  japanese "JP"

                                 (optional, try to get OS Language if not set, default "EN")

        project  :        sets the requested NLS Project "common", "report", etc.(optional, default "common" if not set)

        altpath  :                alternative Path for own customized PlugIn NLS Files (optional)

     

     Note : following Conditions to call the defineNLS, be aware that in some cases the parameter description (altpath="") might be needed.

           

 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

 


 

getETwoNLS(self, Operator):

 

     Getting the Language set in E2  (de-"DE", en-"US", fr-"FR", ja-"JP", zh-"CN")

     

     Args:

        Operator:        the CENPyOlpProgramModifyOperator (or any Operator that supports GetController() Method

     

     Returns :

        str : language:        the Language String in upper Case "EN", "DE", "FR", "CN" or "JP"


 

setNLSLanguage(self, language):

 

Checks and sets the desired Language (class internal use)

     

     Args:

        language :        the desired NLS Language, if incoming string is empty, OS language will be determined. Default english ("EN")

                                 english "EN",  german "DE",  french "FR",  chinese "CN",  japanese "JP"

     

     Returns :

        str : language:        the Language String in upper Case


 

readInNLSFile(self, project, altpath):

 

Reads the Language File and save it to a List. (class internal use)

     

     Args:

        project:                sets the requested NLS Project "common", "report", etc.

        altpath:                the alternative Location of the LanguageFiles (customized NLS)

     

     Returns:

        strList: nlsList:        the list of the translated items

 


 

getNLS(self, name, default = ""):

 

Returns the desired Item if translated, otherwise Default taken.

     

     Args:

        name:                the NLS-Item

        default:                the default translation if NLS-Item not found (optional)

     

     Returns:

        str: nlsStr:        the found NLS or the default string

 


 

replaceNLS(self, instring, searchstr, replacestr):

 

Searches in a String for a chain of Characters and replace it, if found, with a desired String and returns this.

     

     Args:

        instring : the Base String with the to be replaced Item

        searchstr : the String to be searched and replaced

        replacestr : the String for replacing

     

     Returns:

 


 

 


Previous
Page précédente
Chapter
Page principale du chapitre
Next
Page suivante