Langlib
From EventScripts Community Encyclopedia
|
[edit] Module: langlib[edit] Module OverviewEventScripts version: 2.0 [edit] Table of Contents
[edit] Description... [edit] Quick Exampleimport es import langlib import datetime text = None def load(): global text # load our strings text = langlib.Strings(es.getAddonPath("myaddon") + "/strings.ini") def round_start(): es.msg(text("hello world")) # using token strings tokens = {} tokens['date'] = str(datetime.date.today()) es.msg(text("today is", tokens)) would read the default server language string from the following: myaddon/strings.ini [hello world] en="Hello world!" es="Hola Mundo!" [today is] en="Today is $date" es="Hoy es $date" [edit] Module Content[edit] Classeslanglib.Strings(ConfigObj) [edit] Methodslanglib.getLangAbbreviation(fullname) langlib.loadLanguages(filename) [edit] See Also
|
|
