Changing the language of your code

Programming guides

Pliro has one canonical language and multiple source-syntax locales. Locale
profiles map keyword spellings during lexing and standard-library aliases during
name resolution. This mapping does not mutate source. There is not a separate
English parser and Dutch parser.

The currently installed exact, lowercase source tags are en and nl. The
compiler selects them from an explicit directive, project/API setting, or CLI
option; it does not auto-detect locale from keyword frequency.

Protected user content

Syntax conversion never translates:

  • user-created identifiers;
  • map member names;
  • text literal contents;
  • ordinary comments.

Runtime display is canonical rather than syntax-localized: text(true),
text(false), and text(none) produce "true", "false", and "none"
even when the source syntax is Dutch.

For example, converting this English syntax:

# language: en
let aantalLevens = 3
say "Hallo wereld", aantalLevens

to Dutch syntax changes language-owned spellings but preserves the identifier
and text:

# taal: nl
laat aantalLevens = 3
zeg "Hallo wereld", aantalLevens

Canonical symbols

Localized built-ins share stable canonical IDs:

Canonical ID English Dutch
core.print say zeg
app.exit exitApp sluitApp
events.started started gestart
events.after after na
events.messageReceived messageReceived berichtOntvangen
events.keyPressed keyPressed toetsGedrukt
events.pointerPressed pointerPressed aanwijzerGedrukt
events.pointerReleased pointerReleased aanwijzerLosgelaten
events.pointerClicked pointerClicked aanwijzerGeklikt
events.pointerX pointerX aanwijzerX
events.pointerY pointerY aanwijzerY
events.broadcast broadcast zendBericht
input.readLine ask vraag
graphics.rectangle rectangle rechthoek
sprites.show showSprite toonSprite
scene3d.box box3D doos3D
scene3d.cylinder cylinder3D cilinder3D
scene3d.texture texture3D textuur3D
scene3d.draw draw3D teken3D
gpio.write writePin schrijfPin

Only aliases from the selected source locale are installed. User declarations
may shadow those aliases.

Symbol-aware translation

Translation changes a standard-library spelling only when name resolution
proves it refers to that built-in. A user-defined function named like a built-in
remains user content. Translation requires source that passes lexical, syntax,
and semantic checks.

pliro translate --to nl program.pliro
pliro translate --to en project.bipli

Translation preserves ordinary comments, strings, whitespace, indentation, and
line endings except for the localized directive, keywords, and resolved
standard-library aliases it intentionally changes.

CLI translation writes translated entry-source text to standard output and
does not modify its input. For .bipli, the compiler checks and translates one
coherent project snapshot, but the CLI still prints only the translated entry
source; it does not rewrite or create a project archive. The desktop IDE can
convert every project source into dirty editor buffers and persists them only
after an explicit Save All.

Syntax and values · Built-ins · Programming guides