Open seergiue opened 4 years ago
Please view the documentation for Vue.
Add Vue.filter("L", localize); in app.js
"some_common_key": { "subkey": "Word %s" }
@emog Thanks for answering!
But what happens if I want to add strings as keys for my translations?
Like this:
<Label :text="'Test.Word %s' | L('a')" />
Instead of what you proposed:
<Label :text="'commonKey.subKey' | L('a')" />
Hello, I'm trying to get a translation with a parameter and it won't work. I'm using nativescript-vue@2.6.0 and nativescript/core@6.5.1.
So the translations work fine without params but not with them.
My en.default.json:
Vue component where I use the filter:
Instead of returning me
Word a
it returnsTest.Word a
. So it includes the param but it's like if it was trying to findWord a
instead ofWord %s
in my translation file.Any idea?
Thanks!
UPDATE:
If I set the JSON like this:
Then it works. Its a bit odd because you never know when is looking for the key or accessing key.value.