Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I add dynamic locales? #6

Closed
Disorrder opened this issue Sep 16, 2015 · 5 comments
Closed

Can I add dynamic locales? #6

Disorrder opened this issue Sep 16, 2015 · 5 comments
Milestone

Comments

@Disorrder
Copy link

Hello.
I have several big files with locales. What is the best way to include them to i18n?
I see only one solution now, add all locales anywhere in global scope (f.e. window) and then init

Vue.use(window['vue-i18n'], {
    lang: 'en', // here I want to set 1st language I defined
    locales: window.locales
})

But uncomfortable, because I must define all locales before Vue.use().

@kazupon
Copy link
Owner

kazupon commented Sep 17, 2015

Hi

One Solution, You can include locales which was bundled with browserify or webpack, and then you can use require function (CommonJS style).

brwserify
http://browserify.org

webpack
http://webpack.github.io

@SeoFood
Copy link

SeoFood commented Oct 29, 2015

Im also interested in loading the translations dynamic. Because you dont need all languages compiled into js. You can load them via json etc.

@meganabigaildavidson
Copy link

👍 for being able to load individual locales from json, this would help cut down on having to include every single locale file, especially if you support many languages and the files are large. I know with i18next-client you can point it towards a directory and it will call the relevant son file depending upon the language.

@aaronjpitts
Copy link

Any update on support for this? It is a must to be able to load languages on demand and not all at once. Thanks again

@kazupon
Copy link
Owner

kazupon commented Jan 26, 2016

sorry, I'm hard work ... 🙇

@kazupon kazupon added this to the 3.0.0 milestone Feb 10, 2016
@kazupon kazupon mentioned this issue Feb 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants