mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	i18n: Update tooling from Transifex to Weblate.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							d1995687c9
						
					
				
				
					commit
					f22680da31
				
			@@ -1,10 +0,0 @@
 | 
			
		||||
#!/usr/bin/env bash
 | 
			
		||||
 | 
			
		||||
# See https://zulip.readthedocs.io/en/latest/translating/internationalization.html
 | 
			
		||||
# for background on this subsystem.
 | 
			
		||||
 | 
			
		||||
set -e
 | 
			
		||||
set -x
 | 
			
		||||
 | 
			
		||||
./manage.py makemessages --locale=en
 | 
			
		||||
tx push -s -r zulip.djangopo,zulip.translationsjson "$@"
 | 
			
		||||
@@ -6,8 +6,8 @@
 | 
			
		||||
set -e
 | 
			
		||||
set -x
 | 
			
		||||
 | 
			
		||||
./manage.py makemessages --all
 | 
			
		||||
tx pull -a -f --mode=translator --minimum-perc=5 "$@"
 | 
			
		||||
git fetch weblate
 | 
			
		||||
git cherry-pick weblate/main ^upstream/main || true
 | 
			
		||||
 | 
			
		||||
# Normalize to Unicode Normalization Form C.
 | 
			
		||||
files="$(find locale -type f -name '*.json' -o -name '*.po')"
 | 
			
		||||
 
 | 
			
		||||
@@ -419,9 +419,6 @@ def main(options: argparse.Namespace) -> NoReturn:
 | 
			
		||||
    # Install shfmt.
 | 
			
		||||
    run_as_root([*proxy_env, "tools/setup/install-shfmt"])
 | 
			
		||||
 | 
			
		||||
    # Install transifex-cli.
 | 
			
		||||
    run_as_root([*proxy_env, "tools/setup/install-transifex-cli"])
 | 
			
		||||
 | 
			
		||||
    # Install tusd
 | 
			
		||||
    run_as_root([*proxy_env, "tools/setup/install-tusd"])
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,41 +0,0 @@
 | 
			
		||||
#!/usr/bin/env bash
 | 
			
		||||
#
 | 
			
		||||
# As of 07 December 2022, per https://pkgs.org/download/transifex-cli, only
 | 
			
		||||
# Void Linux and KaOS package the new Go-based Transifex CLI officially, so our
 | 
			
		||||
# safest bet is to pull the binaries from GitHub Releases directly for now.
 | 
			
		||||
#
 | 
			
		||||
# These binaries do not dynamically link to anything, and thus should work on
 | 
			
		||||
# glibc and musl (Alpine, Void, etc.) systems equally well.
 | 
			
		||||
set -euo pipefail
 | 
			
		||||
 | 
			
		||||
version=1.6.17
 | 
			
		||||
arch="$(uname -m)"
 | 
			
		||||
 | 
			
		||||
case $arch in
 | 
			
		||||
    x86_64)
 | 
			
		||||
        tarball="tx-linux-amd64.tar.gz"
 | 
			
		||||
        sha256=002dec5b9e71248a7e6a0808118e9da940205828d5a33ce88e04bb57a967164d
 | 
			
		||||
        ;;
 | 
			
		||||
 | 
			
		||||
    aarch64)
 | 
			
		||||
        tarball="tx-linux-arm64.tar.gz"
 | 
			
		||||
        sha256=c380ed9aece5d34316aa0fe2e5afa0633553656f98909f88cb72609e2fa13153
 | 
			
		||||
        ;;
 | 
			
		||||
esac
 | 
			
		||||
 | 
			
		||||
check_version() {
 | 
			
		||||
    out="$(tx --version)" && [ "$out" = "TX Client, version=${version}" ]
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
if ! check_version 2>/dev/null; then
 | 
			
		||||
    set -x
 | 
			
		||||
    tmpdir="$(mktemp -d)"
 | 
			
		||||
    trap 'rm -r "$tmpdir"' EXIT
 | 
			
		||||
    cd "$tmpdir"
 | 
			
		||||
    curl_opts=(-fLO --retry 3)
 | 
			
		||||
    curl "${curl_opts[@]}" "https://github.com/transifex/cli/releases/download/v${version}/${tarball}"
 | 
			
		||||
    sha256sum -c <<<"$sha256 $tarball"
 | 
			
		||||
    tar -xzf "$tarball" --no-same-owner tx
 | 
			
		||||
    install -Dm755 tx /usr/local/bin/tx
 | 
			
		||||
    check_version
 | 
			
		||||
fi
 | 
			
		||||
		Reference in New Issue
	
	Block a user