Crowdin Scripts/it

Gestire le traduzioni per FreeCAD
Per gestire le traduzioni FreeCAD utilizza un servizio di traduzione di terzi chiamato Crowdin.

In  ci sono 3 script che sono usati per gestire i file di traduzione:
 * 1)   (github source)
 * 2)   (github source)
 * 3)   (github source)

Questi script vengono eseguiti dalla radice della directory. Nota: Affinché questi script funzionino, è necessario che la chiave API Crowdin di FreeCAD sia inserita nel loro file. (Per motivi di sicurezza, disponibile solo per le persone con diritti di amministratore sul progetto FreeCAD)

updatets.py
Questo script crea i file .ts nella directory locale.

updatecrowdin.py
Questo script trasferisce le modifiche dalla directory locale  a Crowdin. Lo script attualmente supporta 4 argomenti:


 * stampa uno stato delle traduzioni
 * aggiorna Crowdin alla versione corrente dei file .ts trovati nel codice sorgente
 * crea un nuovo pacchetto scaricabile su crowdin con tutte le stringhe tradotte
 * scarica l'ultima versione

updatefromcrowdin.py
Questo script estrae le modifiche da crowdin alla directory locale.

To send latest strings to crowdin

 * Only tested on linux
 * You need a .credentials file in your /home/YourUser directory. That file is a simple text file containing only one line, which is the API key that you get on https://crowdin.com/project/freecad/settings#api (only for admins)
 * Make sure your repo is clean (git pull, git stash if needed)
 * cd /path/to/freecad-source-code/src/Tools
 * python updatets.py (will fill all the .ts files found in the source with the lastest strings)
 * python updatecrowdin.py update (will send the ts files to crowdin. Crowdin will only update strings that are new)
 * cd ../.. (go back to the source code root folder)
 * git checkout . (undo all the changes to the .ts files, no reason to commit them right now as they are still untranslated)

To merge latest translations from crowdin

 * Only tested on linux
 * You need a .credentials file in your /home/YourUser directory. That file is a simple text file containing only one line, which is the API key that you get on https://crowdin.com/project/freecad/settings#api (only for admins)
 * Make sure your repo is clean (git pull, git stash if needed)
 * cd /path/to/freecad-source-code/src/Tools
 * python updatecrowdin.py build (will create a zip on crowdin side with all the files, can take a while.. This step can also be done on the crowdin website)
 * python updatecrowdin.py download (will download a freecad.zip file in this directory)
 * mv freecad.zip ~ move the zip file to your home dir, to avoid accidentally committing it later)
 * (optional) edit updatefromcrowdin.py script and check that the default_languages contain all the ones you want (basically all that are at more than 50%)
 * python updatefromcrowdin.py -z /home/YourUser/freecad.zip
 * cd ../.. (go back to the source code root folder)
 * if something went wrong or you are unsure, clean everything with git checkout.
 * if everything looks ok (git status), commit with git add . && git commit
 * Create a PR on FreeCAD

To generate a translation file from the website

 * Clone the homepage repo
 * cd /path/to/FreeCAD-homepage
 * xgettext --from-code=UTF-8 -o lang/homepage.pot *.php
 * Update the "homepage.po" on crowdin website manually, using the lang/homepage.pot file

To update the translations of the website

 * Get the freecad.zip file either by downloading it from the crowdin website or following instructions above (python updatecrowdin.py download)
 * cd /path/to/FreeCAD-homepage
 * Make sure your repo is clean (git pull, git stash if needed)
 * python updatefromcrowdin.py -z /path/to/freecad.zip
 * if something went wrong or you are unsure, clean everything with git checkout.
 * if everything looks ok (git status), commit with git add . && git commit
 * Create a PR on FreeCAD-Homepage
 * After the PR is merged, one of the admins will ftp push to the webhost

Related

 * Localizzazione
 * Crowdin Administration
 * Release process