All Spanish is not the same. My software needed to learn that, too.

Language Encounters Center — Q4 2026 update
By Nico Vaidyanathan Hidalgo ·

I started with a convenient premise: all Spanish is the same. My travels through Spain, Mexico, Colombia, Peru, Chile, Argentina, Uruguay, Paraguay, Panama, Costa Rica, Guatemala, and the Dominican Republic taught me how much that premise left out.

I could call all of it Spanish and still miss what made a conversation local. Vocabulary, pronunciation, familiarity, humor: being able to understand someone is only the beginning of knowing how to speak to them. A language selector with one entry for Spanish can conceal the same assumption I carried into those travels.

The Language Encounters Center announcement explained why I wanted missing translations caught during compilation. It also presented an API centered on language enum constants. IANA.SPANISH could say Spanish. It could not express the distinction I wanted between Spanish for Colombia, Chile, Uruguay, and Spanish without a specified region.

Like the follow-up to the Loial work, this is what happened when the initial result left a question unanswered. This time, the question was personal: how do I give the software room for distinctions I had learned to hear?

A language is not a region

BCP 47 language tags already give us the vocabulary. A tag combines a language with optional subtags for details such as script and region. The familiar underscore spelling of a Java locale becomes a hyphen in a language tag:

Locale spellingLanguage tagMeaning
esesSpanish, with no region specified
es_COes-COSpanish for Colombia
es_CLes-CLSpanish for Chile
es_UYes-UYSpanish for Uruguay
es_CHes-CHSpanish for Switzerland

That last row matters: CH is Switzerland; Chile is CL. The IANA registry provides the meanings. Readable types such as Chile.class make the intended choice much easier to see than a two-letter string.

A region is still a coarse description. No country speaks with one voice, and a tag cannot capture a person's entire linguistic identity. But preserving the region gives a translator a choice that a single Spanish constant erased.

Generate the vocabulary; compose the tag

The architectural change is to generate smaller, meaningful types from the registry. The generate-subtags build tool reads the registry snapshot carried by iana-subtags and emits one single-constant enum per registered record. Languages, extended languages, scripts, regions, variants, grandfathered tags, and redundant tags each have their own packages.

Spanish implements Language. Colombia, Chile, and Uruguay implement Region. A @Tag names those types by class literal. Its language member accepts Class<? extends Language>; its region member accepts Class<? extends Region>. Putting a region in the language slot is a compiler error.

There is no need to generate a separate type for every language-and-region combination. es-CO is composed from the registered es and CO subtags; it needs no separate registry entry. One Spanish type can participate in all these tags.

The generation preserves more than names. Registry facts such as descriptions, dates, deprecation, preferred values, macrolanguages, and suppressed scripts become accessors and typed relationships. For example, the generated Spanish type returns es as its subtag and refers to the generated Latin script type. The compiler can check those references when it builds the vocabulary.

This is the architecture I want from code generation: an authoritative data source supplies the repetitive facts; a small handwritten model states what those facts mean; generated code makes them available through ordinary Java types. Updating the registry means replacing the input snapshot and rebuilding. It does not require fetching the registry during translation.

Keep the registry independent of the translator

The current split puts each responsibility in a separate module:

ModuleResponsibility
iana-subtag-registryThe JDK-only registry model: Tag, subtag roles, and registry metadata contracts.
generate-language-subtagsThe generate-subtags build tool that turns the registry into Java source.
iana-subtagsThe generated vocabulary, including Spanish and Colombia.
LEC APIMessage, SupportedLanguages, and TranslationService, using the registry's Tag.
lecRuntime translation through LanguageEncountersCenter, with the generated vocabulary exposed transitively.
enforce-supported-languagesThe annotation processor that checks messages against a module's declared language coverage.

The registry model lives in software.visionary.iana.language.subtag.registry; the generated types live beneath software.visionary.iana.language.subtag.registry.subtags. They can describe language independently of LEC's message translation service.

The registry API and LEC API build with Gradle beneath the Kompuwiz catalog, avoiding a circular dependency. Bob builds the generated vocabulary and LEC above them; generation runs in iana-subtags.

Give the translator somewhere to put the difference

Here is one message with a general Spanish translation and three regional alternatives. The labels make selection visible; they are demonstration text, not claims about regional idiom.

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import software.visionary.iana.language.subtag.registry.Tag;
import software.visionary.iana.language.subtag.registry.subtags.language.Spanish;
import software.visionary.iana.language.subtag.registry.subtags.region.Chile;
import software.visionary.iana.language.subtag.registry.subtags.region.Colombia;
import software.visionary.iana.language.subtag.registry.subtags.region.Uruguay;
import software.visionary.language.encounters.center.Message;

@Message(in = @Tag(language = Spanish.class), value = "Información general")
@Message(in = @Tag(language = Spanish.class, region = Colombia.class),
        value = "Información para Colombia")
@Message(in = @Tag(language = Spanish.class, region = Chile.class),
        value = "Información para Chile")
@Message(in = @Tag(language = Spanish.class, region = Uruguay.class),
        value = "Información para Uruguay")
@Retention(RetentionPolicy.RUNTIME)
@interface Information { }

Calling LanguageEncountersCenter.INSTANCE.translate(Information.class, Locale.forLanguageTag("es-CO")) selects Información para Colombia. With es-CL or es-UY, it selects the corresponding regional message. With es, it selects Información general.

For es-PE, this example has no Peruvian translation. LEC uses the truncation lookup described by RFC 4647 and falls back to es. It does not substitute the Colombian translation. Likewise, a general es request is not served by an es-CO translation alone.

A fallback is a deliberate promise

With the enforcement processor enabled, a module's @SupportedLanguages declaration supplies the tags its messages must serve. The processor compares the subtag types those annotations name. A general Spanish message can satisfy a Colombian Spanish promise.

This is intentionally lenient. It lets a team supply useful Spanish coverage and add regional translations where they matter. It also means a successful build does not prove that every promised region has bespoke wording. The compiler checks coverage. People still choose the right words, register, and tone.

The earlier announcement's broad claim of zero runtime cost needs that same precision. Registry generation happens during the build, and coverage enforcement happens during compilation. Messages have runtime retention, and selecting a translation still happens at runtime. A request outside the available coverage can still fail.

The encounters are the point

My mother, Barbara Hidalgo-Toledo, taught me that language opens a way into other people's lives. Reviving the name of her institute means continuing to learn that lesson, including when it exposes a simplification in my own software.

Spanish.class is useful. So is the ability to say which Spanish I mean. The generated registry gives the code that vocabulary. The people writing and reading the messages give it a reason to exist.

Explore the IANA registry modules and Language Encounters Center, or contact me to build software that takes these distinctions seriously.