Package library :: Package pyjamas :: Module locale
[hide private]
[frames] | no frames]

Source Code for Module library.pyjamas.locale

 1  # encoding: utf-8 
 2  """ 
 3      (C) 2012 by Maho (?ukasz Mach) 
 4   
 5      License: GPL 
 6   
 7   
 8      Poor man's i18n support for Pyjamas. 
 9   
10      _("identifier") returns you translated version of "identifier". If you want 
11      original (English) version, just do nothing. If you want other language 
12      (eg. PL), please import translation_pl in your project, when it's content 
13      is: 
14   
15      from pyjamas.locale import msgs 
16   
17      msgs["Week"] = "Tydzień" 
18      msgs["Jan"] = "Sty" 
19      msgs["January"] = "Styczeń" 
20      msgs["Other eng identifier you'd like to translate"] = "Inny ang. identyfikator który chciałbyś przetłumaczyć" 
21   
22  """ 
23   
24  msgs = {} 
25   
26 -def _(identifier):
27 return msgs.get(identifier,identifier)
28