Lightweight scoped translator that prepends a key prefix and delegates to the parent LocaleManager.
WHY: Large apps need feature-scoped translations to avoid key collisions and to keep components focused on their own namespace.
const authT = i18n.ns('auth'); authT.t('login.title') // resolves to i18n.t('auth.login.title') const loginT = authT.ns('login'); loginT.t('title') // resolves to i18n.t('auth.login.title') Copy
const authT = i18n.ns('auth'); authT.t('login.title') // resolves to i18n.t('auth.login.title') const loginT = authT.ns('login'); loginT.t('title') // resolves to i18n.t('auth.login.title')
Optional
Lightweight scoped translator that prepends a key prefix and delegates to the parent LocaleManager.
WHY: Large apps need feature-scoped translations to avoid key collisions and to keep components focused on their own namespace.
Example