[bug]: Building web/space from source ships no translations — UI renders raw i18n keys
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 59.6k
- Forks
- 5.8k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 49
Description
Current Behavior
When web/space are built from source (v1.4.2), no locale files end up in the client bundle. Every t() call fails to load resources at runtime, so the UI renders raw translation keys (home.title, sidebar.new_work_item, …) instead of translated text — for all languages, including English.
Steps to Reproduce
- Build the
webimage from source usingapps/web/Dockerfile.web. - Open the app (any page).
- Sidebar/menu items show literal keys such as
home.title,drafts,sidebar.new_work_item.
Root Cause
packages/i18n/src/core/instance.ts loads translations through a fully dynamic template import:
resourcesToBackend((language, namespace) => import(`../locales/${language}/${namespace}.json`))
Two path variables make this impossible for bundlers to statically resolve. Neither tsdown (when building @plane/i18n's dist) nor vite (when bundling the app) expands it — the compiled output keeps the native dynamic import verbatim:
(Object.assign({}), `../locales/${e}/${t}.json`, 4)
so the browser requests ../locales/zh-CN/common.json at runtime and 404s. Confirmed on a v1.4.2 source build: no locale JSON exists anywhere in the served assets.
Suggested Fix
Use import.meta.glob, which vite expands at build time, and alias @plane/i18n to its source in the web/space vite configs so the glob is processed by the app build instead of the prebuilt dist. Locale JSON for all 20 languages then ships in the bundle and language switching works end to end. A PR follows.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with packages/i18n/src/core/instance.ts and inspect apps/web/Dockerfile.web plus the web and space Vite configurations. Reproduce a source build and check the served assets and browser requests for locale JSON. Done means locale resources for all supported languages are included and the UI renders translated text, including after language switching.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vite
- Domain
- build-system, frontend, internationalization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100