Skip to content
Advertisement

Tag: internationalization

i18n how to use $t in translation file

I’m using vuejs 3, quasar 2 and vue-i18n for my traductions. how can i use $t or $tc in translation file like this ? i have the error “$tc is not defined” Answer You should be able to do this with “Linked Locale Messages” (https://kazupon.github.io/vue-i18n/guide/messages.html#linked-locale-messages) So with a messages file something like this: You would then do <div>{{ $t(‘message.linked’, 10)

defaultLocale is not keeping default lang in Next.js i18n

I’m trying to make my default language in Next.js i18n but always is getting “En” as default language called like fallback. And I also get this error: Error: [@formatjs/intl Error MISSING_DATA] Missing locale data for locale: “sq” in Intl.NumberFormat. Using default locale: “en” as fallback Answer Next.js will automatically detect which locale the user prefers based on the Accept-Language header

Next.js router locale issue

I have set up some locales for our app which are uk and us. For the blog we can have either us/blog or just /blog for the uk locale. When I switch to us like so: (locale = “us”) the url gets correctly updated to have us/ prepended. When I switch back to uk using handleRoute (locale= “”), it stays

Language getting detected but translation not working with i18n

I have set up the i18n middleware in my Express Node js server like this: Here is the translation test file: The value of title in English is title and for Malaysian, it’s tajuk As per the express middleware documentation, I’m passing my as the accept-language header , and console.log(req.i18n.language) is correctly printing it. However, console.log(t(‘title’)) is still printing title

I18N change language in Next.JS

I have some problems with I18N and NextJS. So I configured my I18N, everything works with default locale, but everything crashes if I want to change locale from local storage. In _app.js I tried to use this function: I have imported: When app is loaded it crashes and give error: I’m using the newest Next.js and I18N What I found

Advertisement