İçeriğe geç

ICU İletisi Sözdizimi

Crowdin, çevirilerde dile özgü yazım, dilbilgisi ve biçimlendirme inceliklerini ifade etmeye yardımcı olmak için kullanılan ICU İleti sözdizimini destekler.

Strings formatted in the ICU Message syntax can have different types of replacements called arguments. Each argument is enclosed in single curly braces (e.g., {variable}) and refers to a value in the input data. Please note that using double curly braces (e.g., {{variable}}) is not supported and will cause syntax errors. Crowdin’de şu tür bağımsız değişkenler desteklenir: number, date, time, select ve plural.

ICU sözdizimi bağımsız değişkenleri her zaman Düzenleyicide vurgulanır, böylece dizginin hangi bölümünün çevrilmemesi gerektiğini bilirsiniz. Hedef dildeki doğal kelime sırasını izlemek için çevirideki bağımsız değişkenlerin konumunu değiştirin. Ayrıca, tüm çevrilebilir öğelerin çevrildiğinden emin olmak için çevirinin kullanıcı arayüzünde nasıl görüntüleneceğini görmenizi sağlayan bir önizleme kipi de vardır.

Düzenleyicide ICU İleti sözdizimi

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

You {itemCount, plural,
=0 {have no projects}
one {have # project}
other {have # projects}
}.

Çoğul kategorilerini belirlemek için aşağıdaki kısa etiketler kullanılır:

  • zero
  • one (tekil)
  • two (çift)
  • few (paucal)
  • many (ayrı bir sınıfa sahiplerse kesirler için de kullanılır)
  • other (zorunlu— genel çoğul biçim — dilin sadece tekil bir biçimi varsa da kullanılır)

Düzenleyicide, yaptığınız çevirilere el ile çoğul kategorileri eklemek veya silmek zorunda değilsiniz. 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.

In some cases, you may have a single string that contains multiple nouns that each need to be pluralized independently, for example, “You have X book(s) and Y pen(s).”

ICU handles this by allowing you to nest plural arguments inside each other.

{bookCount, plural,
one {You have # book and {penCount, plural,
one {# pen}
other {# pens}
}}
other {You have # books and {penCount, plural,
one {# pen}
other {# pens}
}}
}

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. Değerin bir sıralı çoğul kategorisine eşlenmesi dışında çoğul türe çok benzer.

Congrats! It's your {year, selectordinal,
one {#st}
two {#nd}
few {#rd}
other {#th}
} subscription anniversary!

Select type is used to choose an output based on a string variable. It is most commonly used to represent the right gender-based inflections in the message.

{gender, select,
male {He uses}
female {She uses}
other {They use}
} Crowdin.

This type is useful for any situation where the translation changes based on a specific keyword. Regardless of the use case, the ICU standard requires that you always include an other clause. This clause provides a necessary fallback in case the variable doesn’t match any of the specified options.

The purpose of the number type is to display different number values such as percentage, currency, and decimal numbers independently of the locale conventions for those. Bu, ileti çıktısının farklı yerel bölgelerde kullanılan sayı biçimlerine ayarlanmasını sağlar. ICU Number Skeletons are also supported.

The app price is {price, number, ::currency/USD} with {discount, number, percent} discount.

Date ve time - tarih ve saat türleri, belirtilen yerel bölgelerde tercih edilen biçimlere göre tarih ve saat değerlerini gösterir. Bu türlerin bir stili de olabilir – değerin nasıl biçimlendirileceği hakkında fazladan bilgiler. Şu dört stil kullanılabilir: short, medium, long ve full.

Your meeting is scheduled for {dateValue, date, long} at {timeValue, time, short} AM.

Platform olası çeviri hatalarını otomatik olarak algıladığından, sözdizimi hatası saptama, dizgileri ICU İleti sözdizimi ile çevirirken karışıklığı önemli ölçüde azaltır. Eğer bir sözdizimi hatası bulunursa, nelerin düzeltilmesi gerektiğine dair bir öneri içeren bir bildirim göreceksiniz.

You can also use external tools to verify your ICU syntax, for example, the Online ICU Message Editor.

Saptanan sözdizimi hatası
Bu sayfa faydalı oldu mu?