docs: where translations.xml lives, and translations of included projects

Merged
LA
4d ago
+16-4

The docs never said where the translations file lives, or that a product has only one. In the Editor and the CLI, translations come only from translations.xml at the root of the main project.

Changes

  • docs/syntax/translations.mdx: new "The translations file" section.
    • Translations come only from one translations.xml at the project root.
    • A translations.xml in a sub-folder is an error, and a translations file under any other name is not loaded.
    • A product has one set of translations: an included project cannot have a translations.xml, and all strings go into the root project's file.
  • docs/syntax/project.mdx:
    • "LVGL Pro doesn't enforce a folder structure" now names the exception: the three XML files at the root. project.xml and globals.xml are required, translations.xml is optional, and each must sit at the root under exactly that name.
    • The included-projects section says an included project cannot have a translations.xml.

Where this comes from in the Editor

  • File type: translations.xml is recognized by name, only at the project root (lved-xml-schema workspace-index-builder.ts).
  • Root-only check: the same name in a sub-folder fails validation with "must be located at the project root" (lved-project-layout validation.ts).
  • Code export: reads only <project>/translations.xml.
  • Not yet released: lvgl-private/editor#1708 adds validation errors for a translations.xml in an included project, and for a root file with a <translations> root under another name.

šŸ¤– Generated with Claude Code