bitcoin-maintainer-tools icon indicating copy to clipboard operation
bitcoin-maintainer-tools copied to clipboard

Use new Transifex CLI

Open hebasto opened this issue 3 years ago • 4 comments

The old Transifex Command-Line Tool is considered deprecated (as of January 2022) and will sunset on Nov 30, 2022.

See: https://github.com/transifex/transifex-client/pull/340

A PR with accompanying changes to .tx/config: bitcoin/bitcoin#26321

hebasto avatar Oct 15 '22 17:10 hebasto

For the reference, here are tx help pull outputs:

$ tx --version
0.12.5, py 3.10, x86_64
$ tx help pull
Usage: tx [tx_options] pull [options]

This command pulls all outstanding changes from the remote Transifex server to
the local repository. By default, only the files that are watched by Transifex
will be updated but if you want to fetch the translations for new languages as
well, use the -a|--all option. (Note: new translations are saved in the .tx
folder and require the user to manually rename them and add then in Transifex
using the set_translation command).

Options:
  -h, --help            show this help message and exit
  -l LANGUAGES, --language=LANGUAGES
                        Specify which translations you want to pull (defaults
                        to all)
  -r RESOURCES, --resource=RESOURCES
                        Specify the resource for which you want to pull the
                        translations (defaults to all)
  -a, --all             Fetch all translation files from server (even new
                        ones)
  -s, --source          Force the fetching of the source file (default: False)
  -f, --force           Force download of translations files.
  --skip                Don't stop on errors. Useful when pushing many files
                        concurrently.
  --disable-overwrite   By default transifex will fetch new translations files
                        and replace existing ones. Use this flag if you want
                        to disable this feature
  --minimum-perc=MINIMUM_PERC
                        Specify the minimum acceptable percentage of a
                        translation in order to download it.
  --pseudo              Apply this option to download a pseudo file.
  --mode=MODE           Specify the mode of the translation file to pull (e.g.
                        'reviewed'). See http://bit.ly/pullmode for available
                        values.
  -x, --xliff           Apply this option to download file as xliff.
$ tx --version
TX Client, version=1.4.0
$ tx help pull
NAME:
   tx pull - tx pull [options] [resource_id...]

USAGE:
   tx pull [command options] [arguments...]

OPTIONS:
   --xliff                             Download translation files in xliff format (default: false)
   --json                              Download translation files in json format (default: false)
   --content_encoding value, -e value  The encoding of the file. This can be one of the following:
    'text', 'base64' (default: "text")
   --mode value, -m value  The translation mode of the downloaded file. This can be one of the following:
    'default', 'reviewed', 'proofread', 'translator', 'untranslated',
    'onlytranslated', 'onlyreviewed', 'onlyproofread', 'sourceastranslation' (default: "default")
   --force, -f                  Force the download of the translationsfiles regardless of whether timestamps on the local computer are newer than those on the server (default: false)
   --languages value, -l value  Download specific languages, comma separated Transifex language codes
   --source, -s                 Download source file only (default: false)
   --translations, -t           Downloads translations files (default) (default: false)
   --disable-overwrite, -d      Whether skip existing files (default: false)
   --skip                       Whether to skip on errors (default: false)
   --use-git-timestamps         Compare local files to their Transifex version by their latest commit timestamps. Use this option, for example, when cloning a Git repository. (default: false)
   --branch value               Push to specific branch (use empty argument '' to use the current branch, if it can be determined) (default: "-1")
   --all, -a                    Whether to download all files (default: false)
   --resources value, -r value  Backwards compatibility with old client to fetch resource ids
   --minimum-perc value         Specify the minimum acceptable percentage of a translation mode in order to download it. (default: -1)
   --workers value, -w value    How many parallel workers to use (default: 5)
   --silent                     Whether to reduce verbosity of the output (default: false)
   

hebasto avatar Oct 15 '22 17:10 hebasto

cc @luke-jr @wtogami @jarolrod

hebasto avatar Oct 17 '22 09:10 hebasto

Is the changes to the arguments we call the cli tool required here?

With no changes:

$ ../bitcoin-maintainer-tools/update-translations.py 
It doesn't make sense to use the '--all' or '--language' flag without the '--translation' flag
Error while fetching translations

hebasto avatar Oct 18 '22 06:10 hebasto

If it's demanding "--translation" why the PR does give "--translations"? Is that a typo or is it valid as same?

Edit: messed the 's' around wrongly.

katesalazar avatar Oct 18 '22 08:10 katesalazar

@MarcoFalke @fanquake

As https://github.com/bitcoin/bitcoin/pull/26321 has been merged and backported into 24.x and 23.x, this PR should be merged as well.

hebasto avatar Oct 31 '22 15:10 hebasto