Description of problem:
When the POT filename is beginning from the underscore, such as _Exit.2.pot, zanata-cli always fails due to:
[main] ERROR org.zanata.client.commands.push.PushCommand - Operation failed: Error status 404 Not Found returned
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1.push the pot file to the server
the above error happens.
Ding-Yi Chen commented on 2014-06-24 00:25:17 -0400:
This can also be reproduced with
Server: Zanata 3.4.2-SNAPSHOT (git-server-3.4.1-47-g88e8fe3)
client API version: 3.3.1, server API version: 3.3.1
Project type: gettext
Filename: libstdc+-v3/po/libstdc+.pot (gcc-4.9.0)
David Mason commented on 2014-08-05 21:39:45 -0400:
This has something to do with RESTEasy paths, and there would probably be similar issues with some other characters such as commas. The problem stems from the use of filenames as part of a URL: the rules for what can be in a URL are a lot more stringent than for what can be in a filename.
Proposed fix: Make filenames a query parameter with escaping. This would get around this and all other issues with RESTEasy's handling of different characters. This would require deprecating the current REST endpoint and implementing a new endpoint with the filename as a query parameter.
Patrick Huang commented on 2014-08-27 20:10:00 -0400:
A workaround exists:
Add command hook to zanata.xml to rename the file before push and back again after pull.
Example (not tested only in theory)
<before>mv _Exit.2.pot Exit.2.pot</before>
<after>mv Exit.2.pot _Exit.2.pot</after>
<!-- assuming this is a gettext project. For podir it will be different -->
<!-- need to rename all locales but here just use ja as one example -->
<after>mv Exit_ja.po _Exit_ja.po</after>
Allow underscores, hyphens, and periods in resource slugs / regex
Correction - allow start with hyphen / underscore, and period anywhere after start (i.e. not hidden).