-
Notifications
You must be signed in to change notification settings - Fork 25
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
BUG: script translations with $gettext does not get extracted/detected #39
Comments
Package version is |
@lzurbriggen is this a known issue? |
@ndragun92 no, this is a case that usually works. can you check if it works if you use destructuring? const { $gettext } = useGettext();
const data2 = $gettext("My message2"); i'm honestly thinking about removing the whole parser stuff and just use a regex-approach to extract messages, that also has downsides but it would probably be more reliable and reduce complexity. |
That works but for example not sure why assigning such variable loses its reactivity So from these 3 cases when you change language only 3rd option works which means that you cannot initially set a reactive variable in ref/reactive
|
We are currently porting our project from easygettext extractor to the extractor that comes with vue3-gettext - we noticed a few occurences of this exact issue. What's your current stance on parser vs regex approach by now, @lzurbriggen? P.S.: @ndragun92:
This is just how reactivity in Vue works. |
I implemented a new, simpler extraction parser that extracts all the messages in the original example. You don't need to do destructuring with the new parser, but for the sake of robustness, it will also extract stuff like Make sure to check the breaking changes though: v4.0.0-alpha.4 and v4.0.0-alpha.2 |
App.vue
This is my code and when I run gettext:extract I only get My message and My message 3 everything else from script is ignored
The text was updated successfully, but these errors were encountered: