Ushahidi uses Kohana's internationalization features.
- Language strings are stored in PHP arrays under the i18n directory.
The application/i18n directory is included as a submodule from the Ushahidi-Localizations
- The strings are retrieved using Kohana::lang()
- See the Kohana docs for more info: http://docs.kohanaphp.com/general/i18n
Translations for the platform are managed in Transifex
- Transifex works with PO files, so the PHP arrays have to be converted before sending to Transifex.
- The conversion is done by a custom Kohana module: https://github.com/rjmackay/kohana-i18n-manager
- PO files are pushed to Transifex using the transifex commandline client: http://help.transifex.com/features/client/
Sources of Truth
- The authoritative source for source strings is the Ushahidi-Localization repository on github.
- The authoritative source for translations is the Transifex repository
To add new strings:
- Create a new translation string
- Add it to the i18n/en_US PHP arrays
- Commit this change to the Ushahidi-Localizations repository
The new string will be automatically picked up by cron runs and pushed to Transifex
Cron runs tools/full-sync.sh on qa.ushahididev.com every 6 hours
- Converts PHP arrays for en_US to POT files
- Commits POT files to github
- Uploads POT files to Transifex
- Downloads translated strings from Transifex into PO files
- Converts PO files to PHP arrays
- Commits PO files and PHP files to github
- Kohana lang docs [http://docs.kohanaphp.com/core/kohana?s=lang#use_language_strings|http://docs.kohanaphp.com/core/kohana?s=lang#use_language_strings]
- Kohana internationalization http://docs.kohanaphp.com/general/i18n
- Kohana UTF8 library http://docs.kohanaphp.com/core/utf8
- Ushahidi-Localization repository https://github.com/ushahidi/Ushahidi-Localizations
- Kohana-i18n-module https://github.com/rjmackay/kohana-i18n-manager
- Transifex repository