Uploading a .pot file via Web UI retains the extension

Description

Uploading a .pot gettext file via the ui results in a "myfile.pot" document in the project. This differs to the client upload in that the extension is stripped.
This results in being unable to upload translations to the project, with the message
[ERROR] Operation failed: Failed while pushing document translations: [A document was not found.]

1. Go to a project, and create a version that is gettext
2. In Settings, Documents -> click + and upload the .pot file
3. Download the project config via the dropdown and move it to a test folder
4. In said folder, do

/path-to/zanata-cli/etc/scripts/zanata-cli -e push --username (you) --key (your_key) --url "http://localhost:8080/zanata/" --project-type gettext --push-type trans --file-types GETTEXT[po] --trans-dir . --project-config zanata.xml --src-dir . --merge-type import --locales ar

Actual:

[INFO] Found source documents: [INFO] pot_example [WARN] pushType set to 'Trans': existing translations on server may be overwritten/deleted [?] This will overwrite existing TRANSLATIONS on the server. Are you sure (y/n)? y [INFO] Pushing target doc [name=pot_example size=2 client-locale=ar] to server [locale=ar] [== ][ERROR] Operation failed: Failed while pushing document translations: [A document was not found.] To retry from the last document, please set the following option(s): --from-doc "pot_example" . [ERROR] Execution failed: java.lang.RuntimeException: Failed while pushing document translations: [A document was not found.] at org.zanata.client.commands.push.PushCommand.pushCurrentModule(PushCommand.java:458) at org.zanata.client.commands.push.PushCommand.run(PushCommand.java:212) at org.zanata.client.commands.ConfigurableCommand.runWithActions(ConfigurableCommand.java:110) at org.zanata.client.commands.ArgsUtil.runCommand(ArgsUtil.java:48) at org.zanata.client.ZanataClient.processArgs(ZanataClient.java:170) at org.zanata.client.ZanataClient.main(ZanataClient.java:95) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.RuntimeException: Failed while pushing document translations: [A document was not found.] at org.zanata.client.commands.push.PushCommand.pushTargetDocToServer(PushCommand.java:696) at org.zanata.client.commands.push.PushCommand.access$300(PushCommand.java:55) at org.zanata.client.commands.push.PushCommand$1.visit(PushCommand.java:417) at org.zanata.client.commands.push.AbstractGettextPushStrategy.visitTranslationResources(AbstractGettextPushStrategy.java:144) at org.zanata.client.commands.push.PushCommand.pushCurrentModule(PushCommand.java:402)

Environment

None

Activity

Show:
Ready for Release

Details

Assignee

Reporter

Labels

Time remaining

0d

Components

Sprint

Fix versions

Affects versions

Priority

Created 22 March 2016 at 06:37
Updated 27 June 2018 at 02:21
Resolved 11 May 2016 at 04:16

Flag notifications