Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
cdfcb7b
Add Italian catalog as unreviewed AI drafts (Claude Code, claude-opus…
SkillDMonkey Nov 2, 2026
1c7da00
Enable Italian as a bundled locale
SkillDMonkey Nov 2, 2026
9bee3aa
Enable Italian as a bundled locale (locale pack)
SkillDMonkey Nov 2, 2026
088d2b3
Include Italian in the i18n test locale lists
SkillDMonkey Nov 2, 2026
d42bfa2
Merge branch 'pascalorg:main' into italian-locale
SkillDMonkey Nov 23, 2026
791d454
Italian: glossary terms
SkillDMonkey Nov 23, 2026
a134f47
Italian: enable it in the Lingui config
SkillDMonkey Nov 23, 2026
e3b8c0d
Italian: bundled locale and locale-pack test
SkillDMonkey Nov 23, 2026
05b36fc
Italian: include it in the i18n script locale lists
SkillDMonkey Nov 23, 2026
088e203
Italian catalog for current main; first 103 strings reviewed by a nat…
SkillDMonkey Nov 23, 2026
345302e
Italian: two more strings reviewed by the native speaker (Finish, Liq…
SkillDMonkey Nov 23, 2026
599d94e
Merge branch 'pascalorg:main' into italian-locale
SkillDMonkey Dec 2, 2026
cb65faa
Italian: re-extract for current main; 182 new strings come in as unre…
SkillDMonkey Dec 2, 2026
f39e7a5
Merge branch 'main' into italian-locale
SkillDMonkey Dec 3, 2026
bd57dc5
Italian: sync reviewed catalog and add locale entry point
SkillDMonkey Dec 3, 2026
55c2c2a
Italian: load the Italian catalog on demand and test fallback
SkillDMonkey Dec 3, 2026
158ef72
Italian: export the per-locale catalog entry point
SkillDMonkey Dec 3, 2026
60e924e
Italian: share locale targets and separate preview checks
SkillDMonkey Dec 3, 2026
63a65a1
Italian: use the shared locale list in Lingui
SkillDMonkey Dec 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions i18n/glossary.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,54 @@
"fr": "plafond",
"es": "techo",
"ja": "天井",
"note": "A generic overhead room surface, not necessarily a suspended ceiling."
"note": "A generic overhead room surface, not necessarily a suspended ceiling.",
"it": "soffitto"
},
"floor plan": {
"zh-CN": "平面图",
"fr": "plan d’étage",
"es": "plano de planta",
"ja": "平面図",
"note": "A 2D architectural drawing, not a project plan."
"note": "A 2D architectural drawing, not a project plan.",
"it": "pianta"
},
"level": {
"zh-CN": "楼层",
"fr": "niveau",
"es": "planta",
"ja": "階層",
"note": "A building storey."
"note": "A building storey.",
"it": "piano"
},
"room": {
"zh-CN": "房间",
"fr": "pièce",
"es": "estancia",
"ja": "部屋"
"ja": "部屋",
"it": "stanza"
},
"scan": {
"zh-CN": "扫描模型",
"fr": "relevé 3D",
"es": "escaneo 3D",
"ja": "3Dスキャン",
"note": "A captured 3D reference, not the verb scan."
"note": "A captured 3D reference, not the verb scan.",
"it": "scansione"
},
"wall": {
"zh-CN": "墙体",
"fr": "mur",
"es": "muro",
"ja": "壁"
"ja": "壁",
"it": "muro"
},
"walkthrough": {
"zh-CN": "漫游",
"fr": "visite",
"es": "recorrido",
"ja": "ウォークスルー",
"note": "First-person navigation through the building."
"note": "First-person navigation through the building.",
"it": "passeggiata"
}
}
}
3 changes: 2 additions & 1 deletion lingui.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { LinguiConfig } from '@lingui/conf'
import { formatter } from '@lingui/format-po'
import { ALL_LOCALES } from './scripts/i18n-locales'

const config: LinguiConfig = {
catalogs: [
Expand All @@ -22,7 +23,7 @@ const config: LinguiConfig = {
lineNumbers: false,
origins: true,
}),
locales: ['en', 'zh-CN', 'fr', 'es', 'ja'],
locales: [...ALL_LOCALES],
orderBy: 'messageId',
sourceLocale: 'en',
}
Expand Down
1 change: 1 addition & 0 deletions packages/editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"./locales/en": "./src/i18n/locales/en/index.ts",
"./locales/es": "./src/i18n/locales/es/index.ts",
"./locales/fr": "./src/i18n/locales/fr/index.ts",
"./locales/it": "./src/i18n/locales/it/index.ts",
"./locales/ja": "./src/i18n/locales/ja/index.ts",
"./locales/zh-CN": "./src/i18n/locales/zh-CN/index.ts",
"./locales/pseudo": "./src/i18n/pseudo-locale.ts",
Expand Down
8 changes: 5 additions & 3 deletions packages/editor/src/i18n/lazy-locales.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type CompiledTranslationMessages, registerCompiledMessages } from '@pascal-app/core'

export const BUNDLED_LOCALES = ['en', 'zh-CN', 'fr', 'es', 'ja'] as const
export const BUNDLED_LOCALES = ['en', 'zh-CN', 'fr', 'es', 'ja', 'it'] as const
export type BundledLocale = (typeof BUNDLED_LOCALES)[number]

export type LocaleCatalog = {
Expand Down Expand Up @@ -75,12 +75,14 @@ async function importLocaleMessages(locale: BundledLocale): Promise<CompiledTran
return (await import('./locales/es/messages')).messages
case 'ja':
return (await import('./locales/ja/messages')).messages
case 'it':
return (await import('./locales/it/messages')).messages
}
}

/**
* Dynamically loads and registers only the active locale's catalog chunk
* instead of pulling all five catalogs into the initial bundle.
* instead of pulling all catalogs into the initial bundle.
*/
export async function loadBundledLocale(
locale: string | null | undefined,
Expand Down Expand Up @@ -110,7 +112,7 @@ export async function loadBundledLocale(
return pending
}

/** Loads and registers all five bundled catalogs on demand. */
/** Loads and registers all bundled catalogs on demand. */
export async function loadAllBundledLocales(): Promise<void> {
await Promise.all(BUNDLED_LOCALES.map((locale) => loadBundledLocale(locale)))
}
Expand Down
26 changes: 25 additions & 1 deletion packages/editor/src/i18n/locales.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
} from './lazy-locales'
import { bundledLocalePacks, registerBundledLocales } from './locales'
import { locale as frenchLocale, registerLocale as registerFrenchLocale } from './locales/fr'
import { locale as italianLocale, registerLocale as registerItalianLocale } from './locales/it'

afterEach(() => {
setLocale('en')
Expand All @@ -20,6 +21,7 @@ test('resolveBundledLocale maps exact, script, and base locales without crossing
expect(resolveBundledLocale('fr-CA')).toBe('fr')
expect(resolveBundledLocale('es-MX')).toBe('es')
expect(resolveBundledLocale('ja-JP')).toBe('ja')
expect(resolveBundledLocale('it-IT')).toBe('it')
expect(resolveBundledLocale('zh-CN')).toBe('zh-CN')
expect(resolveBundledLocale('zh-Hans')).toBe('zh-CN')
expect(resolveBundledLocale('zh-Hans-CN')).toBe('zh-CN')
Expand Down Expand Up @@ -53,7 +55,7 @@ test('per-locale entry point and loadBundledLocale register only the requested l
})

test('synchronous locales entry point preserves bundledLocalePacks and registerBundledLocales', () => {
expect(Object.keys(bundledLocalePacks).sort()).toEqual(['en', 'es', 'fr', 'ja', 'zh-CN'])
expect(Object.keys(bundledLocalePacks).sort()).toEqual(['en', 'es', 'fr', 'it', 'ja', 'zh-CN'])
const ret = registerBundledLocales()
expect(ret).toBeUndefined()

Expand All @@ -71,6 +73,28 @@ test('synchronous locales entry point preserves bundledLocalePacks and registerB
}
})

test('the Italian entry point registers only Italian', () => {
expect(italianLocale).toBe('it')
expect(isBundledLocaleLoaded('it-IT')).toBe(false)
registerItalianLocale()
expect(isBundledLocaleLoaded('it-IT')).toBe(true)
expect(isBundledLocaleLoaded('fr')).toBe(false)
})

test('loading Italian on demand serves reviewed entries and keeps drafts in English', async () => {
expect(isBundledLocaleLoaded('it-IT')).toBe(false)
const loaded = await loadBundledLocale('it-IT')
expect(loaded?.locale).toBe('it')
expect(isBundledLocaleLoaded('fr')).toBe(false)
setLocale('it-IT')

// Entries a native reviewer approved (Review: human) are compiled; drafts stay English.
expect(translate('editor.actionMenu.structureTools.window', 'Window')).toBe('Finestra')
// Same English, still a draft (also “Finestra” in the PO): it must fall back, so shipping it fails here.
expect(translate('app.lib.buildPalette.window', 'Window')).toBe('Window')
expect(translate('editor.sidebar.panels.sitePanel.site', 'Site')).toBe('Sito')
})

test('Simplified Chinese aliases use zh-CN without affecting Traditional Chinese', () => {
registerBundledLocales()

Expand Down
2 changes: 2 additions & 0 deletions packages/editor/src/i18n/locales.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { type BundledLocale, type LocaleCatalog, registerBundledCatalog } from '
import { messages as en } from './locales/en/messages'
import { messages as es } from './locales/es/messages'
import { messages as fr } from './locales/fr/messages'
import { messages as it } from './locales/it/messages'
Comment thread
cursor[bot] marked this conversation as resolved.
Resolved
import { messages as ja } from './locales/ja/messages'
import { messages as zhCN } from './locales/zh-CN/messages'

Expand All @@ -13,6 +14,7 @@ export const bundledLocalePacks: Record<BundledLocale, LocaleCatalog> = {
fr: { locale: 'fr', messages: fr },
es: { locale: 'es', messages: es },
ja: { locale: 'ja', messages: ja },
it: { locale: 'it', messages: it },

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Italian locale never loads at runtime

High Severity

Italian is registered only on the synchronous bundledLocalePacks path. BUNDLED_LOCALES and importLocaleMessages in lazy-locales.ts still omit it, so resolveBundledLocale('it') returns null and loadBundledLocale('it') never registers the pack. The standalone editor uses that lazy path, so ?lang=it keeps English—including the 105 reviewed strings. isBundledLocaleLoaded('it') also returns true, so the client never retries a load.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f39e7a5. Configure here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 55c2c2a: it is now in BUNDLED_LOCALES and importLocaleMessages, covered by the test "loading Italian on demand"; Bugbot found no new issues on 63a65a1.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed at 63a65a12. it is now in BUNDLED_LOCALES and in the importLocaleMessages switch in lazy-locales.ts, and the ./locales/it entry registers through the same registerBundledCatalog. I checked the #1310 lazy path: it-IT resolves to it, loadBundledLocale registers the pack, and the reviewed strings render in Italian (the draft ones fall back to English). apps/editor/app/layout.tsx:44 and client-bootstrap.tsx:147 both go through that loader. Resolving.

}

export function registerBundledLocales(): void {
Expand Down
9 changes: 9 additions & 0 deletions packages/editor/src/i18n/locales/it/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { registerBundledCatalog } from '../../lazy-locales'
import { messages } from './messages'

export const locale = 'it' as const
export { messages }

export function registerLocale(): void {
registerBundledCatalog({ locale, messages })
}
Loading
Loading