= Internationalisation = The original language of the !SahanaPy user interface, source code labels and comments, and the Wiki pages is '''English (international)'''. No contributions can be accepted without being at least translated to english. If you need help to translate your contents to english, please contact the [http://wiki.sahana.lk/doku.php?id=translate:home "Sahana Localization team"]. However, translation to other languages is highly appreciated - please contact the Localization team for advice. == Web2py localization engine == * Tutorial: http://www.vimeo.com/7520812 * T() function performs dictionary lookups (similar to GNU/gettext _()), see [http://web2py.com/examples/global/vars/T here] for example * the dictionaries are located in the languages subfolder of the application * dictionaries can be translated using the web2py web interface (RAD mode) * suggest increasing the timeout from the default 10 minutes: {{{python web2py.py --timeout=120 ...}}} All Labels should be explicitly Internationalised: {{{ db.table.field.label = T('Field') }}} To make dropdown options localisable, use this pattern: {{{ module_field_type_opts = { 1:T('Option1'), 2:T('Option2'), 3:T('Option3') } opt_module_field_type = SQLTable(None, 'opt_module_field_type', db.Field('field_type', 'integer', notnull=True, requires = IS_IN_SET(module_field_type_opts), default = 1, represent = lambda opt: opt and module_field_type_opts[opt])) db.define_table(table, opt_module_field_type, ... ) }}} All reference to the options in View code should be by Index not by string (since the string can be changed). == Time == All references to time should use {{{request.utcnow}}} rather than {{{request.now}}} == Pootle/translate toolkit and web2py dictionaries == * [http://translate.sahana.lk "Sahana Pootle server"] as online facility for collaboration, translation refinement and workflow control * web2py translation dictionaries can be converted into PO files and vice versa, e.g. using: * [http://pub.nursix.org/translate/web2py2po.tar.gz "web2py2po"] scripts (part of the [http://translate.sourceforge.net/wiki/toolkit/py2web2po "Translate Toolkit"]) == Wiki pages translation == * translated pages with ISO 639-2 language code extension (original english page = no extension), e.g. * '''original page:''' trac.sahanapy.org/wiki/BluePrintInternationalisation * '''german translation:''' trac.sahanapy.org/wiki/BluePrintInternationalisation'''/de''' * insert ![[TranslatedPages]] macro to display a list of available translations of a page (at best at bottom of page) ---- BluePrintInternationalisation DeveloperGuidelines