Translation of ownCloud is organized at Transifex.
Configure transifex
tx init
for resource in calendar contacts core files media gallery settings do tx set --auto-local -r owncloud.$resource "<lang>/$resource.po" --source-language=en \ --source-file "templates/$resource.pot" --execute done
Quick translation update:
cd l10n/ && perl l10n.pl read && tx push -s && tx pull -a && perl l10n.pl write && cd ..
The translation script requires Locale::PO, installable via apt-get install liblocale-po-perl
Make text translatable
- In HTML or PHP wrap it like this
<?php echo $l->t('This is some text');?>- For the right date format use
<?php echo $l->l('date', time());?>. Change the way dates are shown by editing/core/l10n/l10n-[lang].php - To translate text in javascript use:
t('appname','text to translate');
- For the right date format use
- Add a folder
l10nin the app. In there, have a filexgettextfilesand put in the paths to all files that have translatable texts (one per line, relative to the l10n folder) - Load all strings or update them: navigate to the main l10n folder and use the terminal command
perl l10n.pl read - Send the updated sources to our translation platform Transifex:
tx push -s
That’s it, now the translators can work. For more information, have a look at the inline documentation of lib/l10n.php
