M3 Diagnostic: Software & Data Logic Pre-Flight Check
This multi-part exercise tests your ability to detect and remediate software data logic traps: eliminating illegal string concatenation, enforcing variable symmetry across source and target languages, refactoring naive plural rules into standardized ICU MessageFormat, and validating nested ICU select gender and context structures in VS Code.
Overview & Objective
Before advancing to Module 4, you must complete this Module 3 Diagnostic Pre-Flight Check.
This multi-part exercise tests your ability to detect and remediate software data logic traps: eliminating illegal string concatenation, enforcing variable symmetry across source and target languages, refactoring naive plural rules into standardized ICU MessageFormat, and validating nested ICU select gender and context structures in VS Code.
Scenario Briefing
You are reviewing localized string tables prior to an international launch across three platforms:
Mobile Banking App (UI): Japanese target strings fail runtime variable interpolation due to altered placeholder names (
{userName}instead of{username}) and broken string concatenation.E-Commerce Shopping Cart (Software): Polish target string tables display incorrect plural forms ("5 pliki" instead of "5 plików") because the backend uses naive English two-state singular/plural logic.
RPG Game Character System (Game UI): Spanish achievement banners throw runtime parser errors and display gender-mismatched text ("Bienvenido" shown to female players) due to broken ICU
selectsyntax and missing fallback blocks.
Your task is to open the diagnostic workspace in VS Code, identify the logic defects, apply the proper ICU and variable remediation workflows, and verify all assets against production quality standards.
Part 1: Hands-On Diagnostic Execution
Step 1: Environment Setup
Open your
loc_labworking folder in Visual Studio Code (Cmd + Oon macOS /Ctrl + K Ctrl + Oon Windows).Inside
assets/loc/software/, create a diagnostic folder namedmodule_3_diagnostic.
Step 2: Diagnosing & Repairing Asset #1 (Variable Symmetry & Syntax)
File Location:
assets/loc/software/module_3_diagnostic/banking_ja.jsonDefect: Variable casing mismatch and positional placeholder reordering.
Create
banking_ja.jsonand paste the broken translation asset:JSON
banking_ja.jsonjson{ "welcome_banner": "お帰りなさい、{userName}様!", "transfer_status": "{recipient} へ {amt} の送信が完了しました。", "page_counter": "{0} ページ / 全 {1} ページ" }Open
en_source.jsonfrom Lab 3.1 side-by-side using Split Editor (Cmd + \on macOS /Ctrl + \on Windows).Compare variable identifiers:
Line 2 (
welcome_banner): Correct{userName}to match source{username}verbatim.Line 3 (
transfer_status): Correct{amt}to match source{amount}verbatim.Line 4 (
page_counter): Update positional placeholders to natural Japanese word order using indexed arguments:"全 {1} ページ中 {0} ページ".
Save the corrected file as
banking_ja_clean.json.
Step 3: Diagnosing & Repairing Asset #2 (Slavic ICU Plural Rules)
File Location:
assets/loc/software/module_3_diagnostic/cart_pl.jsonDefect: Missing Polish CLDR plural categories (
few,many).
Create
cart_pl.jsonand paste the incomplete ICU plural asset:JSON
cart_pl.jsonjson{ "cart_status": "{itemCount, plural, one {Masz # koszyk.} other {Masz # pliki.}}" }Identify why this fails in production: Polish requires 4 CLDR categories (
one,few,many,other) to account for numbers ending in 2–4 (2 koszyki) vs. 5–20 (5 koszyków).Refactor the string to include all mandatory Polish CLDR categories and an explicit
=0override:JSON
cart_pl.jsonjson{ "cart_status": "{itemCount, plural, =0 {Twój koszyk jest pusty.} one {Masz # koszyk.} few {Masz # koszyki.} many {Masz # koszyków.} other {Masz # koszyków.}}" }Save the file.
Step 4: Diagnosing & Repairing Asset #3 (Nested ICU Select & Gender)
File Location:
assets/loc/software/module_3_diagnostic/game_es.jsonDefect: Unbalanced braces and missing
otherfallback block in nested ICUselect/pluralmessage.
Create
game_es.jsonand paste the broken asset:JSON
game_es.jsonjson{ "achievement_msg": "{gender, select, female {¡Bienvenida! Has desbloqueado {count, plural, one {# logro} other {# logros}}.} male {¡Bienvenido! Has desbloqueado {count, plural, one {# logro} other {# logros}}.}" }Inspect the brace count and fallback structure:
Brace Defect: Count the opening braces
{(8) versus closing braces}(7). The outerselectblock is missing a closing brace at the end of the line.Fallback Defect: The outer
selectblock is missing the mandatoryothercategory fallback for neutral/unspecified gender values.
Remediate
game_es.jsonby adding theotherfallback block and balancing all braces:JSON
game_es.jsonjson{ "achievement_msg": "{gender, select, female {¡Bienvenida! Has desbloqueado {count, plural, one {# logro.} other {# logros.}}} male {¡Bienvenido! Has desbloqueado {count, plural, one {# logro.} other {# logros.}}} other {¡Te damos la bienvenida! Has desbloqueado {count, plural, one {# logro.} other {# logros.}}}}" }Place your cursor next to the first brace
{in VS Code and verify that all 3 nested brace pairs match cleanly. Save the file.
Part 2: Auto-Graded Diagnostic Quiz
Answer the following questions based on your completed diagnostic execution.
Loading interactive content…
Diagnostic Verification Checklist
[ ]
banking_ja_clean.jsonmatches source variable names verbatim ({username},{amount}) and uses indexed positional placeholders ({0},{1}).[ ]
cart_pl.jsonimplements all required Polish CLDR categories (one,few,many,other) inside valid ICU syntax.[ ]
game_es.jsoncontains balanced curly braces across all nested depth layers and includes the mandatoryotherfallback block.[ ] All quiz questions completed with 100% verification accuracy.
Ready to move on?
Mark this lesson complete when you’re ready.