GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — python-docs/scripts/pull_translations.sh at main · mnarware/python-docs Expand file tree/ Copy pathpull_translations.shMore file actions executable file ·53 lines (46 loc) · 1.7 KB / Copy pathpull_translations.shFile metadata and controlsexecutable file ·53 lines (46 loc) · 1.7 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 #!/bin/sh # Pull translations files from Transifex for the given language code # # SPDX-License-Identifier: CC0-1.0 # # Usage examples: # # Pull all translations for the given language. # # ./scripts/pull_translations.sh # # Pull translations for "library/os.po" and "faq/library.po" # for the Transifex project set in PYDOC_TX_PROJECT. For instance, # for PYDOC_TX_PROJECT=python-newest, that means pulling the resources # "python-newest.library--os" and "python-newest.faq--library". # # ./scripts/pull_translations.sh library/os.po faq/library.po # set -xeu test -n ${PYDOC_TX_PROJECT+x} test -n ${PYDOC_LANGUAGE+x} rootdir=$(realpath $(dirname $0)/..) language_dir="${PYDOC_LANG_DIR:-$rootdir/cpython/Doc/locales/${PYDOC_LANGUAGE}/LC_MESSAGES}" cd "$language_dir" # If a PO file is provided as input, convert it into Transifex resource # and add it be pulled (instead of pulling all translations files). resources_to_pull="" if [ $# -gt 0 ]; then resources_to_pull="-r" for po_input in $@; do # trim possible filepath part not used for Transifex resources po=$(echo $po_input | sed 's|.*LC_MESSAGES/||') # fail if PO file doesn't exist [ ! -f "$po" ] && (echo "'$po_input' not found."; exit 1;) # convert po filename into transifex resource tx_res=$(echo $po | sed 's|\.po||;s|/|--|g;s|\.|_|g') # append to a list of resources to be pulled resources_to_pull="$resources_to_pull ${PYDOC_TX_PROJECT}.${tx_res}" done fi tx pull -f -l "${PYDOC_LANGUAGE}" ${resources_to_pull} # Drop translation of Python's changelog in python 3.12 or older. minor_version=$(git branch --show-current | sed 's|^3\.||') if [ $minor_version -le 12 ]; then git checkout whatsnew/changelog.po fi |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |