Coding
PromptBeginner5 minmarkdown
Markdown Converter
Agent skill for markdown-converter
7
This directory (`src/lang/`) contains the localization logic for the plugin. We utilize **i18next** with a strict type-safety layer to ensure robust translation management.
Sign in to like and favorite skills
This directory (
src/lang/) contains the localization logic for the plugin. We utilize i18next with a strict type-safety layer to ensure robust translation management.
Type Safety is Mandatory:
t() functions must match keys defined in the English locale.English as Source of Truth:
src/lang/locales/en.json is the single source of truth for all translation keys.src/lang/ ├── locales/ │ └── en.json # The master language file. ├── i18n.ts # Initialization logic. └── AGENTS.md # This documentation. src/@types/ └── i18next.d.ts # Type augmentation for i18next.
src/lang/locales/en.json.{ "settings": { "section_title": "General Settings", "save_button": "Save" } }
i18next.t with your new key.import i18next from 'i18next'; const title = i18next.t('settings.section_title');
Argument of type '"wrong.key"' is not assignable to parameter of type ...This means the key you are trying to use does not exist in
en.json.
key.name instead of valueThis usually means
i18next was not initialized before the code ran.
initializeI18n() is awaited in main.ts inside the onload method.initializeI18n() is called before any views or settings tabs are registered/rendered.