Module Lang

Set and get language codes, initialize translated messages, so that the user scan use them directly in processes.

In the process:

User has to define set of messages for all supported languages, like:

self.lang["eng"]["key1"] = "Hallo, world!"
self.lang["eng"]["key2"] = "Foo"
self.lang["eng"]["key3"] = "Bar"

Than the user can use self.i18n(key) method, which returns the string in preset language (given by client request)

Class Lang

class pywps.Process.Lang.Lang

Lang class

get(key)

Will return desired string in selected language

initStrings()

Initialize self.strings object according to known codes from Lang.py

It can be used later like:

self.strings["eng"]["foo"] = "bar"
setCode(code)

Set chosen language code

Table Of Contents

Previous topic

Module Process

Next topic

Module InAndOutputs

This Page