Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support uploading of translations #16

Open
aschempp opened this issue Mar 25, 2014 · 5 comments
Open

Support uploading of translations #16

aschempp opened this issue Mar 25, 2014 · 5 comments

Comments

@aschempp
Copy link

Looks like (and @Toflar told me) that it's currently not supported to upload existing translations?

@discordier
Copy link
Member

This should be possible by temporarily switching the base language to the desired language and performing a normal upload.
Haven't tested it though.

See https://github.com/cyberspectrum/contao-toolbox#--base-language--b--the-base-language-to-use-default-en

Feel free to implement a sub command for this, as I am currently drowning in expanding TODO lists.

@aschempp
Copy link
Author

Thanks a lot for the info. When I try to set the base language, I get this error:

[RuntimeException]
Error: Could not import file: Target language code 'pl' in XLIFF file does not map to the translation language: 'English (en)' for which it was uploaded. URI: http://www.transifex.com/api/2/project/contao-changelanguage/resource/master-default/content/

If you could quickly tell me that will probably not work with base-language, then I might extend the tool (when my TODO list is smaller, too ;-) )

@discordier
Copy link
Member

Ok, it seems like it needs digging into the API doc for this.

IMO This is the correct place:
http://support.transifex.com/customer/portal/articles/1026102-translations-api

PUT /project/<project_slug>/resource/<resource_slug>/translation/<lang_code>/
Creates or updates the translation for the specified language. Either the translation is JSON encoded or the request has multipart/form-encode as content type and the file is attached.

In the case of using JSON, the JSON data must be a dictionary with the key being the word "content" and the value being the content of the file.

Should be possible by copying and minimally adjusting the already present upload of the base language.

@andreasisaak
Copy link
Contributor

+11111

@discordier
Copy link
Member

As @andreasisaak and I just found out, you can upload the converted xlf files directly to the destination language via the web tool on transifex.

This ticket is still valid but it might work out for you in the meantime as it is less of a hassle than copy&pasting all the entries one by one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants