question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cannot change locale

See original GitHub issue

Versions:

VueJs: 2.1.3
Vee-Validate:2.0.0-beta.22

Description:

I use vue integrated in laravel 5.3 and when I try to change locale I got error in console ReferenceError: Validator is not defined and this brakes all my vue script

Steps To Reproduce:

In my assets\js\bootstrap.js I put this code

window.Vue = require('vue');
require('vue-resource');

import VeeValidate from 'vee-validate';
import messages from '../../../node_modules/vee-validate/dist/locale/ru';
Validator.updateDictionary({
    ru: {
        messages
    }
});
Vue.use(VeeValidate, { locale: 'ru' });

and if I delete this piece of code

Validator.updateDictionary({
    ru: {
        messages
    }
});

then whole vue script is working, but errors in English and I see message in console [vee-validate]: You are setting the validator locale to a locale that is not defined in the dicitionary. English messages may still be generated.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
logaretmcommented, Nov 1, 2017

Use localize method instead:

// updates the dictionary and sets the locale to Russian.
Validator.localize('ru', ruLocale);
2reactions
schel4okcommented, Feb 3, 2017

I was able to solve this like that, but it was really luck. Please update your tutorial, because I was going break my head trying 3 or 4 different solutions from issues and from different part of your tutorial.

import VeeValidate from 'vee-validate';
import messagesRU from '../../../../node_modules/vee-validate/dist/locale/ru';
Vue.use(VeeValidate, {
    locale: 'ru',
    dictionary: { 
        ru: { messages: messagesRU }
    }
});
Read more comments on GitHub >

github_iconTop Results From Across the Web

warning: setlocale: LC_ALL: cannot change locale - Ask Ubuntu
Try the following commands sudo locale-gen fr_FR sudo update-locale LANG=fr_FR.
Read more >
LC_ALL: cannot change locale - Unix & Linux Stack Exchange
When I log into my server (Debian 7) through PuTTY, I get greeted by a message saying: -bash: warning: setlocale: LC_ALL: cannot change...
Read more >
Linux: setlocale: LC_ALL: cannot change locale (en_US.utf8 ...
Linux: setlocale: LC_ALL: cannot change locale (en_US.utf8) and Cyrillic symbols. Locales is a set of environment variables that are used to ...
Read more >
Fix warning setlocale cannot change locale - Jeffrey Tse's Blog
This error happens when your terminal settings local locale environment variables which doesn't have the specific locale you requested, to solve ...
Read more >
How to Fix "bash: warning: setlocale: LC_ALL - Snippets
Tested on Debian. Edit the default locale: sudo vim /etc/default/locale. Add the following: LANGUAGE=en_US.UTF ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found