Make recipes translatable

Created on 21 November 2024, about 1 month ago

Problem/Motivation

Well this is obviously some low-hanging fruit. (Kidding, this is going to be very complicated.)

Currently recipes are not translatable. They may have hard-coded strings that are presented to users (e.g., during input collection), or saved in config in some way. These strings needs to be translatable. But there's no way to do it; we have no mechanism to extract translatable strings from recipe.yml files, and even if we did, we don't necessarily have a mechanism for shipping recipe translations, or displaying/using those translations when they're needed.

This needs to be figured out.

Proposed resolution

Honestly, I have no idea. @alexpott said he had some thoughts. But I expect the approach(es) we take to be interesting, and to evolve over time.

Remaining tasks

TBD.

User interface changes

TBD.

Introduced terminology

TBD.

API changes

TBD.

Data model changes

Probably none, but who knows.

Release notes snippet

TBD.

Feature request
Status

Active

Version

11.0 🔥

Component

recipe system

Created by

🇺🇸United States phenaproxima Massachusetts

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @phenaproxima
  • 🇺🇸United States phenaproxima Massachusetts
  • 🇭🇺Hungary Gábor Hojtsy Hungary

    At least YAML 1.2 allows for tags that allow us to define custom data types https://yaml.org/spec/1.2.2/#tags, then we would need to respond to the !translate type with wrapping it in translation at runtime and extracting it statically. Not sure how wide support for this is in tools.

    key: 12
    another: !translate This text will be translated
    
  • 🇭🇺Hungary Gábor Hojtsy Hungary

    The default (failsafe) schema of YAML does not include !translate, however

    All nodes with the “!” non-specific tag are resolved, by the standard convention, to “tag:yaml.org,2002:seq”, “tag:yaml.org,2002:map” or “tag:yaml.org,2002:str”, according to their kind.

    per https://yaml.org/spec/1.2.2/#failsafe-schema -- which I understand that tools are expected to resolve custom tags as sequence, map or string based on which syntax was used above them. So !translate followed by a string would/should be understood as string when applied to a string by a YAML tool following the failsafe schema.

  • 🇺🇸United States thejimbirch Cape Cod, Massachusetts

    Adding related issues.

  • 🇪🇸Spain penyaskito Seville 💃, Spain 🇪🇸, UTC+2 🇪🇺

    We'll need to figure out too:

    * Potx support
    * l.d.org support: we need to run potx on general projects that include a recipe.yml.

Production build 0.71.5 2024