Skip to Content

NLS Utility

Class “NLSUtility” for Language Translations

Quick Facts

PropertyValue
ClassNLSUtility
Modulecenpylib.NLSUtility
Packagecenpylib
ReleaseR2025.2.4
Methods7

Quick Start

# Boilerplate Example obj = NLSUtility()

Method Index

MethodReturnsSummary
__init__Initialization
getETwoNLSgetting the set Language in E2
defineNLSSets the desired Language, Project Name(optional) and PlugIn Path(optional)
setNLSLanguageChecks and sets the desired Language
readInNLSFileReads the Language File and save it to a List.
getNLSReturns the desired Item if translated, otherwise Default taken.
replaceNLSSearches in a String for a chain of Characters and replace it, if found, with a desired String and returns this.

Lifecycle

__init__

def __init__()

Initialization

Query Methods

getETwoNLS

def getETwoNLS(Operator)

getting the set Language in E2

Parameters:

NameTypeDescription
Operatorthe CENPyOlpProgramModifyOperator

readInNLSFile

def readInNLSFile(project, altpath)

Reads the Language File and save it to a List.

Parameters:

NameTypeDescription
projectsets the requested NLS Project “common”, “report”, etc.
altpaththe alternative Location of the LanguageFiles (customized NLS)

getNLS

def getNLS(name, default='')

Returns the desired Item if translated, otherwise Default taken.

Parameters:

NameTypeDescription
namethe NLS-Item
defaultthe default Translation if NLS-Item not found (default: '')

Mutation Methods

setNLSLanguage

def setNLSLanguage(language)

Checks and sets the desired Language

Parameters:

NameTypeDescription
languagethe desired NLS Language

replaceNLS

def replaceNLS(instring, searchstr, replacestr)

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

Parameters:

NameTypeDescription
instringthe Base String with the to be replaced Item
searchstrthe String to be searched and replaced
replacestrthe String for replacing

Utilities

defineNLS

def defineNLS(language='', project='', altpath='')

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

Parameters:

NameTypeDescription
languagethe desired NLS Language, if empty determine the Systems Language (default: '')
projectsets the requested NLS Project “common”, “report”, etc.(optional, default “common” if not set) (default: '')
altpathalternative Path for own customized PlugIn NLS Files (optional) (default: '')

Version Notes

This class is documented as of release R2025.2.4.

Was this page helpful?