Python client does not support podirs correctly

Description

Description of problem:

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.
2.
3.

Actual results:

Expected results:

Additional info:

Environment

None

Activity

Show:

Former user 20 April 2018 at 00:23

We are closing all the old issues to have more clarity in our backlog for Zanata project. Feel free to re-open or leave a comment if you require our attention on your Jira.

Ding-Yi Chen 14 April 2016 at 01:23

I should have read the comments carefully.

zanata po pull is equivalent to --project-type gettext
so the pulled ru translation is './ru.po'

zanata publican pull is for podir project type, equivalent to --project-type podir
so the pulled ru translation is 'ru/hammer-cli.po'

I personally suggest you run with "zanata pull", because it:
1) Respect the project-type in zanata.xml
2) Less to type

However, if what you want is 'ru/ru.po'
Then you need to use file mapping rules for that.
Example zanata.xml:
<config ...>
...
<rules>
<rule pattern="*/.pot">{locale_with_underscore}/{locale_with_underscore}.{extension}</rule>
</rules>
</config>

That said, Sundeep's fix is also useful, for it fixed the bug in mapping rules.

Sundeep Anand 12 April 2016 at 07:15

Thanks for the details.
Push pull follow standard mapping rules as we can see here http://docs.zanata.org/projects/zanata-client/en/latest/configuration/
po pull should follow gettext project mapping rule where as publican pull follows podir rule.

Tatsuyuki Ishi 25 March 2016 at 03:34

Not sure what this issue describes is exactly my situation, but for a reference I will describe my issue:

My config is like following:
<project-type>podir</project-type>
<src-dir>po</src-dir>
<trans-dir>po</trans-dir>

I put <project>.pot in the po directory (po/<project>.pot).

Expected behavior, according to documentation and Java client:
po/<project>.pot => (Server)<project>.pot

Python client behavior(wrong):
po/<project>.pot => (Server)po/<project>.pot
Resulting in pull:
po/<lang>/po/<project>.po

bkearney 16 March 2016 at 18:44

If I use zanata po pull it is still occuring. zanata pull does not exhibit this behaviour.

[bkearney@fivehole zanata] $ rpm -qa | grep zanata
zanata-api-3.8.3-1.fc23.noarch
zanata-common-3.8.1-1.fc23.noarch
zanata-client-3.8.1-1.fc23.noarch
zanata-python-client-1.4.1-2.fc23.noarch
[bkearney@fivehole zanata] $ cat hammer-cli/zanata.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<config xmlns="http://zanata.org/namespace/config/">
<url>SUPER SECRET URL/</url>
<project>hammer-cli</project>
<project-version>6.2</project-version>
<project-type>podir</project-type>
<locales>
<locale>fr</locale>
<locale>it</locale>
<locale>ja</locale>
<locale>ko</locale>
<locale>ru</locale>
<locale map-from="de">de</locale>
<locale map-from="es">es</locale>
<locale map-from="pt_BR">pt-BR</locale>
<locale map-from="zh_CN">zh-CN</locale>
<locale map-from="zh_TW">zh-TW</locale>
</locales>
</config>

Ready for Release

Details

Assignee

Reporter

Labels

Original estimate

Time remaining

0.83d

Components

Priority

Created 29 July 2015 at 03:30
Updated 27 June 2018 at 02:21
Resolved 14 April 2016 at 04:06