Description
🐛 Bug Report
There seems to be no fallback handling to the defaultLocale.
When I change with the localeDropdown to French (fr), my baseURL is appended with the locale. And will look like below
https://docusaurus.io/fr/docs/i18n/tutorial
However when I replace the french locale with my default locale (in my case: en) it will return a page not found.
http://localhost:3000/en/docs/intro
How can I make the defaultLocale accessible from the URL as the current 'strategy' is to strip the defaultlocale from the URL.
I think this is an important Bug because when starting to use Docusaurus V2 early we shipped some 'stable' URLs to production, and these URLs need to remain stable, meaning we have the locale always appended after the BaseURL. (also for default english).
What would be the suggestion?
(to me it seems odd I would need to use the multi domain strategy and start configuring CDNs just to get this working)
To Reproduce
- Configure the sites locales
i18n: { defaultLocale: 'en', locales: ['en', 'de'], },
- Write your translations (.. create i18n folder, with the locale folder, etc..)
- Build the application
npm run build
using the https://docusaurus.io/docs/i18n/tutorial#single-domain-deployment single domain deployment strategy
Expected behavior
I would expect that the application is accessible with the default locale prefix in the URL.
Even better would be if you do not define the locale it all, that the application falls back to the defaultLocale if the document is available.
e.g. https://docusaurus.io/it/docs/i18n/tutorial
should fall back to https://docusaurus.io/docs/i18n/tutorial
in case IT (Italian) is not defined as a locale.
Actual Behavior
Currently you see a Page Not Found forward.
Your Environment
- Docusaurus version used: Alpha 75
- Operating system and version (desktop or mobile): Windows , latest Chrome