-
-
Save titusdecali/4ec3cdd8e8ce54e5e65785001d44d6aa to your computer and use it in GitHub Desktop.
| import { createApp } from 'vue' | |
| import App from './App.vue' | |
| // i18n | |
| import I18n from './i18n.js' | |
| const i18n = createI18n({ | |
| locale: | |
| localStorage.getItem('lang') || | |
| // Detect user's browser language | |
| I18n.detectLanguage() || | |
| process.env.VUE_APP_I18N_LOCALE, | |
| fallbackLocale: process.env.VUE_APP_I18N_FALLBACK_LOCALE || 'ko', | |
| // Load selected lang's .json file | |
| messages: I18n.loadLocaleMessages() | |
| }) | |
| const app = createApp(App) | |
| app.use(i18n) | |
| app.mount('#app') |
А откуда, блть, ты берёшь createI18n. Где здесь импорт
It's included in the i18n package.
Please follow my guide:
https://medium.com/better-programming/vue-i18n-ultimate-guide-fb3d9db48c94
Sry for my lang, but it's so annoying.
I've this error
in ./src/locales/ru.json
Syntax Error: Final loader (./node_modules/@intlify/vue-i18n-loader/lib/index.js) didn't return a Buffer or String
@ ./src/locales sync [A-Za-z0-9-_,\s]+\.json$/
I've been trying to solve this for 5 hours
Can u help me with it?
It looks like you are returning null as the key, but it may only accept key value pairs with a string as the value.
If you are using vue-translation-manager, it should give you a name for the key and not just null.
if you’ve been fighting this for five hours, it’s probably easier to start over again and follow my guide exactly.
I have followed your guidance very closely.
null fields disappear after I save the file with BabelEdit after PreTranslate.
Oh my goodness.
The mistake was that one of the translation fields contained just such a string.
[email protected]
If you remove the @, then everything is ok.
Explain to me, please, what kind of game?
If it’s a string, the @ shouldn’t matter. It’s hard to say what went wrong without seeing the code directly.
Can i show u? Have u free time to think about it?
For people coming this far, you need to run npm install vue-i18n@next to be able to import { createI18n } from 'vue-i18n'
https://vue-i18n.intlify.dev/guide/migration/breaking.html

А откуда, блть, ты берёшь createI18n. Где здесь импорт