Open
Description
Reporting a bug?
AvailableLocales option (via createI18n
) is not passed to the global instance without messages
option.
but createI18n
is accepted availableLocales option by type of VueI18nOptions
.
Is it correct behavior?
Expected behavior
AvailableLocales option is passed to the global instance
Reproduction
Code
import { createI18n } from 'vue-i18n'
{
const i18n = createI18n({
legacy: false,
locale: 'ja',
messages: {
en: { hoge: 'hoge' },
ja: { hoge: 'ほげ' }
}
})
console.log("with messages: " + i18n.global.availableLocales)
}
{
const i18n = createI18n({
legacy: false,
locale: 'ja',
availableLocales: ['en','ja']
})
console.log("without messages: " + i18n.global.availableLocales)
}
Result
"with messages: en,ja"
"without messages: ja"
Link
System Info
System:
OS: Linux 5.10 Ubuntu 22.04 LTS 22.04 LTS (Jammy Jellyfish)
CPU: (8) x64 Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz
Memory: 11.62 GB / 15.60 GB
Container: Yes
Shell: 3.3.1 - /usr/bin/fish
Binaries:
Node: 16.17.0 - ~/n/bin/node
Yarn: 1.22.19 - ~/n/bin/yarn
npm: 8.15.0 - ~/n/bin/npm
Screenshot
No response
Additional context
I wanna use only <i18n></i18n>
block without json
or yaml
language configs.
So I expect that behavior.
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.