-
Notifications
You must be signed in to change notification settings - Fork 12
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
Language switches to default when using templates (pages generated using pageAPI) #21
Comments
Hi @tandeman77, did you still replicate it with the latest version? it seems like some problem with context variables, by chance if you check in the |
Please have a look at #32 I just opened a pull request to solve this issue. |
Temporary Workaround until this gets fixed: In my case it looks like this: Not the fanciest solution, but it works. |
Unfortunately this still doesn't solve the issue, as the |
The locale still falls back to the default with your code, however. When taking out the Edit: I didn't deep-dive in this top, so I don't know why this happens, just that it does :D |
Can you provide an example repo? In all my tests the locale didn't fall back to the default with the fix of this pull request. |
Sure! I've included the my "temporary workaround" from earlier commented out so you can test the difference! Edit: I seem to have overlooked the $tp() style of using g-links. I haven't had time to update the repo above, but I am aware of it! |
@ericwaetke I looked up your code now. The problem with the Your problem is not related to this issue at all. As you already mentioned in your edit, you forgot to use the $tp helper function – by using this, everything will work as expected |
Hi @daaru00,
I notice that the plugin doesn't work correctly when I use the pageAPI to create a page. For some reason, the current language changes when I navigate from a page component (automatically generated by Gridsome through the "pages" folder) to template pages (generated via page API using a component in the "templates" folder). When navigating to a template created page, or entering (refresh) a template page, the language always reverts to the default language (based on $i18n.locale).
I reproduced the problem in a new repo for you to have a look. In the example, you'll see that when you navigate between any pages, excluding "contact" and "extra", the plugin works fine. When visiting the "contact" or the "extra" page which are generated using a template, it switches languages automatically to default.
To Reproduce
Steps to reproduce the behaviour:
check out this example repo https://github.com/tandeman77/gridsome-test
Expected behaviour
Expected behaviour should be that language stays the same as the previous page.
Environment (please complete the following information):
Plugin configuration
The text was updated successfully, but these errors were encountered: