[Openstack-i18n] [OpenStack-Infra] Pootle and Zanata trial

Carlos Munoz camunoz at redhat.com
Thu Oct 23 01:01:58 UTC 2014


Hi Andreas,

The reason why the python client doesn't find your PO files is because
it is expecting them to be in a strictly standard place for po files.
Because you have that LC_MESSAGES directory, that throws the python
client off base. This is one of the things we have improved in our java
client. So I'm going to guide you through the same exact steps you are
trying here, but with the java client.

1. I cloned the nova source code from https://github.com/openstack/nova/
to start from scratch.

2. I installed the Java client. Of course you need java installed, and
then follow the instructions here:

https://github.com/zanata/zanata-client-ivy
(not sure what you are running on, but the "other systems" section works
everywhere)

3. Opened a command line terminal on the nova directory for my checked
out project from GitHub and typed

$ <PATH-TO-CLI>/zanata-cli init

This will guide you through a series of questions to get your project
set up (things like where your source files are, etc.). For more
information on this you can go to http://zanata.org/help/cli/cli-init/

After this step, your directory should be ready to push source files,
which you can do with:

$ <PATH-TO-CLI>/zanata-cli push

4. Because of the LC_MESSAGES directory, you need to customize
zanata.xml to tell the client where to find translation files. Currently
this is a manual step as to be as flexible as possible. For the nova
project, I added the following snippet to zanata.xml:

<rules>
    <rule
pattern="**/*.pot">{locale_with_underscore}/LC_MESSAGES/{filename}.po</rule>
</rules>

For more information on why/how to configure your mappings, please refer
to http://zanata.org/help/cli/cli-configuration/  , see the "translation
files mapping rules" section

5. Pushed the translations files

$ <PATH_TO_CLI?zanata-cli push --push-type trans

You can view the results on Zanata, for the two locales you had activated.

I am attaching the exact zanata.xml that I used. You can use the same
zanata.xml to pull your project, or you can follow these steps and it
will yield the same result.

===============================================================

Now, to answer your specific questions at the end:

* (ad 7): How can I upload the translation files via command line for an
initial import?

I think I covered that in my series of steps above, as it was really an
initial push from the source repo. Let me know if you still have
questions there.

* (ad 5) What happens if more languages get added on the server, how to
update the local zanata.xml file? Or is there a way to download it
automatically using the client?

That is currently a manual process because the server doesn't contain
all the information that you might have customized (like I did in my
example) in your zanata.xml. Having said that, it should not be very
difficult to implement a client feature that lets you update the
languages from the project in Zanata.


I hope I've shed some light on the zanata client workings. As usual, let
me know if you have any other questions.

Regards,


Carlos A. Munoz
Software Engineering Supervisor
Engineering - Internationalization
Red Hat

On 10/22/2014 09:42 PM, Andreas Jaeger wrote:
> I did some testing using the python client and liked that it was
> modelled after the transifex one in some cases.
> 
> I've documented what I tried - and where I run into problems:
> 
> 
> 1) Create API key
> 2) install zanata python client:
> $ git clone https://github.com/zanata/zanata-python-client.git
> 
> 3) Create nova project:
> $ zanata --url http://15.126.226.230:8080/ project create nova
> --project-name="OpenStack Nova" --project-desc="OpenStack Nova"
> 
> 4) Create project version "master":
> $ zanata version create master --project-id=nova --version-name=master
> --version-desc="git master"
> 
> 5) Manually download zanata.xml file and save to nova top-dir
> 
> Note this is a manual update, it needs to be kept in the repo. We could
> create this manually if
> needed but there's no "tx init" equivalent.
> 
> 
> 6) Push source po files:
> 
> $ zanata po push
> 
> 
> 7) Push translation files:
> $ zanata --url http://15.126.226.230:8080/ push  --push-type=both
> --transdir=nova/locale/ --lang=fr -f
> 
> Does not work, it does not find the po files like
> nova/locale/fr/LC_MESSAGES/nova.po.
> 
> 
> Questions:
> * (ad 7): How can I upload the translation files via command line for an
> initial import?
> * (ad 5) What happens if more languages get added on the server, how to
> update the local zanata.xml file? Or is there a way to download it
> automatically using the client?
> 
> 
> Andreas
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zanata.xml
Type: text/xml
Size: 581 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack-i18n/attachments/20141023/6d82c6e0/attachment.xml>


More information about the Openstack-i18n mailing list