Date: prev next · Thread: first prev next last
2019 Archives by date, by thread · List index


Þann 4.10.2019 16:06, skrifaði Christian Lohmaier:
Hi Sophie, *,

On Fri, Oct 4, 2019 at 1:36 PM sophi <sophi@libreoffice.org> wrote:
Le 04/10/2019 à 12:33, Sveinn í Felli a écrit :
Þann 4.10.2019 10:16, skrifaði Christian Lohmaier:
   c) for those projects really wanting to upload all at once: use the
weblate client program and use a script to automate the upload using
the API:
https://docs.weblate.org/en/weblate-3.8/wlc.html

This is interesting. I guess that those who are susceptible to use batch
upload/download are mostly language coordinators with some scripting
experience. We could of course share our scripts here.

That's a good idea :) maybe best would be to store them in the 10n part
of the wiki?

As I like perl better than python, I wrote a helper script that will
take care of downloading multiple files
https://gist.github.com/cloph/76d4c22f0e0d8c81c55a8acab98c3311

copying the builtin help here for reference.

Usage:
     weblate-download.pl is used to download multiple po files for a project
     from TDF's weblate server. Downloading will replicate the directory
     structure as used in the repository. Note that anonymous access is
     restricted to 100 requests/day.

     Examples (use --help to see all options):

     "weblate-download.pl -t /tmp/pofiles -p libo_help-master -l fr"
     "weblate-download.pl -k -l vec -f dictionaries"

Options:
     All options names are case-insensitive and can be abbreviated as long as
     the prefix is still unique

     --target=/path/to/save/to
         the target directory (will be created if it doesn't exist already) to
         use for the download

         defaults to /var/tmp/weblate-download

     --project=project
         the project to process - either "libo_ui-master" or "libo_help-master"
         defaults to libo_ui-master

     --language=lang
         the language to download, required.

     --filter=componenteprefix
         optional option to restrict the download to only those components that
         start with "componentprefix"

     --verbose
         optional switch to output more progress information

     --keyfile[=fileWithApiKey]
         optional switch to enable authenticated API access. If "--keyfile" is
         specified without a pathname, it defaults to ~/.config/tdf-weblate

         If the option is not specified, anonymous access is used (restricted
         to 100 requests/day) The file should contain just your personal API
         key (found in weblate → profile-icon → settings → API access)

     --overwrite
         optional switch to overwrite already existing files. If not specified,
         download will be skipped for existing files.

         Use at your own risk.

     --help
         show this help

ciao
Christian


Hi Christian,

Was trying to get your script running:
$ perl weblate-download.pl -t /tmp/pofiles -p libo_ui-master -l is
Got this back: "Too late for "-CSDA" option at weblate-download.pl line 1."

Tried to remove the -CSDA options from the file and got this:
Error while downloading componentlist: 500 Can't connect to weblate.documentfoundation.org:443 aborting... if the message is about too many requests, consult --help for keyfile option

Aha, a missing API-key, right?

Also, whatever I've tried in the wlc-client points to a missing API-key.

So, two questions:

1. the key in question, is it the SSH-RSA key listed at 'About Weblate / Weblate keys' in <https://weblate.documentfoundation.org/keys/> ?

2. where can I find simple example on how to install the key? Is it done through the wlc-client or just by throwing a file with the key contents into my .ssh folder?

Bestest regards,
Sveinn í Felli

--
To unsubscribe e-mail to: l10n+unsubscribe@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/l10n/
Privacy Policy: https://www.documentfoundation.org/privacy

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.