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

Translate tag picks the wrong language when using multisite #166

Open
tao opened this issue May 23, 2024 · 2 comments
Open

Translate tag picks the wrong language when using multisite #166

tao opened this issue May 23, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@tao
Copy link
Contributor

tao commented May 23, 2024

I have some translated keywords in Laravel Lang files, but when I used ssg:generate after updating to v3 then it randomly generates from other languages...

This happens even when I specify the site in the trans tag

{{ trans:legal.disclaimer site="{locale}" }}

Screenshot 2024-05-23 at 17 23 27

You can see it ends up with a mix of all different languages on this page, so now I have Spanish and Arabic on the same page.

The same is happening with the get_content tag.

It seems most languages end up being generated with Arabic which is alphabetically the first site in our sites list... besides that I don't have any other clues as to what is going on.

@tao
Copy link
Contributor Author

tao commented May 23, 2024

When I generated the site again to debug it, it seemed like {{ site }} and {{ locale }} had a mismatch:

Screenshot 2024-05-23 at 19 57 00

So here bg was correct for Bulgarian but the locale was zh_tw for Chinese.

Screenshot 2024-05-23 at 20 00 03

Here the site es was correct but the locale el for Greek was incorrect.

@tao
Copy link
Contributor Author

tao commented May 23, 2024

Since the {{ site }} variable is correct, I tried using that but it seems more like the get_content and trans tags are not working correctly then... as even if I try overload them with the correct site it doesn't work:

{{ get_content from="/fragments/disclaimer" site="{site}" locale="{site}" }}
     <p>{{ content }}</p>
{{ /get_content }}

Using the example above it would revert back to getting the Chinese zh_tw disclaimer instead of the correct one for the site bg.

@tao tao changed the title Translate tag picks the wrong language when using multisite and workers Translate tag picks the wrong language when using multisite May 23, 2024
@duncanmcclean duncanmcclean added the bug Something isn't working label Jun 21, 2024
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