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

Use v-translate and $gettext in attributes #3

Closed
steven-pribilinskiy opened this issue Jul 27, 2017 · 1 comment
Closed

Use v-translate and $gettext in attributes #3

steven-pribilinskiy opened this issue Jul 27, 2017 · 1 comment

Comments

@steven-pribilinskiy
Copy link

I see support for v-translate in the code, but following .vue code:

<template lang="pug">
	div
		p(v-translate) test
</template>

Leads to a runtime error:

vue.common.js:461 [Vue warn]: Property or method "v" is not defined on the instance but referenced during render. Make sure to declare reactive data properties in the data option.

How the v-translate property should be used correctly?

Another question related to Polyconseil/vue-gettext#9.

Would it be possible to extract strings from following construct?

<template lang="pug">
	div
		p(:tooltip="$gettext('Translate this')"))
</template>
@kennyki
Copy link
Owner

kennyki commented Jul 27, 2017

For the 1st question: It's a problem with pugjs translating it into <p v-translate='v-translate'>test</p> and vue is receiving an expression. I have yet to have time to look into this, but the immediate solution is to change the pug template to:

p(v-translate='') test

For the 2nd question: This plugin is using the same extractor as vue-gettext so I think it's not possible at the moment :-)

@kennyki kennyki closed this as completed Oct 19, 2017
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

2 participants