NLS Utility Methods

Methods:

 

__init__(self):

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

setNLSLanguage(self, language):

readInNLSFile(self, project, altpath):

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

replaceNLS(self, instring, searchstr, replacestr):

 

  __init__(self):

 

     Initialization

 

    back      

     

 

  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

 

 

 

    back      

     

 

 

 

 

  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

     

    back      

 

 

 

 

 

  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

   

    back      

 

 

 

 

  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

     

    back      

 

 

 

 

  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:

        str: outstring: the String with the replaced Item

     

    back      


Previous
Previous page
Chapter
Chapter page
Next
Next page