You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1.6 KiB

I18N Placeholder Remediation

This document records the repeatable steps used to detect and fix leftover English placeholder text and invalid-quote issues in translation map files under lib/core/translations/language/.

Problem Patterns

1) English placeholders inside non-English locales

Symptoms:

  • UI shows English strings in a non-English locale.
  • tools/i18n_audit.py --mode englishy reports items for a locale file.

Fix:

  • Replace English values with accurate localized text.
  • Keep placeholder syntax intact (examples: @minutes, {count}, {filePath}, {error}).

2) Invalid “smart quotes” used as Dart string delimiters

Symptoms:

  • flutter analyze reports illegal_character, expected_token, expression_in_map, undefined_identifier in a language file.

Root cause:

  • Curly quotes like ‘ ’ are not valid Dart string delimiters, so map entries stop being parsed as strings.

Fix:

  • Replace ‘ and ’ with ASCII ' and ensure every entry is in the form 'key': 'value',.

Verification Checklist

Run these commands from the repo root:

python3 tools/i18n_audit.py --mode englishy
flutter analyze lib/core/translations/language/<locale>.dart
dart format lib/core/translations/language/<locale>.dart
flutter test test/<locale>_translations_test.dart

Recommended additional checks:

rg "[‘’]" lib/core/translations/language/<locale>.dart

Test Convention

For each locale file, add a test/<locale>_translations_test.dart test that asserts:

  • The map can be imported and accessed.
  • Its key set matches enUS.
  • It contains no empty string values.