一键导入
ui-strings-management
Safe editing and validation of ui_strings.js — prevents JSON parse errors, verifies key coverage, handles nested section structure
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Safe editing and validation of ui_strings.js — prevents JSON parse errors, verifies key coverage, handles nested section structure
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
| name | ui-strings-management |
| description | Safe editing and validation of ui_strings.js — prevents JSON parse errors, verifies key coverage, handles nested section structure |
ui_strings.js is a pure JSON file fetched at runtime from raw.githubusercontent.com/Apomera/AlloFlow/main/ui_strings.js. The app calls JSON.parse() on it — any syntax error (e.g., trailing commas) causes a silent failure leaving UI_STRINGS empty and breaking all localized text.
After modifying ui_strings.js, always run this validation:
import json
with open('ui_strings.js', 'r', encoding='utf-8') as f:
content = f.read()
# Fix trailing commas (JSON doesn't allow them)
import re
fixed = re.sub(r',(\s*[\]}])', r'\1', content)
try:
data = json.loads(fixed)
print(f"✅ Valid JSON: {len(data)} top-level keys")
if fixed != content:
with open('ui_strings.js', 'w', encoding='utf-8') as f:
f.write(fixed)
print("⚠️ Fixed trailing commas and saved")
except json.JSONDecodeError as e:
print(f"❌ INVALID: {e.msg} at L{e.lineno}, col {e.colno}")
The file is a flat JSON object with nested sections:
{
"common": { "ok": "OK", "cancel": "Cancel", ... },
"settings": { "voice": { "label": "Voice" }, ... },
"word_sounds": { ... },
"adventure": { ... },
...
}
// or /* */\uD83C\uDFAF); use the actual emoji character insteadmainui_strings.js is the English master. There are 56 pre-built translation
packs in lang/*.js (mirrored to prismflow-deploy/public/lang/) that must
gain any key you add here, or non-English users see English fallback. The
toolchain (see dev-tools/i18n/README.md and lang/README.md for full detail):
npm run build:lang:resume — adds new keys to every existing pack via the
Gemini builder, preserving existing translations verbatim.npm run build:lang:manifest — regenerates lang/manifest.json.dev-tools/check_lang_json.cjs
(verify:translations-adjacent; ensures every pack is valid JSON) and
dev-tools/i18n/check_safety_string_spanglish.cjs (blocks half-translated
alerts.*/confirms.* safety strings)./submitTranslation) and are applied with
dev-tools/i18n/ingest_translation_feedback.cjs --apply (manual review gate).Document any {placeholders} on the source line — the builder and validators
key on them.
基于 SOC 职业分类
Development patterns for the AlloFlow monolith (AlloFlowANTI.txt) - auditing, refactoring, feature addition, debugging, and safe editing of the ~29K-line single-file React application
Safe editing and deployment of the CDN-loaded JavaScript feature modules (stem_lab, word_sounds, behavior_lens, report_writer, and ~250 others)
Full production deployment pipeline for AlloFlow — push, build, stamp, deploy, verify
How to extract a React component from AlloFlowANTI.txt into a standalone CDN-loaded module — JSX transpilation, dependency injection, IIFE wrapping, and registration
How to safely extract an inline STEM Lab tool from stem_lab_module.js into a standalone plugin file using window.StemLab.registerTool