Bug 732576 - Show proper warning message when pushing unsupported locales, instead of "Unexpected error"
Show proper warning message when pushing unsupported locales, instead of "Une...
Status: CLOSED CURRENTRELEASE
Product: Zanata
Classification: Community
Component: Component-PythonClient (Show other bugs)
1.4-RC
Unspecified Unspecified
unspecified Severity medium
: ---
: ---
Assigned To: James Ni
Ding-Yi Chen
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-08-22 21:13 EDT by Ding-Yi Chen
Modified: 2012-01-03 21:58 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-01-03 21:58:32 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Ding-Yi Chen 2011-08-22 21:13:56 EDT
Description of problem:
When pushing message with message context, zanata-python-client producing following error:
warning: encountered msgctxt; not currently supported

warning: encountered msgctxt; not currently supported

warning: encountered msgctxt; not currently supported

error: Unexpected Status, failed to push


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

1.2.5-20-g8462


How reproducible:
Always

Steps to Reproduce:
1. git clone git://github.com/definite/ibus-chewing.git
2. cd ibus-chewing/po
3. Generate ibus-chewing.pot by:
xgettext --language=C --keyword=_ --keyword=N_ --keyword=C_:1c,2 --keyword=NC_:1c,2 -s --package-name=ibus-chewing --package-version=master -o ibus-chewing.pot ../src/*.c ../src/*.go

4. Edit following as zanata.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<config xmlns="http://zanata.org/namespace/config/">

    <url>http://flies-devel.englab.bne.redhat.com/zanata-test/</url>

    <project>IBusChewing</project>

    <project-version>master</project-version>

    <locales>

        <locale map-from="zh_CN">zh-Hans</locale>

        <locale map-from="zh_TW">zh-Hant</locale>
    </locales>

</config>

5. zanata push --project-type=gettext

Actual results:
Error messages:
warning: encountered msgctxt; not currently supported
warning: encountered msgctxt; not currently supported
warning: encountered msgctxt; not currently supported
error: Unexpected Status, failed to push

Expected results:
Successfully pushed but with warning.
Comment 1 Ding-Yi Chen 2011-08-22 21:38:59 EDT
Sorry, the trailing 'b' was missing in the step 3,
so the revised step 3 is:

3. xgettext --language=C --keyword=_ --keyword=N_ --keyword=C_:1c,2
--keyword=NC_:1c,2 -s --package-name=ibus-chewing --package-version=master -o
ibus-chewing.pot ../src/*.c ../src/*.gob
Comment 2 Ding-Yi Chen 2011-08-22 22:05:48 EDT
Hmm, now it seems pushing successfully. :-/

I will put needinfo to myself until either it reappears or it disappears for one month.
Comment 3 Ding-Yi Chen 2011-09-20 03:13:08 EDT
Aha, this "bug" is actually not about msgctxt, but caused by unsupported locale.

That is, this bug occurs when zanata.xml contains following:
<locale map-from="zh_TW">zh-Hant</locale>
<locale map-from="zh_CN">zh-Hans</locale>

but server instead supports "zh-Hant-TW" and "zh-Hans-CN".

So this bug is actually for pushing unsupported locales.

Description of problem:
Pushing translation in unsupported locale caused following error: 
Unexpected Status, failed to push translation to zanata server.

User can have better clue if a warning message looks like
"Locale XXX is not supported by Zanata server, skip pushing."

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


How reproducible:
Always

Steps to Reproduce:
1. git clone git://github.com/definite/ibus-chewing.git
2. cd ibus-chewing/po
3. Generate ibus-chewing.pot by:
xgettext --language=C --keyword=_ --keyword=N_ --keyword=C_:1c,2
--keyword=NC_:1c,2 -s --package-name=ibus-chewing --package-version=master -o
ibus-chewing.pot ../src/*.c ../src/*.go

4. Edit following as zanata.xml, make sure the locales are invalid, such like:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<config xmlns="http://zanata.org/namespace/config/">
    <url>http://flies-devel.englab.bne.redhat.com/zanata-test/</url>
    <project>IBusChewing</project>
    <project-version>master</project-version>
    <locales>
        <locale map-from="zh_CN">zh-HS</locale>
        <locale map-from="zh_TW">zh-HT</locale>
    </locales>
</config>

5. zanata push --project-type=gettext

Actual results:
Error messages:
"Unexpected Status, failed to push translation to zanata server."

Expected results:
Warning messages:
"Locale XXX is not supported by Zanata server, skip pushing."
Comment 4 James Ni 2011-09-20 03:32:06 EDT
Hi,
I have modified error message in commit 067b184 several days ago, sorry i didn't announce that, please use the latest code on git-hub to verify it.

Actually, the error message returned from server is "Locale XXX is not enabled on this server. Please contact admin.", so i display this message to user directly, and even you gave a wrong locale name that never exist, like --lang=blabla, the sever still return a error message for "Locale blabla is not enabled on this server. Please contact admin." 

Also, warning message for msgctxt still there: "warning: encountered msgctxt; not currently supported" still there, i use fedora 14 to test.
Comment 5 Ding-Yi Chen 2011-09-20 19:15:39 EDT
Since we do currently support msgctxt yet, so the warning message 
"warning: encountered msgctxt; not currently supported" is acceptable.
Comment 6 Ding-Yi Chen 2011-09-20 20:32:05 EDT
VERIFIED with commit 2c477843248a4a7ba03840c341824b856c433e0a
Comment 7 Sean Flanigan 2011-10-28 04:19:42 EDT
That commit doesn't seem to exist: https://github.com/zanata/zanata-python-client/commit/2c477843248a4a7ba03840c341824b856c433e0a

Did this fix make it into 1.3.1?
Comment 8 James Ni 2011-11-01 04:04:23 EDT
Hi Sean,

Sorry, the commit for this issue should be 067b184, you can find it at:
https://github.com/zanata/zanata-python-client/commit/067b184f88fcf7592380d9cf8b56017c48bda31f

This issue have not included in 1.3.1, i will included it in upcoming 1.3.2, i will close it when i 1.3.2 is released.

Thanks

Note You need to log in before you can comment on or make changes to this bug.