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

Issue extracting texts inside labels. #46

Open
bspyropoulos opened this issue Jun 20, 2023 · 3 comments
Open

Issue extracting texts inside labels. #46

bspyropoulos opened this issue Jun 20, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@bspyropoulos
Copy link

bspyropoulos commented Jun 20, 2023

Hello! Apparently there is an issue extracting texts inside labels when they have the for attribute. i.e
This doesn't work:
<label for="company-website" class="tw-block tw-text-sm tw-font-medium tw-leading-6 tw-text-gray-900">{{ $gettext("bla bla") }}</label>
but this one does:
<label class="tw-block tw-text-sm tw-font-medium tw-leading-6 tw-text-gray-900">{{ $gettext("bla bla") }}</label>

UPDATE
Seems to happening only when label with for attribute is inside a v-for block.

Is there a known workaround? Thanks in advance!

@lzurbriggen lzurbriggen added the bug Something isn't working label Jun 20, 2023
@lzurbriggen lzurbriggen self-assigned this Jun 20, 2023
@lzurbriggen
Copy link
Collaborator

hi @bspyropoulos, i have not seen this one yet and don't have a lot of time lately, so I don't know how soon there'll be a proper fix.

Is there a known workaround?

you can always translate in the <script> block.

const { $gettext } = useGettext();

const labelText = $gettext("bla bla");

wrapping your label or doing your v-for in a <template> may also work, but i don't know what the root of the issue is so i'm not sure.

@bspyropoulos
Copy link
Author

@lzurbriggen just noticed this bug. I haven't found a workaround. Surely i will try to translate those words in <script> block. I also tried using :for instead of the native attribute and adding a string but it didn't work.
Thanks for the quick response though!

@lzurbriggen
Copy link
Collaborator

I just implemented a new extraction parser that should be a bit more robust. Nobody has really used it yet, but it seems to parse your failing example correctly.

Make sure to check the breaking changes though: v4.0.0-alpha.4 and v4.0.0-alpha.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants