HTTP Server for Tux Droid
util.i18n.I18n.I18n Class Reference
Inheritance diagram for util.i18n.I18n.I18n:
Collaboration diagram for util.i18n.I18n.I18n:

Public Member Functions

def __init__ (self)
 
def getPoDirectory (self)
 
def setPoDirectory (self, poDirectory)
 
def getLocale (self)
 
def setLocale (self, locale)
 
def getDictionnary (self)
 
def tr (self, message, *arguments)
 
def update (self)
 

Private Member Functions

def __extractContent (self, line)
 

Private Attributes

 __locale
 
 __language
 
 __country
 
 __poDirectory
 
 __data
 

Detailed Description

Class to read and use i18n po files.

Constructor & Destructor Documentation

◆ __init__()

def util.i18n.I18n.I18n.__init__ (   self)
Constructor of the class.

Member Function Documentation

◆ __extractContent()

def util.i18n.I18n.I18n.__extractContent (   self,
  line 
)
private
Extract the content of a po line.
@param line: Line to parse.
@return: The extracted content.

◆ getDictionnary()

def util.i18n.I18n.I18n.getDictionnary (   self)
Get the translation dictionnary.
@return: A dictionnary.

◆ getLocale()

def util.i18n.I18n.I18n.getLocale (   self)
Get the used locale value.
@return: The locale as "<language>_<country>" string.

◆ getPoDirectory()

def util.i18n.I18n.I18n.getPoDirectory (   self)
Get the target po directory.
@return: A directory path as string.

◆ setLocale()

def util.i18n.I18n.I18n.setLocale (   self,
  locale 
)
Set the used locale value.
@param locale: Locale to use. "<language>_<country>".

◆ setPoDirectory()

def util.i18n.I18n.I18n.setPoDirectory (   self,
  poDirectory 
)
Set the target po directory.
@param poDirectory: Path of the po directory.

◆ tr()

def util.i18n.I18n.I18n.tr (   self,
  message,
arguments 
)
Translate a message.
@param message: Message to translate.
@param arguments: Arguments to pass in the formated message.
example:
>>>print i18n.tr("This is the {0} test of the module {1}.", 4, "i18n")

◆ update()

def util.i18n.I18n.I18n.update (   self)
Update the internal data dictionary with the current po dictionary
and locale.

Member Data Documentation

◆ __country

util.i18n.I18n.I18n.__country
private

◆ __data

util.i18n.I18n.I18n.__data
private

◆ __language

util.i18n.I18n.I18n.__language
private

◆ __locale

util.i18n.I18n.I18n.__locale
private

◆ __poDirectory

util.i18n.I18n.I18n.__poDirectory
private

The documentation for this class was generated from the following file: