-
Notifications
You must be signed in to change notification settings - Fork 27
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
Integration with Vue #119
Comments
Hello @ADantes! Unfortunately, I have not tried |
It would be really helpful if you could set up some example repository with just basic Vue and ttag. |
Thank you for taking a look into this! This is the example I was trying: https://github.com/ADantes/ttag-with-vue If you run For an even simpler case, I believe a solution for this would solve the same problem:
|
As far as I can see, we should implement this as a plugin for Vue - https://vuejs.org/v2/guide/plugins.html#Writing-a-Plugin to have
inside Vue templates. |
This seems helpful vuejs/vue#9721 (comment) |
So it is quite trivial to add tagged template support and write a plugin to expose the functions, but the problem remains that babel-plugin-ttag doesn't recognize |
Hi @graup! Thanks for the helpful link, will try to investigate. Also, any help will be appreciated! |
I'm attempting to integrate ttag with Vue's single file components.
foo-script
gets picked up and translated just fine, but nothing inside of the<template>
tag does. Looking through the compiled output,{{ gettext('foo-template') }}
gets compiled intothis.gettext('foo-template')
andttag
currently does not handle its functions being reassigned.Is there any way to get
babel-plugin-ttl
to recognizethis.gettext
as a target? The discover option doesn't seem to work once a "." is invovled.This is also an issue when integrating with Svelte, so I'm assuming there's a fair number frameworks with similar issues.
Edit: The library works just fine with Svelte, without modifications. Functions just need to be passed down to the template through "helpers"
The text was updated successfully, but these errors were encountered: