vue-i18n | Internationalization plugin of Vue.js | Plugin library
kandi X-RAY | vue-i18n Summary
kandi X-RAY | vue-i18n Summary
Internationalization plugin of Vue.js
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of vue-i18n
vue-i18n Key Features
vue-i18n Examples and Code Snippets
Community Discussions
Trending Discussions on vue-i18n
QUESTION
I would like to use a different predeploy
hook per project on a Firebase Hosting multi-projects and multi-sites.
Is it possible?
Currently:
.firebaserc
...ANSWER
Answered 2021-Jun-09 at 03:28You can setup a deploy script inside package.json that runs the appropriate command since there is no way to build firebase-cli tools for every framework and custom integration, you want to inject the deploy command at the end of your own build scripts
"cross-env NODE_ENV=staging quasar build && firebase deploy --only hosting:admin"
Additionally, you also have the "use" feature built-in, but this is more to manage multiple projects with the same site https://firebase.google.com/docs/cli#project_aliases
I also suggest reading the multiple apps per project scenarios demonstrated here: https://firebase.google.com/docs/projects/learn-more#best-practices
QUESTION
I am trying to setup a vue3 app with i18n localization. The localization is supposed to be located in json files. I added i18n via vue add i18n
to my project. The questions asked during installation were all answered with the default value except the one with the legacy support (my answer: no). When i try to use a text from a json file, it will tell me in the console [intlify] Not found 'message' key in 'en' locale messages.
The local translations work just fine.
And i have no clue why it is not working with the translations provided in the JSON file.
Here is my code:
packages.json
...ANSWER
Answered 2021-Jun-08 at 15:27The main probles is that the function in i18n.ts doing loadLocalMessages is not getting properly the files from the locales folder.
QUESTION
So I have build an form in laravel with Vue with some validation rules and this works, when there's an error it will show me an message but I also have an locales switcher present which also works for the text in the form but not for the validation output, so there are always in English. I am using the i18n plugin to translate the text.
Is there a way to make the validation rules i18n ready?
registerController.php
...ANSWER
Answered 2021-May-29 at 08:15You should write :error="$t(errors.name)"
in your components as you write {{ $t("auth.register") }}
to show translated text about register. I assume that you get i18n locale structured object in your errors response, something like this:
QUESTION
I have migrated from Quasar v1 to Quasar v2, and in doing so have moved to Vue 3. I have the code below that worked in Quasar v1 (Vue v2), but now when running in Quasar v2 (Vue v3) I get the following error message in the console when selecting a filter:
...ANSWER
Answered 2021-May-28 at 22:32The migration guide for vue-router 4 doesn't say explicitly, but you can no longer ref the child component via the tag itself. There is a new paradigm mentioned for handling the child's slots that turns out to work for your use case as well; here's the adjusted code:
QUESTION
Building a language switcher, all works fine but when I use the $t() inside the data object it will not be dynamic when I switch between a language.
Component.vue
...ANSWER
Answered 2021-May-28 at 09:24data
is only ever called once when creating the component, and it's not intended to be reactive.
To make a property reactive on $t()
, it should be computed
:
QUESTION
Building an laravel spa with Vue and wanted to add some i18n to use it in different languages but when trying to use locale json files the translation does not work, when adding it inside the file it will work. I do get an warning back saying [intlify] Not found 'dashboard' key in 'en' locale messages.
package.json
...ANSWER
Answered 2021-May-27 at 11:20The problem is loadLocalMessages
is async
, so it automatically returns a Promise
:
QUESTION
I am using Using
- "vee-validate": "3.0.0",
- "vue": "2.6.10",
- "vue-i18n": "8.14.0"
I am trying to change the language from vee-validate messages for a custom rule. The validation localization doesn't change. What am I doing wrong ?
here is my code sandbox :
As we can see, I can change the i18n.locale but it doesn't update the messages from vee-validate V3.0.0
Thanks for the help!
...ANSWER
Answered 2021-May-16 at 14:29You have to pass a callback to custom message, not the translated value, so it will be called when to locale changes and generate new message.
vee-validate.js
QUESTION
I have a Vue 2.6 project and I want to use the es2020 characteristics like optional chaining in my project but I can't get it to work in my project. I'm getting the following error.
...ANSWER
Answered 2021-Apr-27 at 11:31I don't think so you can achieve that, unless you will implement it by yourself. ES2020 features such an optional chaining are available in Vue 3
, but not Vue 2.x
.
QUESTION
Does destructuring assignment (in my case with Vue composables) has any performance gain/tradeoff?
For example I have component that displays current language choosed in vue-i18n.
I can do this with destructuring:
...ANSWER
Answered 2021-Apr-28 at 01:45No, there is no significant performance implication of destructuring. It's really just syntactic sugar that makes code more concise and readable.
EDIT: I'm going to add the remark that you should not in general be worrying about the performance of core language features like this. Worry about which data structure is best for a particular use case, don't worry about what syntax performs best. If you are coding more or less competently, then performance optimization should be a fairly uncommon exercise and not your first consideration. Code for readability and maintainability and only worry about performance when you notice it's a problem or happen to know that it's critical.
QUESTION
I have a legend inside the map, is working fine when the map is not full screen, but when the map is full screen the legend is not showing.
To Reproduce
Steps to reproduce the behavior:
- Open the map and see the legend is present and working fine
- Click full screen icon
- The legend is not present
- Click full screen icon again to remove the full screen, now the legend is present and working fine
Expected behavior
The legend should work fine when full screen.
Screenshots
Normal screen, working fine:
Full screen, not showing the legend:
Additional context
Code example available on codesandbox https://codesandbox.io/s/ecstatic-wave-c3qmg. You should open the link https://c3qmg.csb.app/ on another page to be able to see the fullscreen icon.
Code extract:
...ANSWER
Answered 2021-Apr-27 at 00:28By default, the Mapbox GL JS fullscreen control only makes the map container itself full screen. Nothing else on the screen will be visible.
So you need to pass the container element through to Vue-Mapbox's MglFullScreenControl
as the container
parameter, along these lines:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install vue-i18n
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page