Skip to content
HALOWERK

Textwerk

plural rules check

Uses Intl.PluralRules (CLDR plural rules as shipped with ICU) to get the cardinal and ordinal categories of the locale with sample numbers. ICU MessageFormat messages are parsed with a full parser; for every plural or selectordinal argument it reports missing categories, categories the locale never uses, explicit =N cases and the required other branch. A gettext Plural-Forms header is parsed with an own C-expression evaluator (no eval) and compared for the integers 0–1000: each gettext index.

POST https://text.halowerk.com/v1/plural-rules-check

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
localestringYesBCP 47 locale, e.g. de, ru, ar, pl, en-GB.
messagestringNoICU MessageFormat message to check.
plural_formsstringNogettext header value, e.g. "nplurals=2; plural=(n != 1);".
Show full input schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "locale"
  ],
  "properties": {
    "locale": {
      "type": "string",
      "maxLength": 35,
      "description": "BCP 47 locale, e.g. de, ru, ar, pl, en-GB."
    },
    "message": {
      "type": "string",
      "maxLength": 20000,
      "description": "ICU MessageFormat message to check."
    },
    "plural_forms": {
      "type": "string",
      "maxLength": 2000,
      "description": "gettext header value, e.g. \"nplurals=2; plural=(n != 1);\"."
    }
  }
}

Open original schema

Published input example

{
  "locale": "ru",
  "message": "{n, plural, one {# файл} other {# файлов}}"
}

Result & documentation

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-11-17 UTC.

More endpoints in this hub

All endpoints in this hub →