In app/utils/const.ts, each COUNTRIES entry is already keyed by its path prefix (e.g. /zh-hk), and pathPrefix is derived from that key in context.ts:136 and schema.server.ts:31. So the explicit pathPrefix field looks redundant.
The one exception: /de-eu sets pathPrefix: "/de-EU" (capitalized), but getLocaleFromRequest lowercases the path and overwrites it with the key anyway — so that value seems unused.
To check
- Is the explicit
pathPrefix field ever actually used, or always overwritten?
- Does the
/de-EU casing matter for any generated URL?
- Can we drop
pathPrefix and derive it from the key in one place?
Affected
const.ts, context.ts, schema.server.ts, link.tsx, use-prefix-path-with-locale.ts, types/others.ts
In
app/utils/const.ts, eachCOUNTRIESentry is already keyed by its path prefix (e.g./zh-hk), andpathPrefixis derived from that key incontext.ts:136andschema.server.ts:31. So the explicitpathPrefixfield looks redundant.The one exception:
/de-eusetspathPrefix: "/de-EU"(capitalized), butgetLocaleFromRequestlowercases the path and overwrites it with the key anyway — so that value seems unused.To check
pathPrefixfield ever actually used, or always overwritten?/de-EUcasing matter for any generated URL?pathPrefixand derive it from the key in one place?Affected
const.ts,context.ts,schema.server.ts,link.tsx,use-prefix-path-with-locale.ts,types/others.ts