Skip to main content

Squillify development is paused indefinitely. Read why, and discover what this experiment achieved. Read the story

MicroSkills Reference

Normalize Locale

localization.locale_normalize

ProductionEngine wrapper (Class A)Deterministicstrictinstantv1.0.0
No network

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

Note
Canonicalizes one BCP 47 locale identifier through ICU and optionally maximizes it.

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

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

normalization

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call1 credit

File handling

Accepts file_refProduces file_refMax input1 KB

How we handle your data

Sensitive input, safe output
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.

Read the Microskill Data Handling Policy

Input schema

FieldTypeRequiredDescription
localestringYesOne BCP 47 language tag.
includeLikelySubtagsbooleanNoWhether to add CLDR likely subtags; omit it for false.

Output schema

FieldTypeRequiredDescription
canonicalTagstringYesBCP 47 language tag.
languagestringYesISO language subtag.
scriptstringNoISO script subtag when present.
regionstringNoISO region subtag when present.
variantsarrayYesFrom 0 through 8 variant subtags in declared order; empty when ICU recorded none.
extensionsstringNoBCP 47 extensions when present.
maximizedTagstringNoBCP 47 language tag.
_metaobjectYesClosed ICU and CLDR versions used for this canonicalization.

API contract

POST /v1/execute
curl
curl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"localization.locale_normalize","input":{"locale":"EN-us"}}'
Integrations
TypeScript SDK
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

CodeHTTPRetryableDescription
VALIDATION_ERROR400NoThe request payload failed schema validation.
UNAUTHORIZED401NoMissing or invalid API key.
SKILL_NOT_ACCESSIBLE403NoThe API key is not granted access to this skill.
SKILL_NOT_AVAILABLE_FOR_PLAN403NoThis skill is not included in your current plan.
PLAN_ELIGIBILITY_UNAVAILABLE503YesPlan eligibility could not be decided. Retry after backoff.
SKILL_NOT_FOUND404NoThe requested skill or version does not exist.
TENANT_RATE_LIMITED429YesRequest rate limit exceeded. Retry after backoff.
QUOTA_EXCEEDED429YesPlan quota exhausted. Retryable once the quota period resets.
EXECUTION_TIMEOUT504YesExecution exceeded the allowed time budget.
LOCALE_INVALID400NoThe request payload failed this skill's input validation.

Other limits

LimitValue
Recommended inline bytes32 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)

Request bodyjson
{
  "skillKey": "localization.locale_normalize",
  "input": {
    "locale": "EN-us"
  }
}

Examples

Case and separator canonicalization

Inputjson
{
  "locale": "EN-us"
}
Expected outputjson
{
  "language": "en",
  "region": "US",
  "canonicalTag": "en-US",
  "variants": [],
  "_meta": {
    "icuVersion": "76.1",
    "cldrVersion": "46.0"
  }
}
Tip
ICU canonicalizes language to lowercase and region to uppercase

Likely subtags for a language-only tag

Inputjson
{
  "locale": "zh",
  "includeLikelySubtags": true
}
Expected outputjson
{
  "language": "zh",
  "_meta": {
    "icuVersion": "76.1",
    "cldrVersion": "46.0"
  },
  "canonicalTag": "zh",
  "maximizedTag": "zh-Hans-CN",
  "variants": []
}
Tip
CLDR likely subtags expand zh to Simplified Chinese in China
  • 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

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.

Tags

normalizationi18nlocalebcp47