Skip to main content

Module locale

Module locale 

Source
Expand description

Keyword locale tables — multi-lingual keyword views (T37).

VibeScript keywords are canonically English. This module provides locale tables that map keywords from other languages to the canonical English forms. The parser accepts any locale’s keyword and normalises it to the canonical English form.

§Design

  • Locale identifies a language locale (e.g. en, zh).
  • LocaleTable maps locale-specific keywords to canonical forms.
  • LocaleRegistry holds tables for all supported locales.
  • The parser can use LocaleRegistry::resolve to check if a token is a keyword in any locale and get the canonical form.

§Ship en plus one second locale as proof of pipeline

English (en) is the canonical locale. Chinese (zh) is shipped as the second locale to prove the pipeline works. Adding more locales is a matter of adding more tables.

Reference: docs/vibescript-full-impl-PLAN.md §8.8 T37.

Structs§

Locale
A language locale identifier (e.g. “en”, “zh”).
LocaleRegistry
A registry of locale tables.
LocaleTable
A keyword locale table — maps locale-specific keywords to canonical English forms.

Constants§

ENGLISH_KEYWORDS
The canonical English keyword list.

Functions§

arabic_table
The Arabic locale table.
chinese_table
The Chinese locale table.
english_table
The English locale table (canonical — keywords map to themselves).
french_table
The French locale table.
german_table
The German locale table.
hindi_table
The Hindi locale table.
japanese_table
The Japanese locale table.
spanish_table
The Spanish locale table.