Cardinalities
All numbers use CARDINALITY_OTHER; no value selects a different form.
Example: 2일.
Cardinality Ranges
Every range resolves to CARDINALITY_OTHER because every endpoint is CARDINALITY_OTHER. Cardinality.forRange(...) therefore cannot select a different form.
Ordinalities
All ordinal numbers use ORDINALITY_OTHER; no value selects a different form.
Example: 2번째 길목에서 우회전하세요..
Language-Specific Examples
These examples show how Lokalized models grammatical choices and translation behavior that commonly affect Korean application copy. Each example identifies the Lokalized language forms and other library features it uses.
Counters for books and machines
Passing Classifier.BOUND selects the book noun and 권 counter, while Classifier.MACHINE selects the computer noun and 대 counter; the application supplies the count separately.
Language references: National Institute of Korean Language - 권 for counting books, National Institute of Korean Language - 대 for counting machines
Lokalized forms used: Classifier
Sample localized strings file
{ "I bought {{count}} items.": { "translation": "{{object}} {{count}}{{counter}} 샀어요.", "placeholders": { "object": { "value": "classifier", "translations": { "CLASSIFIER_BOUND": "책을", "CLASSIFIER_MACHINE": "컴퓨터를" } }, "counter": { "value": "classifier", "translations": { "CLASSIFIER_BOUND": "권", "CLASSIFIER_MACHINE": "대" } } } } }
Usage and expected results
Locale locale = Locale.forLanguageTag("ko"); Strings strings = Strings.withFallbackLocale(locale) .localizedStringSupplier(() -> LocalizedStringLoader.loadFromFilesystem(Paths.get("strings"))) .localeSupplier((matcher) -> matcher.bestMatchFor(locale)) .build(); assertEquals("책을 3권 샀어요.", strings.get( "I bought {{count}} items.", Map.of("count", 3, "classifier", Classifier.BOUND) )); assertEquals("컴퓨터를 2대 샀어요.", strings.get( "I bought {{count}} items.", Map.of("count", 2, "classifier", Classifier.MACHINE) ));
Three addressee speech levels
This application maps Formality.CASUAL to unraised 해체, Formality.INFORMAL to polite but nonformal 해요체, and Formality.FORMAL to formal-polite 하십시오체. These are three practical UI choices, not a complete model of Korean honorification or all six addressee speech levels.
Language references: National Institute of Korean Language - addressee honorification and speech levels, National Institute of Korean Language - forms and examples for 고맙다
Lokalized forms used: Formality
Sample localized strings file
{ "Thank you.": { "translation": "{{thanks}}", "placeholders": { "thanks": { "value": "formality", "translations": { "FORMALITY_CASUAL": "고마워.", "FORMALITY_INFORMAL": "고마워요.", "FORMALITY_FORMAL": "고맙습니다." } } } } }
Usage and expected results
Locale locale = Locale.forLanguageTag("ko"); Strings strings = Strings.withFallbackLocale(locale) .localizedStringSupplier(() -> LocalizedStringLoader.loadFromFilesystem(Paths.get("strings"))) .localeSupplier((matcher) -> matcher.bestMatchFor(locale)) .build(); assertEquals("고마워.", strings.get( "Thank you.", Map.of("formality", Formality.CASUAL) )); assertEquals("고마워요.", strings.get( "Thank you.", Map.of("formality", Formality.INFORMAL) )); assertEquals("고맙습니다.", strings.get( "Thank you.", Map.of("formality", Formality.FORMAL) ));
Addendum: Language Form Rules
The language form expressions above are specified by Unicode Technical Standard #35 and use the following notation:
nabsolute value of the source number (integer and decimals)iinteger digits ofnvnumber of visible fraction digits inn, with trailing zeroswnumber of visible fraction digits inn, without trailing zerosfvisible fractional digits inn, with trailing zerostvisible fractional digits inn, without trailing zerosc/ecompact decimal exponent operands used by some CLDR compact-number rules