makeplane / makeplane/plane

[bug]: Building web/space from source ships no translations — UI renders raw i18n keys

Open
#9,858 0 comments 0 reactions 0 assignees View on GitHub

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
  1. Build the web image from source using apps/web/Dockerfile.web.
  2. Open the app (any page).
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.