Manx Gaelg

BCP 47 language tag: gv

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

Manx is most often spoken in Isle of Man.

Cardinalities

  • CARDINALITY_ONE

    Matches v = 0 and i % 10 = 1

    Example Integers: 1, 11, 21, 31, 41, 51, 61, 71, 101, 1001, …

  • CARDINALITY_TWO

    Matches v = 0 and i % 10 = 2

    Example Integers: 2, 12, 22, 32, 42, 52, 62, 72, 102, 1002, …

  • CARDINALITY_FEW

    Matches v = 0 and i % 100 = 0,20,40,60,80

    Example Integers: 0, 20, 40, 60, 80, 100, 120, 140, 1000, 10000, 100000, 1000000, …

  • CARDINALITY_MANY

    Matches v != 0

    Example Decimals: 0.0, 1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …

  • CARDINALITY_OTHER

    Matches all other values

    Example Integers: 3, 10, 13, 19, 23, 103, 1003, …

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 gv locale data.

Sample localized strings file
gv.json Localized Strings File (Manx)
{
  "Cardinality.MinimalPair": {
    "commentary": "Demonstrates every CLDR cardinal category defined for this locale.",
    "translation": "{{cardinalityExample}}",
    "placeholders": {
      "cardinalityExample": {
        "value": "cardinalityValue",
        "translations": {
          "CARDINALITY_ONE": "{{formattedCardinalityValue}} thunnag/vuc/ooyl",
          "CARDINALITY_TWO": "{{formattedCardinalityValue}} hunnag/vuc/ooyl",
          "CARDINALITY_FEW": "{{formattedCardinalityValue}} thunnag/muc/ooyl",
          "CARDINALITY_MANY": "{{formattedCardinalityValue}} dy hunnagyn/dy vucyn/dy ooylyn",
          "CARDINALITY_OTHER": "{{formattedCardinalityValue}} thunnagyn/mucyn/ooylyn"
        }
      }
    }
  }
}
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("gv");

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));

// Expected: 1 thunnag/vuc/ooyl
assertEquals(oneFormattedCardinalityValue + " thunnag/vuc/ooyl", 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));

// Expected: 2 hunnag/vuc/ooyl
assertEquals(twoFormattedCardinalityValue + " hunnag/vuc/ooyl", 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 thunnag/muc/ooyl
assertEquals(fewFormattedCardinalityValue + " thunnag/muc/ooyl", strings.get(
  "Cardinality.MinimalPair",
  Map.of(
    "cardinalityValue", fewCardinalityValue,
    "formattedCardinalityValue", fewFormattedCardinalityValue
  )
));

// CARDINALITY_MANY
Number manyCardinalityValue = new java.math.BigDecimal("0.0");
NumberFormat manyCardinalityValueFormat = NumberFormat.getNumberInstance(locale);
manyCardinalityValueFormat.setMinimumFractionDigits(1);
manyCardinalityValueFormat.setMaximumFractionDigits(1);
String manyFormattedCardinalityValue = manyCardinalityValueFormat.format(manyCardinalityValue);

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

// Expected: 0.0 dy hunnagyn/dy vucyn/dy ooylyn
assertEquals(manyFormattedCardinalityValue + " dy hunnagyn/dy vucyn/dy ooylyn", strings.get(
  "Cardinality.MinimalPair",
  Map.of(
    "cardinalityValue", manyCardinalityValue,
    "formattedCardinalityValue", manyFormattedCardinalityValue
  )
));

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

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

// Expected: 3 thunnagyn/mucyn/ooylyn
assertEquals(otherFormattedCardinalityValue + " thunnagyn/mucyn/ooylyn", 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