Typing of i18n.global.locale
mberrg opened this issue · comments
Reporting a bug?
I'm using vue-i18n 9.2.2, and the typing of 18n.global.locale is string, but is should be ComputedRef<string>?
My setup:
const i18n = createI18n<[GlobalMessageSchema], SupportedLangs>({
legacy: false,
locale: defaultLang,
fallbackLocale: 'en',
messages,
});
console.log(i18n.global.locale);
Typing reported in VS-code of i18n.global.locale
:
ts (property) VueI18n<{}, {}, {}, string, never, string, Composer<{}, {}, {}, string, never, string>>.locale: string
However the variable is clearly a computed ref (from console log):
ComputedRefImpl {dep: undefined, __v_isRef: true, __v_isReadonly: false, _dirty: true, _setter: ƒ, …}
Expected behavior
Typing of i18n.global.locale (and posisble others) should be a computed ref e.g.
(property) VueI18n<{}, {}, {}, string, never, string, Composer<{}, {}, {}, string, never, string>>.locale: ComputedRef<string>
Reproduction
See intro text
System Info
System:
OS: Windows 10 10.0.22621
CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700H
Memory: 17.68 GB / 31.70 GB
Binaries:
Node: 18.15.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
npm: 9.5.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Spartan (44.22621.1413.0), Chromium (111.0.1661.41)
Internet Explorer: 11.0.22621.1
npmPackages:
@vitejs/plugin-vue: ^4.1.0 => 4.1.0
vite: ^4.2.0 => 4.2.0
vite-plugin-eslint: ^1.8.1 => 1.8.1
vite-tsconfig-paths: ^4.0.7 => 4.0.7
vue: ^3.0.0 => 3.2.47
vue-gtag: ^2.0.1 => 2.0.1
vue-i18n: ^9.2.2 => 9.2.2
vue-router: ^4.0.0 => 4.1.6
Screenshot
No response
Additional context
No response
Validations
- Read the Contributing Guidelines
- Read the Documentation
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion
- The provided reproduction is a minimal reproducible example of the bug.