Command-line downloading of OpenSUSE translation files from Weblate

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Command-line downloading of OpenSUSE translation files from Weblate

Karl Ove Hufthammer
Hi!

Does anyone here have any experience downloading and uploading
translations from Weblate? From what I can see, there’s an API
(https://docs.weblate.org/en/latest/api.html#), but I find it quite
complex, and I couldn’t get it to work.

Basically, what I want to do is in principle very simple:

1. Download all .po files for a given language.
2. Download all template files (.pot files).
3. Upload all .po files for a given language to Weblate (overwriting any
existing translations).

Has anybody done this, and can instruction me on how to do it?

--
Karl Ove Hufthammer

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Command-line downloading of OpenSUSE translation files from Weblate

Yasuhiko Kamata
Hello,

Weblate API requires HTTP client (curl, wget, etc.) and
JSON encoder/decoder.

Attached my perl script is just for:
> 1. Download all .po files for a given language.
$API_KEY and @LANG_CODES should be filled before run (embedded in
script itself).

Hope it is helpful.

Thanks,

On Mon, 3 Jul 2017 16:25:30 +0200
Karl Ove Hufthammer <[hidden email]> wrote:

> Hi!
>
> Does anyone here have any experience downloading and uploading
> translations from Weblate? From what I can see, there’s an API
> (https://docs.weblate.org/en/latest/api.html#), but I find it quite
> complex, and I couldn’t get it to work.
>
> Basically, what I want to do is in principle very simple:
>
> 1. Download all .po files for a given language.
> 2. Download all template files (.pot files).
> 3. Upload all .po files for a given language to Weblate (overwriting
> any existing translations).
>
> Has anybody done this, and can instruction me on how to do it?
>
> --
> Karl Ove Hufthammer
>
> --
> To unsubscribe, e-mail: [hidden email]
> To contact the owner, e-mail: [hidden email]
>

--
Yasuhiko Kamata
E-mail: [hidden email]

backup_alltranslations.pl (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Command-line downloading of OpenSUSE translation files from Weblate

Karl Ove Hufthammer
Yasuhiko Kamata skreiv 04. juli 2017 00:57:
> Weblate API requires HTTP client (curl, wget, etc.) and
> JSON encoder/decoder.
>
> Attached my perl script is just for:
>> 1. Download all .po files for a given language.
> $API_KEY and @LANG_CODES should be filled before run (embedded in
> script itself).
>
> Hope it is helpful.

Thank you. It was *very* helpful. Using it, I think I understand how the  
API works, and will be able to download (and hopefully eventually  
reupload) the translations, so that I can easily do offline translation.

--
Karl Ove Hufthammer

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]