ICU üzenet szintaxis

A Crowdin támogatja az ICU üzenet szintaxist, amely segít a nyelvspecifikus írásmódban, a nyelvtanban és a formázás finomságainak kifejezésében a fordításokban.

Strings that are formatted in the ICU Message syntax can have different types of replacements that are called arguments. Minden argumentum kapcsos zárójelbe van zárva, és a bemeneti adatok értékére utal. Az alábbi típusok argumentumait támogatja a Crowdin: szám, dátum, idő, kiválasztás és többes szám.

ICU üzenet szintaxis a Szerkesztőben

Az ICU szintaktikai argumentumai mindig kiemelésre kerülnek a Szerkesztőben, így tudni fogja, hogy a karakterlánc mely részét nem kellene lefordítani. Az argumentumok helyzetét módosíthatja a fordításában a célnyelv természetes szórendjét követve. Van egy előnézeti mód is, amely lehetővé teszi, hogy megtekinthesse, hogy a fordítás hogyan jelenik meg a felhasználói felületen, hogy megbizonyosodjon arról, hogy minden lefordítható elem lefordításra került.

ICU üzenet szintaxis a Szerkesztőben

Többes szám

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”).

A következő rövid címkék használata határozza meg a többes kategóriákat:

  • nulla
  • one (egyes szám)
  • two (kettős)
  • few (paukális)
  • many (a frakciókra is használhatók, ha külön osztályuk van)
  • other (szükséges—általános többes szám—akkor is használatra kerül, ha a nyelv csak egyes számot használ)

In the Editor, you don’t have to manually add or delete plural categories to the translations you are making. Csak kattintson a Forrás másolása lehetőségre, és a forráskód átmásolásra kerül a fordítási mezőbe az aktuális célnyelvnek megfelelő többes kategóriákkal.

Read more about Language Plural Rules.

Plural type

Select Ordinal

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

Kiválasztás

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

Select type

Szám

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

Dátum, idő

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 – an extra information on how the value will be formatted. The following 4 styles can be used: short, medium, long, and full.

Date, Time types

Szintaktikai hibák

Syntax error detection significantly reduces confusion during translation of ICU Message syntax, as the platform automatically identifies potential mistakes in the translation. If a syntax error is found, you’ll see a “Syntax error” message with a suggestion of what should be fixed.

Syntax error detected

Lásd még

Hasznos volt ez a cikk?