HOMEii Music Flow uses flat JavaScript dictionaries in src/localization/. English is the fallback language, so every new language file should start by copying the English keys. Version 5.7.1 ships with English, Hebrew, Spanish, French, Italian, Lithuanian, and Simplified Chinese.
- Create a new language file in
src/localization/, for examplefr.js. - Copy the full contents of
src/localization/en.jsinto the new file. - Translate only the string values. Do not rename, remove, or reorder keys unless you also update the source code.
- Open
src/localization/index.jsand import the new file, for example:
import fr from "./fr.js";- Register the dictionary in
DICTIONARIESand add a display option inLANGUAGE_OPTIONS:
export const DICTIONARIES = Object.freeze({ en, fr, he });
export const LANGUAGE_OPTIONS = Object.freeze([
{ value: "auto", label: "Auto" },
{ value: "en", label: "English" },
{ value: "fr", label: "French" },
{ value: "he", label: "Hebrew" },
]);- If the language is right-to-left, add its code to
RTL_LANGUAGE_CODESinsrc/localization/index.js. - Run
npm test,npm run build, andnode scripts/release.mjslocally. - Test the card by setting
language: frin the card config. If a key is missing, the card will fall back to English.
Use TRANSLATING.md as the glossary and context reference while translating.