Maltese Malti

BCP 47 language tag: mt

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

Maltese is most often spoken in Malta.

Cardinalities

  • CARDINALITY_ONE

    Matches n = 1

    Example Integers: 1

    Example Decimals: 1.0, 1.00, 1.000, 1.0000

  • CARDINALITY_TWO

    Matches n = 2

    Example Integers: 2

    Example Decimals: 2.0, 2.00, 2.000, 2.0000

  • CARDINALITY_FEW

    Matches n = 0 or n % 100 = 3..10

    Example Integers: 0, 3, 10, 103, 109, 1003, …

    Example Decimals: 0.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 103.0, 1003.0, …

  • CARDINALITY_MANY

    Matches n % 100 = 11..19

    Example Integers: 11, 19, 111, 117, 1011, …

    Example Decimals: 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 111.0, 1011.0, …

  • CARDINALITY_OTHER

    Matches all other values

    Example Integers: 20, 35, 100, 1000, 10000, 100000, 1000000, …

    Example Decimals: 0.1, 0.9, 1.1, 1.7, 10.1, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …

Cardinality example

This localized strings example uses complete, page-local CLDR minimal-pair patterns to demonstrate every Cardinality category defined for the locale. Minimal-pair text contrasts grammatical forms; it is language-reference data, not reusable application copy.

Source: Unicode CLDR 48.2 mt locale data.

Sample localized strings file
mt.json Localized Strings File (Maltese)
{
  "Cardinality.MinimalPair": {
    "commentary": "Demonstrates every CLDR cardinal category defined for this locale.",
    "translation": "{{cardinalityExample}}",
    "placeholders": {
      "cardinalityExample": {
        "value": "cardinalityValue",
        "translations": {
          "CARDINALITY_ONE": "jum",
          "CARDINALITY_TWO": "jumejn",
          "CARDINALITY_FEW": "{{formattedCardinalityValue}} ijiem",
          "CARDINALITY_MANY": "{{formattedCardinalityValue}}-il jum",
          "CARDINALITY_OTHER": "{{formattedCardinalityValue}} jum"
        }
      }
    }
  }
}
Usage and expected results

The Java code passes each raw number for cardinality selection and formats its display value separately with NumberFormat.

Locale locale = Locale.forLanguageTag("mt");

Strings strings = Strings.withFallbackLocale(locale)
  .localizedStringSupplier(() -> LocalizedStringLoader.loadFromFilesystem(Paths.get("strings")))
  .localeSupplier((matcher) -> matcher.bestMatchFor(locale))
  .build();

NumberFormat numberFormat = NumberFormat.getNumberInstance(locale);

// Raw numbers select language forms; NumberFormat produces the display values

// CARDINALITY_ONE
Number oneCardinalityValue = 1;
String oneFormattedCardinalityValue = numberFormat.format(oneCardinalityValue);

assertEquals(Cardinality.ONE, Cardinality.forNumber(oneCardinalityValue, locale));

assertEquals("jum", strings.get(
  "Cardinality.MinimalPair",
  Map.of(
    "cardinalityValue", oneCardinalityValue,
    "formattedCardinalityValue", oneFormattedCardinalityValue
  )
));

// CARDINALITY_TWO
Number twoCardinalityValue = 2;
String twoFormattedCardinalityValue = numberFormat.format(twoCardinalityValue);

assertEquals(Cardinality.TWO, Cardinality.forNumber(twoCardinalityValue, locale));

assertEquals("jumejn", strings.get(
  "Cardinality.MinimalPair",
  Map.of(
    "cardinalityValue", twoCardinalityValue,
    "formattedCardinalityValue", twoFormattedCardinalityValue
  )
));

// CARDINALITY_FEW
Number fewCardinalityValue = 0;
String fewFormattedCardinalityValue = numberFormat.format(fewCardinalityValue);

assertEquals(Cardinality.FEW, Cardinality.forNumber(fewCardinalityValue, locale));

// Expected: 0 ijiem
assertEquals(fewFormattedCardinalityValue + " ijiem", strings.get(
  "Cardinality.MinimalPair",
  Map.of(
    "cardinalityValue", fewCardinalityValue,
    "formattedCardinalityValue", fewFormattedCardinalityValue
  )
));

// CARDINALITY_MANY
Number manyCardinalityValue = 11;
String manyFormattedCardinalityValue = numberFormat.format(manyCardinalityValue);

assertEquals(Cardinality.MANY, Cardinality.forNumber(manyCardinalityValue, locale));

// Expected: 11-il jum
assertEquals(manyFormattedCardinalityValue + "-il jum", strings.get(
  "Cardinality.MinimalPair",
  Map.of(
    "cardinalityValue", manyCardinalityValue,
    "formattedCardinalityValue", manyFormattedCardinalityValue
  )
));

// CARDINALITY_OTHER
Number otherCardinalityValue = 20;
String otherFormattedCardinalityValue = numberFormat.format(otherCardinalityValue);

assertEquals(Cardinality.OTHER, Cardinality.forNumber(otherCardinalityValue, locale));

// Expected: 20 jum
assertEquals(otherFormattedCardinalityValue + " jum", strings.get(
  "Cardinality.MinimalPair",
  Map.of(
    "cardinalityValue", otherCardinalityValue,
    "formattedCardinalityValue", otherFormattedCardinalityValue
  )
));

Cardinality Ranges

No explicit CLDR cardinality-range mapping is defined for this language. Cardinality.forRange(...) therefore falls back to the ending cardinality for every range.

Ordinalities

All ordinal numbers use ORDINALITY_OTHER; no value selects a different form.

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