|
Petr Šabata |
f5bf49 |
Zanata is a web-based system for managing localisation projects.
|
|
Petr Šabata |
f5bf49 |
For kexec-tools firstboot module, I created a zanata project with name of
|
|
Petr Šabata |
f5bf49 |
"kexec-tools": https://translate.zanata.org/zanata/project/view/kexec-tools
|
|
Petr Šabata |
f5bf49 |
|
|
Petr Šabata |
f5bf49 |
There's several clients available for zanata translation management, such as
|
|
Petr Šabata |
f5bf49 |
python client and Maven client. It's suggested to use maven client for latest
|
|
Petr Šabata |
f5bf49 |
zanata issues
|
|
Petr Šabata |
f5bf49 |
|
|
Petr Šabata |
f5bf49 |
Firstly you need install mvn rpms, just do below for fedora 16 and beyond:
|
|
Petr Šabata |
f5bf49 |
yum install maven
|
|
Petr Šabata |
f5bf49 |
|
|
Petr Šabata |
f5bf49 |
create zanata.ini in your home dir:
|
|
Petr Šabata |
f5bf49 |
>~/.config/zanata.ini
|
|
Petr Šabata |
f5bf49 |
There should be something need to change like below:
|
|
Petr Šabata |
f5bf49 |
translate_zanata_org.url=https://translate.zanata.org/zanata/
|
|
Petr Šabata |
f5bf49 |
translate_zanata_org.username=
|
|
Petr Šabata |
f5bf49 |
translate_zanata_org.key=
|
|
Petr Šabata |
f5bf49 |
|
|
Petr Šabata |
f5bf49 |
Change username to your zanata username
|
|
Petr Šabata |
f5bf49 |
Change the key to the "API key" of zanata which can be generate from
|
|
Petr Šabata |
f5bf49 |
zanata web page.
|
|
Petr Šabata |
f5bf49 |
Open user profile page of zanata.org, click "Generate API Key" to create it.
|
|
Petr Šabata |
f5bf49 |
|
|
Petr Šabata |
f5bf49 |
zanata is a plugin of maven, to activate it, you need do below configurations:
|
|
Petr Šabata |
f5bf49 |
1. cd kexec-tools/po, (assume kexec-tools is the git repo)
|
|
Petr Šabata |
f5bf49 |
2. add a pom.xml like below: (note: version 2.0.0 is better than 1.7.5
|
|
Petr Šabata |
f5bf49 |
for performance improvement)
|
|
Petr Šabata |
f5bf49 |
<project>
|
|
Petr Šabata |
f5bf49 |
...
|
|
Petr Šabata |
f5bf49 |
<build>
|
|
Petr Šabata |
f5bf49 |
<plugins>
|
|
Petr Šabata |
f5bf49 |
<plugin>
|
|
Petr Šabata |
f5bf49 |
<groupId>org.zanata</groupId>
|
|
Petr Šabata |
f5bf49 |
<artifactId>zanata-maven-plugin</artifactId>
|
|
Petr Šabata |
f5bf49 |
<version>1.7.5</version>
|
|
Petr Šabata |
f5bf49 |
</plugin>
|
|
Petr Šabata |
f5bf49 |
</plugins>
|
|
Petr Šabata |
f5bf49 |
</build>
|
|
Petr Šabata |
f5bf49 |
...
|
|
Petr Šabata |
f5bf49 |
</project>
|
|
Petr Šabata |
f5bf49 |
3. add zanata.xml for your project with content like below:
|
|
Petr Šabata |
f5bf49 |
|
|
Petr Šabata |
f5bf49 |
<config xmlns="http://zanata.org/namespace/config/">
|
|
Petr Šabata |
f5bf49 |
<url>https://translate.zanata.org/zanata/</url>
|
|
Petr Šabata |
f5bf49 |
<project>kexec-tools</project>
|
|
Petr Šabata |
f5bf49 |
<project-version>F18</project-version>
|
|
Petr Šabata |
f5bf49 |
<project-type>gettext</project-type>
|
|
Petr Šabata |
f5bf49 |
|
|
Petr Šabata |
f5bf49 |
<locales>
|
|
Petr Šabata |
f5bf49 |
<locale>ar</locale>
|
|
Petr Šabata |
f5bf49 |
...
|
|
Petr Šabata |
f5bf49 |
</config>
|
|
Petr Šabata |
f5bf49 |
|
|
Petr Šabata |
f5bf49 |
You can get mostly-complete zanata.xml from the project version page on zanata
|
|
Petr Šabata |
f5bf49 |
Things need to be modified is:
|
|
Petr Šabata |
f5bf49 |
a) project-type, please use gettext
|
|
Petr Šabata |
f5bf49 |
b) for locales which are diffrent between local name and zanata server name,
|
|
Petr Šabata |
f5bf49 |
for example for kexec-tools we have bn_IN but zanata server accept bn-IN,
|
|
Petr Šabata |
f5bf49 |
so we need to add below line:
|
|
Petr Šabata |
f5bf49 |
<locale map-from="bn_IN">bn-IN</locale>
|
|
Petr Šabata |
f5bf49 |
|
|
Petr Šabata |
f5bf49 |
The first running of "mvn zanata:help" will download and activate the new
|
|
Petr Šabata |
f5bf49 |
version of zanata plugin for you.
|
|
Petr Šabata |
f5bf49 |
|
|
Petr Šabata |
f5bf49 |
I use below command to upload both pot file and translated po files:
|
|
Petr Šabata |
f5bf49 |
mvn zanata:push -Dzanata.pushType=both
|
|
Petr Šabata |
f5bf49 |
If you only need to upload po files, you can use:
|
|
Petr Šabata |
f5bf49 |
mvn zanata:push -Dzanata.pushType=trans
|
|
Petr Šabata |
f5bf49 |
|
|
Petr Šabata |
f5bf49 |
You can use mvn zanata:help to lookup the detail help content of param names
|
|
Petr Šabata |
f5bf49 |
|
|
Petr Šabata |
f5bf49 |
The other thing to be careful is specifying the correct source and
|
|
Petr Šabata |
f5bf49 |
translation directories.
|
|
Petr Šabata |
f5bf49 |
They are relative path. You can also put the pom.xml and zanata.xml under toplevel directory and run:
|
|
Petr Šabata |
f5bf49 |
mvn zanata:push -Dzanata.pushType=both -Dzanata.srcDir=po -Dzanata.transDir=po
|
|
Petr Šabata |
f5bf49 |
|
|
Petr Šabata |
f5bf49 |
--
|
|
Petr Šabata |
f5bf49 |
[1] https://github.com/zanata/zanata/wiki/Zanata-Maven-Integration
|
|
Petr Šabata |
f5bf49 |
[2] https://github.com/zanata/zanata/wiki/client-configuration
|