Korean 한국어

BCP 47 language tag: ko

Lokalized supports cardinality, cardinality range, and ordinality rules for Korean.

Additional modeled concepts for Korean: classifiers and counters; formality and register.

Korean is most often spoken in South Korea, North Korea, China, the United States, and Japan.

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
ko.json Localized Strings File (Korean)
{
  "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
ko.json Localized Strings File (Korean)
{
  "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:

  • n absolute value of the source number (integer and decimals)
  • i integer digits of n
  • v number of visible fraction digits in n, with trailing zeros
  • w number of visible fraction digits in n, without trailing zeros
  • f visible fractional digits in n, with trailing zeros
  • t visible fractional digits in n, without trailing zeros
  • c/e compact decimal exponent operands used by some CLDR compact-number rules