Skip to content

Refactor Translation Values to Use Natural Casing (Avoid ALL CAPS in .arb Files) #2794

@mariobehling

Description

@mariobehling

Currently, many translation values in the .arb files (e.g. oscilloscope, multimeter, etc.) are written in ALL CAPS. This practice is not recommended for the following reasons:

Problems with ALL CAPS in .arb Files

  • Reduces accessibility: screen readers may misread or skip fully capitalized text
  • Limits flexibility: cannot style text differently for various UI contexts
  • Confuses translators: capitalization rules vary by language
  • Pollutes generated Dart files: localization comments reflect the ALL CAPS

Recommended Changes

  1. Update all strings in .arb files from ALL CAPS to natural casing:

    • Example:

      "oscilloscope": "Oscilloscope"

      instead of

      "oscilloscope": "OSCILLOSCOPE"
  2. Apply styling in UI code, not in localization:

    • Use .toUpperCase() in widgets where uppercase is needed visually.
    • Avoid hardcoding casing into translations.
  3. Regenerate the Dart localization files:

    • Use flutter gen-l10n after updating the .arb files.

    • This will reflect correct casing in:

      /// In en, this message translates to:
      /// **'Oscilloscope'**

Benefits

  • Clean and accessible translation files
  • Proper styling separation (translation vs. presentation)
  • Easier for translators and contributors to understand
  • Future-proof localization setup across languages and devices

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions