Pattern
- Component code imports
useI18nand the section locale index. - Locale lookup falls back in this order: current locale,
en,zh-cn. - Components use
t('section.key')for scalar labels andmessages.sectionfor structured arrays such as tabs, terms, diagrams, and summary flows. - Interpolated labels use braces, for example
t('adderChain.bitButton', \{ bit \}).
Example:
js
import { useI18n } from '../../../composables/useI18n.js'
import { computerFundamentalsLocale } from '../../../locales/computer-fundamentals/index.js'
const { t, messages } = useI18n(computerFundamentalsLocale)