I need to find a way to use the $t of i18n within the setup script for my vue project
my i18n file looks like this:
import { createI18n } from 'vue-i18n'
import en from './en';
import es from './es';
const messages = { en, es };
const locales = [
…
This is my code, that works without problems:
import { createI18n } from 'vue-i18n'
import messages from './components/json/foo/foo_messages.json'
const app = createApp(App)
installI18n(app)
const i18n = createI18n({
locale: 'ru',
…
Getting a warning inside the console "[intlify] Detected HTML in .....", but can't figure out how to disable this warning for this specific line. I've also tried to change the eslintrc.js file to disable all v-html warnings but didn't work…
I'm creating a Vue web component using vue-cli 4.5.13 and the --target wc option. I also need the component to use the vue-i18n-next plugin (last version for vue 3 projects), which requires some options to be passed to the main Vue instance, but now…
I've started a Vue 3 project (currently not much more than a boilerplate with TypeScript) and tried to add i18n to it.
As far as I've got, vue-i18n does not work properly with Vue 3; but vue-i18n-next should.
here is my main.ts
import { createApp }…
when I try to vue add i18n I am running in this error:
Invoking generator for vue-cli-plugin-i18n...
ERROR Error: You cannot call "get" on a collection with no paths. Instead, check the "length" property first to verify at least 1 path…
I am new to vue and I am using vuetify. I want to add internationalization to my project. I succeeded in that but I am using the standard method in which we make a single file per language, as my project grows it will be very hard to maintain that…
In project some common function are in separate .ts files.
How can I use i18 in that cases:
// for i18n
import Vue from 'vue'
declare module 'vue/types/vue' {
interface VueConstructor {
$t: any
}
}
declare module 'vue/types/options' {
…
I'm using prerender-spa-plugin in order to prerender certain pages so I get better SEO from my Vue app.
My goal is to transform the way I'm currently using Vue-i18n, so I can base it on url param /lang. Examples: /en/home or /nl/home. With this, I…
I'm using laravel-vue-i18n-generator package to handle text translation in vuejs component in my laravel project. I've set up app.js like below:
import VueInternationalization from 'vue-i18n';
import Locale from…
The following code:
import Vue from 'vue'
import Component from 'vue-class-component'
@Component
export default class SomeComponent extends Vue {
public someText = this.$t('some.key')
}
Throws an error:
[Vue warn]: Error in data(): "TypeError:…
I want to reduce my app size and i started from language files.
I'm using vue-i18n Single File Components and i can lazy load like this vue-i18n Lazy loading. I read about custom lang blocks, but as i know i can't set dynamic locale in src.
Now my…
With the following configuration I can output an amount with a currency
const numberFormats = {
"en-GB": {
currency: {
style: 'currency', currency: 'GBP'
}
},
"en-US": {
currency: {
style:…
I want to publish my vue3+vite package to npm but after publishing, I encountered "Uncaught TypeError: _ctx.$t is not a function" in a test project and my package is not working, any suggestions... ?
PS: I'm using vue options…