-
-
Notifications
You must be signed in to change notification settings - Fork 861
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
How can I add $t inside the js-code #287
Comments
What is the type of Can you post the code? |
Today is a simple string. Can you send an example of JavaScript code, how do I write this correctly? |
You can import VueI18n instance. e.g. app generated with vue-cli:
import VueI18n from 'vue-i18n'
import Vue from 'vue'
Vue.use(VueI18n)
export default new VueI18n({
// ...
})
import i18n from './i18n'
console.log(i18n.t('foo.bar') |
How to pluralize here? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I try to do it like this.$t('pages.datetime.today'), but it turns into a string and in the warning console Value of key 'pages.datetime.today' is not a string!
The text was updated successfully, but these errors were encountered: