Closed godfatherjohn closed 2 years ago
Please try the latest version of the 'develop' branch. I've rewritten this logic.
BTW, I wanted to thank you for your EXCELLENT demo with documentation. It helped me immensely in my debugging and testing. 👍
@rhukster -- describing the issue as comprehensively as possible, is the least that your friendly and very grateful neighbourhood uncle can do. I can confirm, the latest fix has solved the issue reported above. Thanks a lot!
@rhukster -- Note, the current fix introduces a new bug (above test system with the updated langswitcher plugin)
Grav does not switch to the other language, when that language's filename ('default.en.md') is missing the two-letter country code (hence is 'default.md'). It will serve you the presented language page again.
/home
| default.md
| default.fr.md <-- If you are here and you click on 'EN' in the langswitcher section on the website,
you will still be shown the FR page. Also, the path in the browser address bar is
is the path of the FR page.
The same is the case, if it was a directory nested in home.
/home
| default.en.md
| default.fr.md
|---/level1
| default.md
| default.fr.md <-- If you are here and you click on 'EN' in the langswitcher section on the website,
you will still be shown the FR page. Also, the path in the browser address bar is
is the path of the FR page.
Workaround: Use the country code in all .md files, primary and secondary languages.
I have just pushed a fix to develop that should sort this issue where default.md
was not detected as a valid page.
Bloody brilliant! Sorted! File names without the country codes are now being picked up correctly! As far as I am aware, all the issues recently discussed here ( #71 , #69 , #67 , #50 ) are now sorted.
For secondary languages: If a parent page has
routes: default: </xyz>
set, this page's children can no longer be reached via the Langswitcher entries on the website. When trying to do so, the path to the expected page is correct in the browser address bar but the page itself is a 404.Live test system at (godfatherjohn.com/test01). The test system's pages folder is attached as a Zip file.
About the test website:
vanilla Grav v1.7.35, Quark theme, Langswitcher v2.0.1 (as at August 15th, 2022)
Grav language settings:"
Supported: en, fr default_lang: null Include default language: No
Everything else is installation default, incl. "Overwrite default language:
Langswitcher plugin settings:
Installation default, no changes
The primary language is EN, the secondary language is FR.
Every folder has two .md files:
default.en.md
anddefault.fr.md
(as a workaround for issue #69).Every .md file has a slug set (as a workaround for issue #67).
Workaround: Do not set default routes.