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

The instruction for Vue is out-of-dated #59

Open
shilik opened this issue Dec 9, 2018 · 2 comments
Open

The instruction for Vue is out-of-dated #59

shilik opened this issue Dec 9, 2018 · 2 comments

Comments

@shilik
Copy link

shilik commented Dec 9, 2018

Hi, ifabreges
Thanks for the great plugin.
It took me a while figuring out how to make it work on my nativescript-vue project.
As nativescript-vue has been updated to 2.0.
The following settings work for me.

in main.js file
const application = require("application");
const localize = require("nativescript-localize");
application.setResources({ L: localize });
Vue.filter("L", localize);

in abc.vue file
works like charms while will yield errors.

@lfabreges
Copy link
Collaborator

I tested it and adding the L pipe to the application resources isn't required. It seems that nativescript is not taking into account the modified strings file at build time, it only takes it into account during the next build. I don't know how to fix that for now.

@elie-g
Copy link

elie-g commented May 20, 2019

With Vue.filter, it just doesn't work for me...

Whatever I try it always crash with a message saying _vm.L is not a function.

The only way I found to make it work is to not use Vue.filterand directly declare the function for every Vue instance using Vue.prototype.L = localize

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

3 participants