Vue-i18n-loader does not work
See original GitHub issueThere is the problem in the main loader. In the documentation of vue-i18n, translations could be defined in the Single page component(<i18n></i18n>) by the following configs in the rule’s module:
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
loaders: {
i18n: '@kazupon/vue-i18n-loader'
}
}
},
// ...
]
}
The problem is that we don’t use ‘vue-loader’, we use ‘eslint-loader’ instead in nuxt project. And adding loaders into the config changes nothing. I tried to define new ‘push()’ with ‘vue-loader’, but after that, other loaders works incorrectly. Or maybe Vue-i18n-loader is not adaptive for the SSR, so maybe we need nuxt-i18n-loader. And is there a place to be?
Issue Analytics
- State:
- Created 5 years ago
- Comments:21 (1 by maintainers)
Top Results From Across the Web
Vue-i18n-loader does not work · Issue #58 · nuxt-modules/i18n
The problem is that we don't use 'vue-loader', we use 'eslint-loader' instead in nuxt project. And adding loaders into the config changes ...
Read more >vue.config.js - yaml-loader and i18n not working together
When I remove the config.module.rule('yaml') ... and loading of .yaml config file, translations works fine. Unfortunately it is not working ...
Read more >@intlify/vue-i18n-loader - npm
Start using @intlify/vue-i18n-loader in your project by running `npm i @intlify/vue-i18n-loader`. There are 19 other projects in the npm ...
Read more >Single file components | Vue I18n - Intlify
vue -i18n-loader is loader plugin for webpack. Since single file components is bundled with vue-loader, you need to setting webpack config ...
Read more >@intlify/vue-i18n-loader - npm package | Snyk
The npm package @intlify/vue-i18n-loader was scanned for known vulnerabilities and missing license, and no issues were found. Thus the package was deemed as ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello everybody, I have an alternative solution, if you are interested.
Explanation
The problem by adding the webpack configuration like below, is that you overwrite all of
vue-loader
rules set byNuxt
.A simple
console.log()
on thewebpack
configuration:Solution
The simplest way it’s to add the configuration like below
Full Setup
Install
vue-i18n
and@kazupon/vue-i18n-loader
(in dev).package.json
Create
i18n.js
plugin.plugins/i18n.js
Add plugin to Nuxt
nuxt.config.js
Add
<i18n>
in component/page/layout templatecomponents/MyComponent
You can see a sample on my repository: https://github.com/moifort/play-with-nuxt
Solution for nuxt 2: