Let's consider two different languages represented in JSON format:
jp.json
{
"hello": "こんにちは"
}
ge.json
{
"hello": "hallo",
"world": "welt"
}
Now, we are going to combine these languages to create an i18n object:
import { createI18n } from 'vue-i18n'
import jp from '@/i18n/jp.json'
import ge from '@/i18n/ge.json'
type Schema = typeof jp
const i18n = createI18n<[Schema], 'jp' | 'ge', false>({
legacy: false,
locale: 'jp',
fallbackLocale: 'jp',
messages: {
jp,
ge
}
})
I want jp.json
to be the main language schema, but the current setup does not catch any extra properties in ge.json
(
"world": "welt"
) and does not trigger an error. Is there a solution for this issue?
Note: the language files are large and must be imported.