Skip to main content

Module translate

Module translate 

Source
Expand description

Bidirectional keyword translation via canonical AST (T38, T39).

§T38: poet translate — bidirectional translation

Translates VibeScript source from one locale to another by:

  1. Parsing the source (any locale’s keywords are normalised to canonical English by the parser).
  2. Re-emitting the source with the target locale’s keywords.

This preserves the AST structure — only keywords change. Identifiers, strings, and comments are preserved. The translation is not a re-authoring; it is a keyword substitution.

§T39: Tier-2 identifiers via Aura rdfs:label

Tier-2 identifiers are multi-lingual labels for identifiers that preserve meaning. An IRI like clinic:hasCondition can have an rdfs:label in multiple locales: “has condition” (en), “有病情” (zh). These labels are metadata, not separate identifiers.

Reference: docs/vibescript-full-impl-PLAN.md §8.8 T38, T39.

Structs§

KeywordTranslator
A keyword translator — maps canonical English keywords to a target locale’s keywords.
Tier2Label
A tier-2 identifier label — an rdfs:label for an IRI in a specific locale (T39).
Tier2Registry
A registry of tier-2 identifier labels (T39).

Functions§

translate_source
Translate source from any locale to a target locale.