Description of problem: As per Bug#768875, even though zanata client says "no translation", it's going to write PO file with the broken contents. actually it was something what the client was success to update last time. Version-Release number of selected component (if applicable): zanata-python-client-1.3.1-1.fc15.noarch How reproducible: always Steps to Reproduce: 1.see the step in Bug#768875. 2. 3. Actual results: Retrieving zh_CN translation from server: There is no zh_CN translation for imsettings Writing po file to /home/tagoh/work/repo/imsettings/po/zh_CN.po and more. Expected results: that should stop writing if no translation found. Additional info:
*** Bug 768875 has been marked as a duplicate of this bug. ***
Hi, I have make a commit to git-hub for zanata-python-client to fix this issue, if there is no translation, or the locale is not enabled on the server, the client will stop writing. Please check out the latest code for testing. 'map-from' actually works, but the client only display the locale name using on the client side, doesn't output the process of mapping. So do you think we should output more detail info for mapping process? like: Mapping zh_CN to zh-Hans-CN Retrieving zh-Hans-CN translation from server: ..... or Can not find mapping in zanata.xml, using zh_CN directly. Retrieving zh_CN translation from server: ..... Maybe it is more clear for the user? Best Regards
Hi, I add a option named --noskeleton to python client. If users doesn't want to generate empty po files when no translation found, they can enable this option. The python client will generate skeletons files for empty po files by default, since some publican users need this feature. Please take reference: Bug 754870 https://bugzilla.redhat.com/show_bug.cgi?id=768877 Also, the python client need to make consist with Maven client.
Hi, I add a option named --noskeleton to python client in commit 47bb369bbb https://github.com/zanata/zanata-python-client/commit/47bb369bbbfd0d243050b6b98e98bd3690b9ad0c. If users doesn't want to generate empty po files when no translation found, they can enable this option. By default, the python client will generate skeletons files when no translations found, since some publican users need this feature. Please take reference: "Bug 754870 Maven client should generate skeletons for empty files" https://bugzilla.redhat.com/show_bug.cgi?id=768877 Also, the python client need to make consist with Maven client. Best Regards
Version 1.3.4 does contain this function, yet zanata --help pull does not show such option. Please add a description of this --noskeletion function. Another thing I need to mention is when I run following command: zanata --noskeletion --project-type=gettext Following error occurs if zanata.xml does not contain <project-type>gettext</project-type> error: 'NoneType' object has no attribute 'makefile' This does not occurs without --noskeletion, nor does it happen for zanata po pull. Thus this bug is reassigned.
Created attachment 565193 [details] zanata.xml for ibus-chewing
That error: 'NoneType' object has no attribute 'makefile' is actually happen when pull from ibus-chewing, translate.zanata.org. In comment 5 I make 2 error: 1. the command is "zanata --noskeleton --project-type=gettext" 2. "zanata po pull" also trigger this problem
Mmm, seems the error: 'NoneType' object has no attribute 'makefile' is caused by python-httplib2. (see http://code.google.com/p/httplib2/issues/detail?id=62)
Hi Ding Thanks a lot for your info. I have tried to install version 0.7.2 of python-httplib2, and try with version 1.3.4 of zanata-python-client, found this issue is fixed. There is no need to modify the zanata-python-client. The reason of this issue is "server refused the connection", so if you want to verify this issue, you can just simplify change the URL in zanata.xml to <url>http://localhost:8080/zanata</url> and stop running local instance of zanata, you will see the error message with python-httplib2 < 0.7.1: error: 'NoneType' object has no attribute 'makefile' with 0.7.2. the error message is changed to: error: [Errno 111] Connection refused. If you want to verify this issue on F15, F16, please download 0.7.2 directly from: http://httplib2.googlecode.com/files/httplib2-0.7.2.tar.gz unzip and run 'python setup.py install'.
James, The default behaviour, (without --noskeleton), is now consist with maven client. which is good. However, there is no option if user do need skeleton files. I'll verified this for now, but note that you might need to provide such option in future. VERIFIED with 1.3.4-7-gab64