NethServer localization (l10n)
The localization process turns around the online tool Transifex.
The Transifex client, available as /usr/bin/tx
command, is required. Some
Linux distributions have already packaged it. For NethServer, it is
available from EPEL.
yum --enablerepo=epel install transifex-client yum install git
Edit ~/.transifexrc
:
[https://www.transifex.com] hostname = https://www.transifex.com password = <YOURPASSWORD> token = username = <YOURUSERNAME>
Build localization packages
Preparing the environment:
(Fork and) Clone the git repository into your machine:
git clone https://github.com/NethServer/nethserver-lang.git
Make sure
nethserver-mock
package is installed. It is available for NethServer and Fedora.
Build the RPMs:
Pull updates from Transifex:
tx pull -a
(optional) clean up partially translated languages:
git clean -f -d
Commit changes to git repository:
git commit -a -m 'Pulled translation strings from Transifex'
Build RPMs:
make-rpms nethserver-lang.spec
If everything is ok, do not forget to push the commit back to GitHub, and open a Pull Request:
git push
Testing the translations
The RPMs are uploaded to the nethserver-testing
repository. The
official way to test them is:
yum --enablerepo=nethserver-testing update nethserver-lang-de
If you want to check the translations before they are packaged, follow this procedure on a NethServer testing only machine:
Install the original language pack (for instance,
de
)yum install nethserver-lang-de
Clone this repository
cd /srv git clone https://github.com/NethServer/nethserver-lang.git
Pull latest strings from Transifex:
cd /srv/nethserver-lang tx pull -a
Create a symlink for your language (for instance,
de
), that overrides the language packcd /usr/share/nethesis/NethServer/Language mv de de.orig ln -s /srv/nethserver-lang/locale/de/server-manager de
Warning
This method works only for .php
language
catalogs. For instance online help files (from .rst
),
.js
and .mo
files are not included.
Package developer
Push updated sources to Transifex:
tx push -s
Refer to Internationalization chapter on the Developer's Manual.
Adding new resources
After the developer has pushed sources to Transifex, the new resources must be added inside .tx/config
.
Add the relevant configuration, for PHP resources something like:
[nethserver.MyModule] file_filter = locale/<lang>/server-manager/NethServer_Module_MyModule.php source_file = locale/en/server-manager/NethServer_Module_MyModule.php source_lang = en type = PHP_ALT_ARRAY
Then retrieve all files:
tx pull -r nethserver.MyModule -a
Finally, add all files to the repository:
git add *NethServer_Module_MyModule*