You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the i18n plugin, any file that starts with “om-” will replace the default page.lang variable set in the 11ty config with the file name/slug. The plugin works as expected for other files.
From my testing, you can write any text after "om-." Typing numbers seems to work sometimes, but filenames like "om-ddd," "om-meg," and "om-dqdiqwhdqodh" will not work and will replace the page.lang variable.
I was thinking that if I place all of my Norwegian files in the root directory so that the default language would be served from / and the english from /en/. If this makes sense.
Then, I tried moving the Norwegian portion of the website to its own language folder. Without changing the permalinks, this would produce the correct page.lang. But after changing the permalinks to the Norwegian URLs, the same problem would occur.
Even the the locale_url would "break" on the "om-meg" page: <a href="{{ "/" | locale_url}}">. The URL would be replaced with "om-meg" only on that page.
It seems like any file that begins with a language code in the root directory breaks, even though that is not my intention. I just want to be able to have Norwegian URLs. Permalinks like: de-kan-ikke (which means "they cannot" in Norwegian) in the root folder would change the page.lang and breake the filter.
Operating system
Windows 11
Eleventy
2.0.1
Describe the bug
When using the i18n plugin, any file that starts with “om-” will replace the default page.lang variable set in the 11ty config with the file name/slug. The plugin works as expected for other files.
From my testing, you can write any text after "om-." Typing numbers seems to work sometimes, but filenames like "om-ddd," "om-meg," and "om-dqdiqwhdqodh" will not work and will replace the page.lang variable.
Reproduction steps
to the config file.
npx @11ty/eleventy --serve
and inspect the pages.<html lang="no">
<html lang="om-meg">
Expected behavior
Expected behavior: All pages should have the default language set in the HTML unless it is overridden by a data file.
Reproduction URL
No response
Screenshots
No response
The text was updated successfully, but these errors were encountered: