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
getETwoNLS—getting the set Language in E2
defineNLS—Sets the desired Language, Project Name(optional) and PlugIn Path(optional)
setNLSLanguage—Checks and sets the desired Language
readInNLSFile—Reads the Language File and save it to a List.
getNLS—Returns the desired Item if translated, otherwise Default taken.
replaceNLS—Searches 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
Operator—the CENPyOlpProgramModifyOperator

readInNLSFile

def readInNLSFile(project, altpath)

Reads the Language File and save it to a List.

Parameters:

NameTypeDescription
project—sets the requested NLS Project “common”, “report”, etc.
altpath—the alternative Location of the LanguageFiles (customized NLS)

getNLS

def getNLS(name, default='')

Returns the desired Item if translated, otherwise Default taken.

Parameters:

NameTypeDescription
name—the NLS-Item
default—the default Translation if NLS-Item not found (default: '')

Mutation Methods

setNLSLanguage

def setNLSLanguage(language)

Checks and sets the desired Language

Parameters:

NameTypeDescription
language—the 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
instring—the Base String with the to be replaced Item
searchstr—the String to be searched and replaced
replacestr—the String for replacing

Utilities

defineNLS

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

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

Parameters:

NameTypeDescription
language—the desired NLS Language, if empty determine the Systems Language (default: '')
project—sets the requested NLS Project “common”, “report”, etc.(optional, default “common” if not set) (default: '')
altpath—alternative Path for own customized PlugIn NLS Files (optional) (default: '')

Version Notes

This class is documented as of release R2026.1.1.

Was this page helpful?