Crowdin CLI egy parancssori eszköz, amely lehetővé teszi a lokalizációs források és Crowdin projekt közötti szinkronizációt és kezelést:
Ez az alkalmazás több platformú és terminálban fut a Linux alapú és MacOS X operációs rendszereken, vagy a parancssori ablakban a Windowson. Továbbá nyílt forráskódú, a forráskódja elérhető itt: GitHub.
upload
parancshozdownload
parancshozEllenőrizze, hogy telepítve van-e a Java 8 vagy újabb verziója. Írja be a java -version
parancsot a terminálba (parancssorba a Windowson), hogy ellenőrizze a Java verzióját. Például, java version “1.8.0_212” azt jelenti, hogy a Java 8 Update 212 telepítve van.
Ha nincs Java telepítve, töltse le az Oracle weboldaláról.
A Crowdin CLI telepítése homebrew használatával (a macOS csomagkezelője):
$ brew tap crowdin/crowdin
$ brew install crowdin@3
Töltse le és futtassa a Windows telepítőt.
Az összes csomagunkat a Crowdin Signing Key segítségével írjuk alá.
Töltse le, majd telepítse a nyilvános aláíró kulcsot:
wget -qO - https://artifacts.crowdin.com/repo/GPG-KEY-crowdin | sudo apt-key add -
A következő parancs segítségével hozza létre a crowdin.list fájlt az /etc/apt/sources.list.d könyvtárban:
echo "deb https://artifacts.crowdin.com/repo/deb/ /" > /etc/apt/sources.list.d/crowdin.list
És az adattára készen áll a használatra. A Crowdin CLI Debian csomagot a következővel telepítheti:
sudo apt-get update && sudo apt-get install crowdin3
A Crowdin CLI manuális telepítéséhez:
$ wget https://artifacts.crowdin.com/repo/deb/crowdin3.deb -O crowdin.deb $ sudo dpkg -i crowdin.deb
Az összes csomagunkat a Crowdin Signing Key segítségével írjuk alá.
Töltse le, majd telepítse a nyilvános aláíró kulcsot:
rpm --import https://artifacts.crowdin.com/repo/GPG-KEY-crowdin
Telepítés az RPM adattárból
Hozzon létre egy crowdin.repo nevű fájlt az /etc/yum.repos.d könyvtárban, amely tartalmazza a következőt:
[crowdin] name=Crowdin repository baseurl=https://artifacts.crowdin.com/repo/rpm gpgcheck=1 gpgkey=https://artifacts.crowdin.com/repo/GPG-KEY-crowdin enabled=1
És az adattára készen áll a használatra. Ezután a Crowdin CLI-t az alábbi parancsok valamelyikével telepítheti:
sudo yum install crowdin3 sudo dnf install crowdin3
A Crowdin CLI manuális telepítéséhez:
$ wget https://artifacts.crowdin.com/repo/rpm/crowdin3.rpm -O crowdin.rpm $ sudo rpm -U crowdin3.rpm
Visit the Crowdin CLI package page on Arch Linux user repository.
Installing from the NPM repository
npm i -g @crowdin/cli
A Crowdin CLI-t önálló Java alkalmazásként lehet telepíteni.
./install-crowdin-cli.sh
parancsot rendszergazdai (sudo) jogokkal ahhoz, hogy a crowdin
parancs a terminálban felvételre kerüljönsetup-crowdin.bat
szkriptet a crowdin
parancs Parancssorba való adásáhozCrowdin CLI provides a possibility to work with a proxy server. Each time you run a command, Crowdin CLI checks whether the operating system has the configured environment variables.
Supported environment variables:
HTTP_PROXY_HOST
– the name or the IP address of the host at which the proxy server is located HTTP_PROXY_PORT
– the port used by the proxy server for listening HTTP_PROXY_USER
– the username used for authentication on a proxy server HTTP_PROXY_PASSWORD
– the password used for authentication on a proxy server
Használja a következő módszert az alkalmazás futtatásához:
$ crowdin
Alternatív módszer:
$ java -jar crowdin-cli.jar
A Crowdin CLI használatához konfigurációs fájl szükséges. We recommend to name it crowdin.yml. A következő parancs futtatásával hozhatja létre:
$ crowdin init
Amikor a terminálban a Crowdin CLI-t hívja, akkor a projekt gyökérkönyvtárában kell lennie. Ellenkező esetben a --config
opcióval meg kell adnia egy konfigurációs fájl elérési utat:
$ crowdin upload sources --config /path/to/your/config/file
Futtassa a crowdin help
parancsot a további parancsok megismeréséhez.
Minta konfigurációs fájl:
"project_id": "projectId" #open project settings and go to API section
"api_token": "personal-access-token" #open profile settings and go to API & SSO > New Token > create Token
"base_path": "." #path to your project directory on a local machine
"base_url": "https://crowdin.com"
"preserve_hierarchy": true
"files": [
{
"source": "/en/**/*.json", #source files filter
"translation": "/%two_letters_code%/**/%original_file_name%" #where translations are stored
}
]
A Crowdin CLI konfigurációjával kapcsolatos további információkért, nézze meg a Konfigurációs fájl cikket.
Miután létrehozta a konfigurációs fájlt, készen áll a Crowdin CLI használatára, a honosítási források kezelésére és a fájlszinkronizálás automatizálására.
A súgó információ megjelenítéséhez:
$ crowdin help
A vázlat konfigurációs fájl létrehozásához:
$ crowdin init
A konfigurációs fájl általános hibáinak ellenőrzéséhez:
$ crowdin lint
A Crowdinba feltöltött fájlok listájának megjelenítéséhez:
$ crowdin list project
A forrásfájlok Crowdinba való feltöltéséhez:
$ crowdin upload sources
Egy fájl konfiguráció nélküli feltöltéséhez:
$ crowdin upload sources -s path/to/your/file -t file/export/pattern -T personal-token -i project-id --base-url https://crowdin.com
Használjon helyőrzőket a megfelelő változók elhelyezésére.
A Crowdinba feltöltésre kerülő fájlok listájának megjelenítéséhez:
$ crowdin upload sources --dryrun
A meglévő fordítások Crowdinba való feltöltéséhez (a fordítások szinkronizálásra kerülnek):
$ crowdin upload translations
Az upload
parancs részletes információinak megjelenítéséhez:
$ crowdin upload --help
To add existing or new labels to the source strings:
$ crowdin upload sources -s "..." -t "..." --label "main-menu" --label "application"
Read more about Labels.
To download source files from Crowdin:
$ crowdin download sources
A Crowdin legújabb fordításainak letöltéséhez:
$ crowdin download
A konkrét nyelv (nyelvkódok) legfrissebb fordításainak letöltéséhez:
$ crowdin download -l {language_code}
A Crowdin legújabb fordítások listájának megjelenítéséhez:
$ crowdin download --dryrun
A download
parancs részletes információinak megjelenítéséhez:
$ crowdin download --help
There is a possibility to download the latest translations from Crowdin to the specified target file (Android XML or iOS Strings) regardless of the source file format in Crowdin.
To download the latest translations from Crowdin to the target file:
$ crowdin download targets <name>
Add the targets
section to your crowdin.yml
configuration file with the following structure:
targets: [
{
name: "android",
files: [
{
file: "targets/%two_letters_code%/android.xml",
sources: [
"file.xlsx"
],
labels: [
"mobile",
"ui"
]
}
]
}
]
name
- the name of your target. Will be used for downloading specific targets.files
- the section that describes the resulting files that appear in your system after the download. Each target supports the downloading of multiple files.file
- the resulting file pattern. Currently, only Android XML (.xml) and iOS Strings (.strings) file formats are supported.sources
- the source files in Crowdin, whose translations should be exported. Alternatively, you can specify either branches
or directories
.labels
- Labels for the strings filtering (Optional).As a result, the file.xlsx
translations (filtered by labels mobile
and ui
) will be downloaded to targets/%two_letters_code%/android.xml
file.
There is a possibility to configure and download pseudo-localized translation files.
To download an archive with pseudo-localized translation files:
$ crowdin download --pseudo
Add the pseudo_localization
section to your crowdin.yml
configuration file with the following structure:
pseudo_localization: {
length_correction: 25,
prefix: "",
suffix: "",
character_transformation: "cyrillic"
}
Read more about Pseudo-localization.
Nincs szükség különleges parancs futtatására verzió ágak létrehozására, ha a szinkronizálási eszközt használja. A verzió ág automatikusan létrejön a fájlok feltöltésekor.
A forrásfájlok megadott verzió-ágba való feltöltéséhez:
$ crowdin upload sources -b {branch_name}
A fordítások megadott verzió-ágba való feltöltéséhez:
$ crowdin upload translations -b {branch_name}
A fordítások megadott verzió-ágból való letöltéséhez:
$ crowdin download -b {branch_name}
Lehetősége van a következő fájltípusok kezelésére (hozzáadás, szerkesztés, törlés): CSV, RESX, JSON, Android XML, iOS strings, PROPERTIES.
Az aktuális projektben található forrás-karakterláncok listáját a következő módon jelenítheti meg (a --verbose
opcióval további információt kaphat):
$ crowdin string list
Új forrás-karakterlánc létrehozásához (a -h
opcióval az összes parancs lehetőséget megtekintheti):
$ crowdin string add
A forrás-karakterlánc törlése:
$ crowdin string delete
A már meglévő forrás-karakterlánc szerkesztése:
$ crowdin string edit
A következő parancsok segítségével ellenőrizheti a projekt fordítási és lektorálási folyamatát.
A fordítási és lektorálási folyamat egyidejű megjelenítéséhez:
$ crowdin status
A fordítási folyamat megjelenítéséhez:
$ crowdin status translation
A lektorálási folyamat megjelenítéséhez:
$ crowdin status proofreading
A --verbose
opció használatával további információkat jeleníthet meg.
There is a possibility to upload and download glossaries.
To show a list of glossaries (use the --verbose
option to show term lists for glossaries):
$ crowdin glossary list
To upload glossary from a file (in TBX file format) either to the specified glossary or to a new one:
$ crowdin glossary upload
To upload glossary from a file (in CSV or XLS/XLSX file format) either to the specified glossary or to a new one:
$ crowdin glossary upload <file> --scheme term_en=0 --scheme description_en=1 --scheme partOfSpeech_en=2 --first-line-contains-header
To form the scheme for your CSV or XLS/XLSX glossary file, use the following constants:
term_{language_code}
– Column contains terms. {column_number}
– Column number. Numbering starts from 0. description_{language_code}
– Column contains term descriptions. partOfSpeech_{language_code}
– Column contains part of speech for terms. where {language_code}
– Language code for the specified language. See the full list of Supported Languages. --first-line-contains-header
– used to skip the import of the first row (header).
To download glossary to a file (in TBX, CSV, or XLS/XLSX file format) from the specified glossary:
$ crowdin glossary download
There is a possibility to upload and download translation memories.
To show a list of translation memories:
$ crowdin tm list
To upload translation memory from a file (in TMX file format) either to the specified translation memory or to a new one:
$ crowdin tm upload
To upload translation memory from a file (in CSV or XLS/XLSX file format) either to the specified translation memory or to a new one:
$ crowdin tm upload <file> --scheme en=0 --scheme fr=1 --first-line-contains-header
To form the scheme for your CSV or XLS/XLSX translation memory file, use the following constants:
{language_code}
– Column contains translation memory elements for the specified language. {column_number}
– Column number. Numbering starts from 0. where {language_code}
– Language code for the specified language. See the full list of Supported Languages. --first-line-contains-header
– Used to skip the import of the first row (header).
To download translation memory to a file (in TMX, CSV, or XLS/XLSX file format) from the specified translation memory:
$ crowdin tm download