Sintassi messaggi ICU

Crowdin supporta la sintassi dei Messaggi ICU, utilizzata per aiutare a esprimere le sottigliezze dell’ortografia, grammatica e formattazione specifiche della lingua, nelle traduzioni.

Le stringhe formattate nella sintassi del Messaggio ICU possono avere tipi differenti di sostituzioni, dette argomenti. Ogni argomento è racchiuso tra parentesi graffe e si riferisce ad un valore nel dato di input. Gli argomenti dei tipi seguenti sono supportati in Crowdin: numero, dati, orario, selezione e plurale.

ICU Message Syntax in the Editor

Gli argomenti della sintassi ICU sono sempre evidenziati nell’Editor, cosi che tu sappia quale parte della stringa non debba essere tradotta. Cambia la posizione degli argomenti nella traduzione per seguire l’ordine naturale delle parole nella lingua di destinazione. C’è anche una modalità anteprima, che ti consente di vedere come sarà mostrata la traduzione nell’UI per assicurarti che tutti gli elementi traducibili siano tradotti.

Sintassi Messaggio ICU nell'Editor

Plurale

Plural type is used to handle plural category variations, as each language has its own set of plural categories (for example, English has “one” and “other”, while Ukrainian has “one”, “few”, “many”, and “other”).

I seguenti short tag sono usati per determinare le categorie plurale:

  • zero
  • uno (singolare)
  • due (duale)
  • pochi (po’)
  • molti (anche usato per frazioni se hanno una classe separata)
  • altro (richiesto - forma plurale generale - anche usato se la lingua ha solo una forma singola)

In the Editor, you don’t have to manually add or delete plural categories to the translations you are making. Just click Copy Source, and the source string will be copied to the translation field with the number of plural categories right for the current target language.

Read more about Language Plural Rules.

Tipo plurale

Seleziona ordinale

The purpose of the select ordinal type is to choose output based on the ordinal pluralization rules (1st, 2nd, 3rd, etc.) of the current target language. It is very similar to the plural type, except the value is mapped to an ordinal plural category.

Select Ordinal type

Seleziona

Select type is mostly used to represent the right gender-based inflections in the message.

Select type

Numero

The purpose of the number type is to display different number values such as percentage, currency, and decimal numbers independently from the locale conventions for those. This enables adjustment of the message output to the number formats used in different locales. ICU Number Skeletons are also supported.

Number type

Data, Ora

Date and time types show date and time values according to the formats preferred in the specified locales. These types can also have a style – extra information on how the value will be formatted. The following four styles can be used: short, medium, long, and full.

Date, Time types

Errori di Sintassi

Syntax error detection significantly reduces confusion when translating strings with ICU Message syntax, as the platform automatically detects potential translation errors. Se viene trovato un errore di sintassi, visualizzerai un avviso, con un suggerimento su ciò che necessita di essere corretto.

Syntax error detected

Vedi Anche

Questo articolo è stato utile?