Per configurare un’integrazione del Sistema di Controllo della Versione, specifica quali file sorgente dovrebbero esser tradotti e come Crowdin dovrebbe strutturare i file tradotti nella tua repository.
Once you selected your repository and branch for translation, the next step you need to do is to configure the selected branch. Click to open the Branch Configuration dialog and start the configuration. In the Branch Configuration dialog, you can either load the existing configuration file stored on your repository or create a new configuration from scratch.
To load the existing configuration file stored on your repository, follow these steps:
The configuration will be displayed in the Branch Configuration dialog. You can use it as is or modify it if needed.
To create a new configuration file that will be used by the integration, specify the preferred name and click Continue in the Branch Configuration dialog.
Then specify the source and translated file paths using patterns and placeholders listed below. In the right panel, you can preview the structure of the source files that will be uploaded for translation and the structure of the translated files based on the specified paths.
Once you finish setting up the configuration for the selected branch and save the changes, the configuration file will be saved to the root of the translation branch in your repository.
* (asterisco)
Represents any character in the file or directory name. Se specifici un “*.json” includerà tutti i file come “messages.json”, “about_us.json” e qualsiasi cosa finisca con “.json”.
** (asterisco doppio)
Corrispondi ricorsivamente ogni stringa (includendo le sub-directory). Nota che puoi usare ** sia nei modelli di traduzione che in quelli di origine. When using ** in the translation pattern, it will always contain a sub-path from the source for a certain file. Per esempio, puoi usare l’origine: ‘/en/**/*.po per caricare tutti i file *.po ricorsivamente in Crowdin. Il modello di traduzione sarà ‘/%two_letters_code%/**/%original_file_name%’.
? (punto interrogativo)
Corrisponde ad ogni carattere singolo.
[set]
Abbina ogni carattere singolo in una serie. Si comporta esattamente come i set di caratteri in Regexp, incluso il set di negazione ([^a-z]).
\ (backslash)
Esce dal prossimo metacarattere.
Usa i segnaposto per identificare dove saranno posti i file tradotti e come saranno nominati:
Nome | Descrizione |
---|---|
%original_file_name% | Nome file originale |
%original_path% | Prendi i nomi delle cartelle madri nel progetto di Crowdin per creare il percorso del file nel bundle risultante |
%file_extension% | Estensione file originale |
%file_name% | Nome file senza estensione |
%language% | Nome della lingua (es. Ucraino) |
%two_letters_code% | Codice linguistico ISO 639-1 (es., uk) |
%three_letters_code% | Codice linguistico ISO 639-2/T (es., ukr) |
%locale% | Locale (es., uk-UA) |
%locale_with_underscore% | Locale (es., uk_UA) |
%android_code% | Identificativo Locale di Android usato per denominare le cartelle "values-" |
%osx_code% | Identificatore Locale OS X usato per denominare le directory ".lproj" |
%osx_locale% | L'OS X locale usato per denominare le risorse di traduzione (es., uk, zh-Hans, zh_HK) |
Se alcuni file non dovrebbero esser tradotti, clicca Aggiungi schema ignorato, specifica lo schema rispettivo per questi file e Crowdin non caricherà i file specifici per la traduzione.
Se il tuo progetto usa i nomi personalizzati per le cartelle locali, puoi usare la Mappatura della Lingua per mappare le tue lingue perché siano riconosciute da Crowdin.
Per aggiungere la mappatura di una lingua, segui questi passi:
You can specify the scheme of your spreadsheet file in the Scheme field. To form the scheme for your CSV or XLS/XLSX file, use the following constants:
identifier
– Column contains string identifiers. source_phrase
– Column contains source strings. source_or_translation
– Column contains source strings, but the same column will be filled with translations when the file is exported. When uploading existing translations, the values from this column will be used as translations. translation
– Column contains translations. context
– Column contains comments or context information for the source strings. max_length
– Column contains max.length limit values for the translations of the strings. labels
– Column contains labels for the source strings. none
– Column that will be skipped on import.
Esempio di schema: identifier,source_phrase,context,fr,de,it,uk (Codici Linguistici).
If a spreadsheet contains the translations for multiple target languages, select Multilingual spreadsheet. If you don’t want to translate the text stored in the first row, select Import first line as a header.
Traduci Contenuto | Select to translate texts stored inside the tags. |
Traduci Attributi | Select to translate tag attributes. |
Segmentazione Contenuto | Select to split the source XML file's content into shorter text segments. Nota: Quando la segmentazione dei Contenuti è abilitata, il caricamento della traduzione è gestito da una tecnologia di machine learning sperimentale. |
Elementi Traducibili | Questo è un insieme di stringhe, dove ogni elemento è l'elemento Xpath a Dom che dovrebbe essere importato. Sample path: /path/to/node or /path/to/attribute[@attr] |
I parametri seguenti non possono essere configurati online:
preserve_hierarchy
- salva la struttura della cartella in Crowdindest
- ti consente di specificare il nome di un file in Crowdintipo
- ti consente di specificare il tipo di un file in Crowdinaggiorna_opzione
- mantiene le traduzioni e mantiene o rimuove le approvazioni dalle stringhe modificate durante l’aggiornamento del filecommit_message
- additional commit message that can include Git tagsesporta_lingue
- esporta traduzioni per le lingue specificateOnce you save the online configuration, a crowdin.yml
file will be saved to the root of the configured branch in your repository. Puoi modificare questo file manualmente per aggiungere i parametri necessari.
Leggi di più sul file di configurazione.
Clicca Salva per vedere in anteprima la configurazione creata.
Click Add File Filter if you have various file groups with different configurations.
If several branches in the project share the same configuration, and the same filters should be applied to them, select Apply filters to all translatable branches.
Clicca Salva per salvare la configurazione creata.
Quando la configurazione è salvata, i file localizzabili inizieranno a esser caricati al tuo progetto di Crowdin.