translate / pootle

Online translation tool
http://pootle.translatehouse.org
GNU General Public License v3.0
1.48k stars 287 forks source link

Support for batch downloading and uploading #4564

Open huftis opened 8 years ago

huftis commented 8 years ago

This is a feature request. I prefer to do offline translation (for a variety of reasons), and it would be nice if it was possible to batch download and batch upload the translations for a given language.

The ideal solution would be a simple command-line client that would work something like this:

pootle fetch-translations lang-code

to download all the .po files for the given language (lang-code), with a --templates option for fetching the templates instead. For uploading, one would simple type

pootle commit-translations lang-code

Downloading and uploading just a subset of the files could be done by appending the list of files to download/upload.

Another (simpler, but not as user-friendly) option would be to download the files using a special URL. Just like one can currently use

http://example.com/lang-code/module/export/zip

to download a single .zip file for a project, one could use

http://example.com/lang-code/export/zip

to download a zip file containing all .po files for all the modules for the given language (or the .pot files for templates). There would also have to be a way to upload the corresponding .zip (with updated translations) file using the command-line.

Currently, I just use a simple shell script with a bunch of ‘wget’ calls to download all the files manually (and try to manually update the scripts with new URLs when new modules are added). After updating the translations, I have to manually upload the files one by one using a Web browser. This sort of works, at least with projects with few .po files, but takes time (and would take much longer time than the actual translation updating for larger projects), so some sort of batch download/upload feature would be very much appreciated.

friedelwolff commented 8 years ago

The current developers would have to confirm, but in the past it was possible to upload a zip file with a subset of files. In other words, you can just create a zip file with the affected files and upload that in one go. This is not quite an answer to everything you are writing, but might help a bit.

unho commented 8 years ago

It is possible to upload a zip with a subset of files, and in the way it is implemented I think you can even upload files in any project and any language, as long as you have permission to do that. Please note that currently upload only works for Gettext PO format.

huftis commented 8 years ago

From what I can see, it is currently possible to download (and upload) a .zip per project (what I called ‘modules’ in my original comment) for each language. This is a feature request to expand this to a per language download and upload (but preferably with a simple command-line client, so that it can be automated / run by scripts).

Many software projects have the translations split into several ‘projects’, and currently one has to download and upload the files separately for each ‘project’. Here’s an example (though running on an older Pootle instance): http://translate.scratch.mit.edu/fr/ There’s five ‘projects’, and one has two click on each in turn to get to a folder for downloading the translation files (and uploading them if one is logged in).

Note that a file name may be duplicated among projects (the above links has an example), so if this is implemented, the translation files for each project must be stored in a separate folder inside the .zip file (or when downloaded with a command-line client).