FreeCAD: master f5b6c206

Author Committer Branch Timestamp Parent
hyarion hyarion master 2021-02-27 11:45:48 master dd4874d2
Changeset Tools: updatecrowdin.py rewrite to support new api

Crowdin has depreciated their old api and will shut it down completely
in december 2021.

What's new:
 * rewritten in Python 3 (drops support for discontinued Python 2)
 * uses Crowdin's api v2
 * runs on vanilla Python 3, (no external modules)
 * automatically adds new translation from the src directory
 * supports api token to be specified in an environment variable
   (Makes GitHub integration easier in the future)
 * requires project id to be explicitly set with an environment variable
   (Makes testing safer)

The api token can be set either in ~/.crowdin-freecad-token similar to
how the old api key was set, or by specifying it in an environment
variable. The later has been added to make it easier with GitHub-Crowdin
integration in the future.

The requirement to explicitly set CROWDIN_PROJECT_ID has been introduced
to avoid accidentally using the main Crowdin project while testing the
script.

The script has been tested on Python versions 3.7, 3.8 and 3.9.

Co-authored-by: Mattias Pierre <github@mattiaspierre.com>
mod - src/Tools/updatecrowdin.py Diff File