Anii anii kagɩja blo

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

Anii is most often spoken in Benin and Togo.

Cardinalities

  • CARDINALITY_ZERO

    Matches n = 0

    Example Integers: 0

    Example Decimals: 0.0, 0.00, 0.000, 0.0000

  • CARDINALITY_ONE

    Matches n = 1

    Example Integers: 1

    Example Decimals: 1.0, 1.00, 1.000, 1.0000

  • CARDINALITY_OTHER

    Matches all other values

    Example Integers: 2, 17, 100, 1000, 10000, 100000, 1000000, …

    Example Decimals: 0.1, 0.9, 1.1, 1.7, 10.0, 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 blo locale data.

Sample localized strings file
blo.json Localized Strings File (Anii)
{
  "Cardinality.MinimalPair": {
    "commentary": "Demonstrates every CLDR cardinal category defined for this locale.",
    "translation": "{{cardinalityExample}}",
    "placeholders": {
      "cardinalityExample": {
        "value": "cardinalityValue",
        "translations": {
          "CARDINALITY_ZERO": "baa ʊshilé {{formattedCardinalityValue}}",
          "CARDINALITY_ONE": "ʊshilé {{formattedCardinalityValue}}",
          "CARDINALITY_OTHER": "ɩshilé {{formattedCardinalityValue}}"
        }
      }
    }
  }
}
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("blo");

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_ZERO
Number zeroCardinalityValue = 0;
String zeroFormattedCardinalityValue = numberFormat.format(zeroCardinalityValue);

assertEquals(Cardinality.ZERO, Cardinality.forNumber(zeroCardinalityValue, locale));

// Expected: baa ʊshilé 0
assertEquals("baa ʊshilé " + zeroFormattedCardinalityValue, strings.get(
  "Cardinality.MinimalPair",
  Map.of(
    "cardinalityValue", zeroCardinalityValue,
    "formattedCardinalityValue", zeroFormattedCardinalityValue
  )
));

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

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

// Expected: ʊshilé 1
assertEquals("ʊshilé " + oneFormattedCardinalityValue, strings.get(
  "Cardinality.MinimalPair",
  Map.of(
    "cardinalityValue", oneCardinalityValue,
    "formattedCardinalityValue", oneFormattedCardinalityValue
  )
));

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

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

// Expected: ɩshilé 2
assertEquals("ɩshilé " + otherFormattedCardinalityValue, 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

  • ORDINALITY_ZERO

    Matches i = 0

    Example Integers: 0

  • ORDINALITY_ONE

    Matches i = 1

    Example Integers: 1

  • ORDINALITY_FEW

    Matches i = 2,3,4,5,6

    Example Integers: 2, 6

  • ORDINALITY_OTHER

    Matches all other values

    Example Integers: 7, 22, 100, 1000, 10000, 100000, 1000000, …

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