Repository navigation
Description
Hullo folks,
I’m doing some research for Tessl Code Review and we ran it against your repo. It flagged a potential issue, and I figured it made sense to share it with you:
We checked the finding against the current code.
Environment / version
Nuxt integration, @nuxt/ui 4.12.0 source at 48d76af5. This is a focused check of the build-time locale resolver, without launching a Nuxt application.
Description
Automatic locale matching resolves zh-TW and zh-CN, but adding their script subtags makes the same regional locales unresolved. The generated i18n plugin then omits those configured locale codes.
Reproduction
From a checkout, this minimal check exercises the exported resolver:
import { resolveLocaleKey } from './src/utils/locales'
const keys = ['en', 'zh_cn', 'zh_tw']
console.log(resolveLocaleKey('zh-TW', keys)) // zh_tw
console.log(resolveLocaleKey('zh-CN', keys)) // zh_cn
console.log(resolveLocaleKey('zh-Hant-TW', keys)) // undefined
console.log(resolveLocaleKey('zh-Hans-CN', keys)) // undefinedWe executed the resolver’s current function unchanged in an isolated Bun check and got these results. This concerns Nuxt module configuration, rather than a component-only playground example.
Expected: the region-qualified tags should select zh_tw and zh_cn, respectively. Language-only zh can remain ambiguous.
Actual: the candidate list tries the complete tag and then only its language. It never tries zh_tw or zh_cn after removing a script subtag, and both regional matches make the language-only fallback ambiguous. Plugin generation skips unresolved entries.
Using zh-TW / zh-CN as the configured codes, or passing an explicit UI locale, provides a workaround.
Original Tessl finding. Does this look worth addressing, or have we missed some intended behaviour?
Tessl reviews code using repository-level context and specific review lenses that improve over time through feedback. That’s how this finding surfaced. We’re just getting started and want to offer the tool free to open-source projects. If this is useful, happy to give you access.
Baptiste
Activity
coderabbitai commentedon Nov 16, 2026
🔗 Related PRs
#7429 - fix(module): resolve
@nuxtjs/i18nlocales with a script subtag [open]#7152 - feat(App): follow the
@nuxtjs/i18nlocale [merged]📝 Issue Planner
Check the box below or use the
@coderabbitai plancommand to generate an implementation plan and prompts that you can use with your favorite coding assistant.🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!