Resolve Plural Category
localization.plural_category_resolve
Overview
You send a BCP 47 locale, a decimal string, and CARDINAL or ORDINAL. We return ZERO, ONE, TWO, FEW, MANY or OTHER together with the visible fraction-digit counts that CLDR uses, so 1 and 1.0 can differ. Exponent notation is refused. We do not format the number or compile custom plural rules. A successful call costs 1 execution credit.
CLDR plural operands distinguish 1 from 1.0. A model cannot prove the category from the locale tag and the decimal string alone.
Reliability
Same locale, same decimal string, same type, same ICU/CLDR versions, same answer. LOCALE_INVALID — trigger: the locale is POSIX or ill-formed; retryable: no; next: send a hyphenated BCP 47 tag. NUMBER_FORMAT_INVALID — trigger: exponent notation, empty, or a non-decimal string; retryable: no; next: send 1 or 1.0, not 1e0.
Context footprint
One locale and one number in. A successful call costs 1 execution credit.
When to use it
When you hold a locale and a decimal string and need the CLDR plural bucket.
When you want the formatted phrase, or a locale picked from Accept-Language.
Powered by ICU4J CLDR plural rules (com.ibm.icu:icu4j).
Scope
Non-goals
- Does not format the number or the message
- Does not resolve plural ranges
- Does not compile caller-supplied plural rules
Properties
Capabilities
Cost & billing
Flat rate per invocation
File handling
How we handle your data
What this means
This skill may receive sensitive content, but it does not target sensitive data and returns only a structured non-sensitive result.
Squillify guarantees
- Runs inside Squillify
- This skill runs inside Squillify.
- Payloads are not sent to an external service by this skill.
- Squillify does not permanently store submitted payloads.
- Telemetry records metadata only, not submitted content.
- Submitted payloads are not used for training.
- Submitted payloads are not reviewed by humans.
- This skill does not target sensitive data.
- The response does not contain submitted content.
Your responsibility
Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
| locale | string | Yes | BCP 47 language tag whose CLDR plural rules are used. |
| number | string | Yes | Decimal operand as written, without exponent notation. |
| type | string | No | CARDINAL or ORDINAL; omit it for CARDINAL. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| category | string | Yes | Resolved plural category. |
| canonicalTag | string | Yes | Canonical BCP 47 tag for the supplied locale. |
| type | string | Yes | Applied plural type. |
| integerDigits | integer | Yes | Visible integer-digit count. |
| visibleFractionDigits | integer | Yes | CLDR operand v: how many fraction digits were written, so 1.0 has 1. |
| fractionDigitsWithoutTrailingZeros | integer | Yes | CLDR operand t: visible fraction digits after dropping trailing zeros. |
| _meta | object | Yes | Closed ICU and CLDR versions used for this answer, with icuVersion and cldrVersion strings. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"localization.plural_category_resolve","input":{"locale":"en","number":"1"}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("localization.plural_category_resolve", {"locale":"en","number":"1"});Errors
| Code | HTTP | Retryable | Description |
|---|---|---|---|
| VALIDATION_ERROR | 400 | No | The request payload failed schema validation. |
| UNAUTHORIZED | 401 | No | Missing or invalid API key. |
| SKILL_NOT_ACCESSIBLE | 403 | No | The API key is not granted access to this skill. |
| SKILL_NOT_AVAILABLE_FOR_PLAN | 403 | No | This skill is not included in your current plan. |
| PLAN_ELIGIBILITY_UNAVAILABLE | 503 | Yes | Plan eligibility could not be decided. Retry after backoff. |
| SKILL_NOT_FOUND | 404 | No | The requested skill or version does not exist. |
| TENANT_RATE_LIMITED | 429 | Yes | Request rate limit exceeded. Retry after backoff. |
| QUOTA_EXCEEDED | 429 | Yes | Plan quota exhausted. Retryable once the quota period resets. |
| EXECUTION_TIMEOUT | 504 | Yes | Execution exceeded the allowed time budget. |
| LOCALE_INVALID | 400 | No | The request payload failed this skill's input validation. |
| NUMBER_FORMAT_INVALID | 400 | No | The request payload failed this skill's input validation. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- Does not format the number or the message
- Does not resolve plural ranges
- Does not compile caller-supplied plural rules
- Rendering '1 file' yourself from a template
- Inventing extra plural buckets
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "localization.plural_category_resolve",
"input": {
"locale": "en",
"number": "1"
}
}Examples
English one versus 1.0
{
"locale": "en",
"number": "1"
}{
"canonicalTag": "en",
"_meta": {
"icuVersion": "76.1",
"cldrVersion": "46.0"
},
"type": "CARDINAL",
"category": "ONE",
"integerDigits": 1,
"fractionDigitsWithoutTrailingZeros": 0,
"visibleFractionDigits": 0
}English ordinal two
{
"number": "2",
"type": "ORDINAL",
"locale": "en"
}{
"canonicalTag": "en",
"_meta": {
"icuVersion": "76.1",
"cldrVersion": "46.0"
},
"type": "ORDINAL",
"category": "TWO",
"integerDigits": 1,
"fractionDigitsWithoutTrailingZeros": 0,
"visibleFractionDigits": 0
}Recommended use cases
- Choosing the Arabic plural bucket for 0, 1, 2 and 3
- Picking an English ordinal suffix category for 1, 2, 3 and 4
Avoid for
- Rendering '1 file' yourself from a template
- Inventing extra plural buckets
Related skills
Composable with
Safety & privacy
- Runs without calling any external service.
- Your payloads are never stored permanently.
- Telemetry captures metadata only — never your payload contents.
- We never train models on your payloads.
- No human reviews your payloads.