= User Guidelines Localisation = [[TOC]] == Contributing to a Translation of Sahana Eden == Translation to other languages is highly appreciated.[http://pootle.sahanafoundation.org Sahana Pootle Server] is available as on online tool used for Translations. Please see the [UserGuidelinesLocalisationPootle Pootle User Guidelines] for instructions or contact the MailingList for advice. == Translate Sahana Eden into a New Language == === 1. Create Language File === http://127.0.0.1:8000/admin/default/design/eden#languages Create a new file using the [http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes ISO 639-1 Code] of the Language as the filename. If it is a national variation of a language, eg. New Zealand English, add a suffix to the filename: "en_nz.py". === 2. Translate === Sahana Eden can be translated in the following ways: ==== A. Using Pootle ==== ''Preferred method'' [http://pootle.sahanafoundation.org Sahana Pootle Server] is available as on online tool for collaboration, translation refinement and workflow control. * [UserGuidelinesLocalisationPootle Pootle User Guidelines] Convert to a .po file for use in Pootle (or other PO file tools such as [http://translate.sourceforge.net/wiki/virtaal/index Virtaal]): * "web2py2po" scripts (part of the [http://translate.sourceforge.net/wiki/toolkit/py2web2po "Translate Toolkit"]) * Use 1.8.1+ (or this [http://eden.sahanafoundation.org/attachment/wiki/UserGuidelinesLocalisation/web2py2po.diff patch] for 1.8.0) For UTF-8, beware of the encoding - needs to be 'without BOM' or 'ANSI as UTF-8'.[[BR]] - this is both within the {{{languages/}}} file & also with any UTF-8 direct in customised Views.[[BR]] {{{ web2py2po -i zh-tw.py -o zh-tw.po # Use Pootle &/or Virtaal to translate, then: po2web2py -i zh-tw.po -o zh-tw.py }}} NB The .py output looks wrong, with raw UTF-8 binary characters, however it works fine if you let Web2Py process it: * copy into 'languages' folder * run Eden with this language: http://127.0.0.1:8000/eden/default/index?_language=xx ===== Administering Pootle ===== When adding languages, use this resource to configure them properly: * http://translate.sourceforge.net/wiki/l10n/pluralforms The script that Fran uses to update files between Bzr & Pootle is: * [http://eden.sahanafoundation.org/attachment/wiki/UserGuidelinesLocalisation/translate.cmd translate.cmd] If the script fails, check for the presence of a ` in a T("") - this causes the languages.py to reset the languages/* to default &/or stop web2py2po from working! !ToDo: * SysAdmin#TranslationProcess ==== B. Using Auto-Translator ==== You can -also- try a new method, using a beta tool, which translates any file (including the web2py languages files) using the Google Translate API: * Go to [http://pypi.python.org/pypi/auto-translator/ "Auto-Translator"], download, uncompress the .tar.gz archive * Inside the uncompressed directory, execute the application with: - ./autotranslate.py (parameters) or - python autotranslate.py (parameters) (The parameters are: '''filename, origin language and destination language''')[[BR]] Example: ./autotranslate.py /home/johndoe/web2py/applications/eden/languages/es.py en es [[BR]] Wait (you'll see an advance status) and DONE. Just refine the translations (inside web2py or just open with a text editor)[[BR]] [[BR]] Please provide any bug report or problem to the main list ==== C. Using Web2Py Admin UI ==== You can then edit the language file directly in the Web2Py Admin UI. If wishing to provide access to just language strings & not the rest of the source code: * http://www.web2py.com/appliances/default/show/9 == Translate Wiki Pages == * Translated pages with [http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes ISO 639-2 Language Code] extension (original english page = no extension), e.g. * '''original page:''' eden.sahanafoundation.org/wiki/BluePrintInternationalisation * '''german translation:''' eden.sahanafoundation.org/wiki/BluePrintInternationalisation'''/de''' * Insert ![[TranslatedPages]] macro to display a list of available translations of a page (at best at bottom of page) == See Also == * DeveloperGuidelines/Internationalisation * BluePrint/Internationalisation