Bakerversity
Module 3: How Software Organizes Human IdeasLesson 8 of 8

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:

  1. Mobile Banking App (UI): Japanese target strings fail runtime variable interpolation due to altered placeholder names ({userName} instead of {username}) and broken string concatenation.

  2. 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.

  3. 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 select syntax 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

  1. Open your loc_lab working folder in Visual Studio Code (Cmd + O on macOS / Ctrl + K Ctrl + O on Windows).

  2. Inside assets/loc/software/, create a diagnostic folder named module_3_diagnostic.

Step 2: Diagnosing & Repairing Asset #1 (Variable Symmetry & Syntax)

  • File Location: assets/loc/software/module_3_diagnostic/banking_ja.json

  • Defect: Variable casing mismatch and positional placeholder reordering.

  1. Create banking_ja.json and paste the broken translation asset:

    JSON

    banking_ja.jsonjson
    { "welcome_banner": "お帰りなさい、{userName}様!", "transfer_status": "{recipient} へ {amt} の送信が完了しました。", "page_counter": "{0} ページ / 全 {1} ページ" }
  2. Open en_source.json from Lab 3.1 side-by-side using Split Editor (Cmd + \ on macOS / Ctrl + \ on Windows).

  3. 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} ページ".

  4. 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.json

  • Defect: Missing Polish CLDR plural categories (few, many).

  1. Create cart_pl.json and paste the incomplete ICU plural asset:

    JSON

    cart_pl.jsonjson
    { "cart_status": "{itemCount, plural, one {Masz # koszyk.} other {Masz # pliki.}}" }
  2. 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).

  3. Refactor the string to include all mandatory Polish CLDR categories and an explicit =0 override:

    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.}}" }
  4. Save the file.

Step 4: Diagnosing & Repairing Asset #3 (Nested ICU Select & Gender)

  • File Location: assets/loc/software/module_3_diagnostic/game_es.json

  • Defect: Unbalanced braces and missing other fallback block in nested ICU select/plural message.

  1. Create game_es.json and 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}}.}" }
  2. Inspect the brace count and fallback structure:

    • Brace Defect: Count the opening braces { (8) versus closing braces } (7). The outer select block is missing a closing brace at the end of the line.

    • Fallback Defect: The outer select block is missing the mandatory other category fallback for neutral/unspecified gender values.

  3. Remediate game_es.json by adding the other fallback 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.}}}}" }
  4. 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.json matches source variable names verbatim ({username}, {amount}) and uses indexed positional placeholders ({0}, {1}).

  • [ ] cart_pl.json implements all required Polish CLDR categories (one, few, many, other) inside valid ICU syntax.

  • [ ] game_es.json contains balanced curly braces across all nested depth layers and includes the mandatory other fallback block.

  • [ ] All quiz questions completed with 100% verification accuracy.


Ready to move on?

Mark this lesson complete when you’re ready.

→ Sign in to track your progress