feat(i18n): default the cn build to Chinese
The .cn site exists for Chinese readers, so the unprefixed routes should
serve Chinese there. Rspress omits the prefix for the default locale, so
this also moves the routes:
.com .cn
English / /en-gb/
Chinese /zh-hans/ /
- Make the default locale a per-target value rather than a constant, and
move the localePrefix helper inside createConfig so a prefix can no
longer be hardcoded elsewhere.
- Build the sitemap priority map from localePrefix. The keys are full
route paths, so the previous hardcoded "/zh-hans/..." entries would
have silently stopped matching on .cn.
- Widen the nav Home activeMatch to cover either prefixed home, since the
two targets put a different locale behind the prefix.
Note: README.md also carries the licence wording changed in the next
commit — a single file's hunks cannot be split non-interactively.
This commit is contained in:
5 files changed
+110
-45
No files matched your search
@@ -2,7 +2,7 @@
|
||||
{
|
||||
"text": "nav.home",
|
||||
"link": "/",
|
||||
"activeMatch": "^/$|^/zh-hans/$"
|
||||
"activeMatch": "^/(en-gb/|zh-hans/)?$"
|
||||
},
|
||||
{
|
||||
"text": "nav.products",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
"text": "nav.home",
|
||||
"link": "/",
|
||||
"activeMatch": "^/$|^/zh-hans/$"
|
||||
"activeMatch": "^/(en-gb/|zh-hans/)?$"
|
||||
},
|
||||
{
|
||||
"text": "nav.products",
|
||||
|
||||
Reference in new issue
Block a user