best_engine_ai_helper.i18n module
i18n — shared loader for locales/i18n.yaml, the human-language source of truth.
Every GUI-visible string and every model-facing prompt template used by this
package is authored once, in locales/i18n.yaml (package root), under two
top-level namespaces:
guiUI strings keyed by a stable semantic name, each with a value per supported locale (
fr/en). Consumed bybest_engine_ai_helper.gui.promptsModel-facing prompt templates (system / user text sent to the local LLM or VLM by
best_engine_ai_helper.ralph,best_engine_ai_helper.validate_llm, andbest_engine_ai_helper.validate_vlm), authored in a single language declared atmeta.model_prompt_locale(English here) rather than translated — seelocales/i18n.yaml’s header and CODING.md section 21.3.3 for why prompt wording is not localized like GUI copy.
This module owns parsing and caching the file; it does not know what any individual key means to its caller.
- best_engine_ai_helper.i18n.gui_strings()[source]
Return the
guinamespace: semantic key ->{locale: text}.- Returns:
One entry per GUI string; each value maps a locale code to its text.
- Return type:
Examples
>>> "hero_title" in gui_strings() True
- best_engine_ai_helper.i18n.meta()[source]
Return the
metablock: locale defaults and the model-prompt language.- Returns:
Keys
default_locale,supported_locales,model_prompt_locale.- Return type:
Examples
>>> sorted(meta().keys()) ['default_locale', 'model_prompt_locale', 'supported_locales']
- best_engine_ai_helper.i18n.prompt(key, field='user')[source]
Return one field of a model-facing prompt template.
- Parameters:
- Returns:
The raw template text, with any
{placeholder}markers intact for the caller to fill viastr.format.- Return type:
- Raises:
KeyError – If
keyorfieldis not present — a missing prompt must fail loudly rather than silently send an empty string to a model.
Examples
>>> prompt("writing_charter_excerpt", "text").startswith("Rule 5") True