feat(commands): multi-select ordered command pipeline with step reordering and single-pass composition (AI-05, AI-07)
This commit is contained in:
parent
f49acf0105
commit
10af20a0ad
157 changed files with 29455 additions and 913 deletions
112
scripts/ci/sync-i18n-locales.mjs
Normal file
112
scripts/ci/sync-i18n-locales.mjs
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
#!/usr/bin/env node
|
||||
// scripts/ci/sync-i18n-locales.mjs
|
||||
// Synchronizes translation keys across all 12 locale files in packages/i18n/src/locales/*.json.
|
||||
// Master key list is the union of ko.json and en.json (ordered by ko.json).
|
||||
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
||||
const localesDir = path.resolve(__dirname, '../../packages/i18n/src/locales')
|
||||
|
||||
const koPath = path.join(localesDir, 'ko.json')
|
||||
const enPath = path.join(localesDir, 'en.json')
|
||||
|
||||
const ko = JSON.parse(fs.readFileSync(koPath, 'utf8'))
|
||||
const en = JSON.parse(fs.readFileSync(enPath, 'utf8'))
|
||||
|
||||
// GAP-UX-07: Align onboarding.llmModelSize with OllamaGuideModal (gemma4:e4b = ~4.0 GB)
|
||||
ko['onboarding.llmModelSize'] = '크기: 약 4.0GB — 네트워크 속도에 따라 3~10분 소요'
|
||||
en['onboarding.llmModelSize'] = 'Size: ~4.0GB — takes 3–10 min depending on network speed'
|
||||
|
||||
// Missing login.* keys in en.json
|
||||
const enLoginDefaults = {
|
||||
'login.apple': 'Continue with Apple',
|
||||
'login.or': 'or',
|
||||
'login.email': 'Email',
|
||||
'login.password': 'Password',
|
||||
'login.signIn': 'Sign in',
|
||||
'login.noAccount': "Don't have an account?",
|
||||
'login.signUp': 'Sign up',
|
||||
}
|
||||
for (const [k, v] of Object.entries(enLoginDefaults)) {
|
||||
if (!(k in en)) en[k] = v
|
||||
}
|
||||
|
||||
// GAP-LLM-01: Translation target language setting keys
|
||||
const targetLangKo = {
|
||||
'settings.targetLanguage': '번역 대상 언어',
|
||||
'settings.targetLanguage.desc': '번역 후처리와 {{targetLanguage}} 명령어에 쓸 언어입니다.',
|
||||
'settings.targetLanguage.en': '영어 (English)',
|
||||
'settings.targetLanguage.ko': '한국어 (Korean)',
|
||||
'settings.targetLanguage.ja': '일본어 (Japanese)',
|
||||
'settings.targetLanguage.zhCN': '중국어 간체 (Chinese Simplified)',
|
||||
'settings.targetLanguage.zhTW': '중국어 번체 (Chinese Traditional)',
|
||||
'settings.targetLanguage.es': '스페인어 (Spanish)',
|
||||
'settings.targetLanguage.fr': '프랑스어 (French)',
|
||||
'settings.targetLanguage.de': '독일어 (German)',
|
||||
'settings.targetLanguage.pt': '포르투갈어 (Portuguese)',
|
||||
'settings.targetLanguage.vi': '베트남어 (Vietnamese)',
|
||||
'settings.targetLanguage.id': '인도네시아어 (Indonesian)',
|
||||
'settings.targetLanguage.ar': '아랍어 (Arabic)',
|
||||
}
|
||||
|
||||
const targetLangEn = {
|
||||
'settings.targetLanguage': 'Translation target language',
|
||||
'settings.targetLanguage.desc': 'Language used for translation post-processing and {{targetLanguage}} commands.',
|
||||
'settings.targetLanguage.en': 'English',
|
||||
'settings.targetLanguage.ko': 'Korean',
|
||||
'settings.targetLanguage.ja': 'Japanese',
|
||||
'settings.targetLanguage.zhCN': 'Chinese (Simplified)',
|
||||
'settings.targetLanguage.zhTW': 'Chinese (Traditional)',
|
||||
'settings.targetLanguage.es': 'Spanish',
|
||||
'settings.targetLanguage.fr': 'French',
|
||||
'settings.targetLanguage.de': 'German',
|
||||
'settings.targetLanguage.pt': 'Portuguese',
|
||||
'settings.targetLanguage.vi': 'Vietnamese',
|
||||
'settings.targetLanguage.id': 'Indonesian',
|
||||
'settings.targetLanguage.ar': 'Arabic',
|
||||
}
|
||||
|
||||
Object.assign(ko, targetLangKo)
|
||||
Object.assign(en, targetLangEn)
|
||||
|
||||
// Ensure ko and en have identical key sets
|
||||
for (const k of Object.keys(ko)) {
|
||||
if (!(k in en)) {
|
||||
en[k] = ko[k]
|
||||
}
|
||||
}
|
||||
for (const k of Object.keys(en)) {
|
||||
if (!(k in ko)) {
|
||||
ko[k] = en[k]
|
||||
}
|
||||
}
|
||||
|
||||
const masterKeys = Object.keys(ko)
|
||||
|
||||
function writeOrderedJson(filePath, obj) {
|
||||
const ordered = {}
|
||||
for (const k of masterKeys) {
|
||||
ordered[k] = obj[k]
|
||||
}
|
||||
fs.writeFileSync(filePath, JSON.stringify(ordered, null, 2) + '\n', 'utf8')
|
||||
}
|
||||
|
||||
writeOrderedJson(koPath, ko)
|
||||
writeOrderedJson(enPath, en)
|
||||
|
||||
const otherLocales = ['ja', 'zh', 'zh-TW', 'es', 'fr', 'de', 'pt', 'ru', 'vi', 'th']
|
||||
for (const loc of otherLocales) {
|
||||
const locPath = path.join(localesDir, `${loc}.json`)
|
||||
const data = JSON.parse(fs.readFileSync(locPath, 'utf8'))
|
||||
for (const k of masterKeys) {
|
||||
if (!(k in data) || typeof data[k] !== 'string' || data[k].length === 0) {
|
||||
data[k] = en[k] ?? ko[k]
|
||||
}
|
||||
}
|
||||
writeOrderedJson(locPath, data)
|
||||
}
|
||||
|
||||
console.log(`Synchronized ${masterKeys.length} keys across 12 locales.`)
|
||||
Loading…
Add table
Add a link
Reference in a new issue