Normalize Locale
localization.locale_normalize
Overview
You send a BCP 47 language tag. We return the ICU canonical form, the language, and any script, region, variants and extensions ICU decomposed. includeLikelySubtags is false unless you opt in, in which case maximizedTag is the CLDR likely-subtag expansion. POSIX identifiers, language detection and locale negotiation are out of scope. Every answer carries the ICU and CLDR versions that produced it.
The same locale arrives as en_US, EN-us and en-US-u-nu-latn. One ICU canonical form, with versions on the wire, is what later i18n skills can share.
Reliability
Same tag, same includeLikelySubtags flag, same ICU/CLDR versions, same answer. Pin _meta when you compare stored tags across upgrades. LOCALE_INVALID — trigger: the value is empty, POSIX (underscore or charset), or not a well-formed BCP 47 tag; retryable: no; next: send a hyphenated tag such as en-US, not en_US.UTF-8.
Context footprint
One language tag in. A successful call costs 1 execution credit.
When to use it
When you hold a BCP 47 tag and need the canonical language, script and region parts.
When you need to pick among available locales, or detect language from content.
Powered by ICU4J locale canonicalization (com.ibm.icu:icu4j).
Scope
Non-goals
- Does not negotiate a locale against an Accept-Language list
- Does not detect the language of content, and does not accept POSIX locale strings
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 | One BCP 47 language tag. |
| includeLikelySubtags | boolean | No | Whether to add CLDR likely subtags; omit it for false. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| canonicalTag | string | Yes | BCP 47 language tag. |
| language | string | Yes | ISO language subtag. |
| script | string | No | ISO script subtag when present. |
| region | string | No | ISO region subtag when present. |
| variants | array | Yes | From 0 through 8 variant subtags in declared order; empty when ICU recorded none. |
| extensions | string | No | BCP 47 extensions when present. |
| maximizedTag | string | No | BCP 47 language tag. |
| _meta | object | Yes | Closed ICU and CLDR versions used for this canonicalization. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"localization.locale_normalize","input":{"locale":"EN-us"}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("localization.locale_normalize", {"locale":"EN-us"});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. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- Does not negotiate a locale against an Accept-Language list
- Does not detect the language of content, and does not accept POSIX locale strings
- Picking the best available locale for a request (later localization.locale_negotiate)
- Guessing language from a paragraph of text
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "localization.locale_normalize",
"input": {
"locale": "EN-us"
}
}Examples
Case and separator canonicalization
{
"locale": "EN-us"
}{
"language": "en",
"region": "US",
"canonicalTag": "en-US",
"variants": [],
"_meta": {
"icuVersion": "76.1",
"cldrVersion": "46.0"
}
}Likely subtags for a language-only tag
{
"locale": "zh",
"includeLikelySubtags": true
}{
"language": "zh",
"_meta": {
"icuVersion": "76.1",
"cldrVersion": "46.0"
},
"canonicalTag": "zh",
"maximizedTag": "zh-Hans-CN",
"variants": []
}Recommended use cases
- Turning EN-us or i-klingon into the canonical BCP 47 tag before storage
- Adding likely script and region when a caller opts into includeLikelySubtags
Avoid for
- Picking the best available locale for a request (later localization.locale_negotiate)
- Guessing language from a paragraph of text
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.