ssg
ssg copied to clipboard
Translate tag picks the wrong language when using multisite
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}" }}
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.
When I generated the site again to debug it, it seemed like {{ site }} and {{ locale }} had a mismatch:
So here bg was correct for Bulgarian but the locale was zh_tw for Chinese.
Here the site es was correct but the locale el for Greek was incorrect.
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.