Skip to content

Improve ARB Translation File: Consistency, ICU Plurals, Cleanup, and Style Rules #189

@mariobehling

Description

@mariobehling

The current fossasia-magic-epaper-app-en.arb translation file requires cleanup and improvements for maintainability, proper i18n support, and translator usability.

Tasks

  • Change the following

    • Buy Badge - "Get badge"
    • Contact with us - "Contact us"
  • Unify terminology and capitalization

    • Use Wi-Fi consistently instead of mixed WiFi/WIFI.
    • Use NFC tag consistently (lowercase “tag” when part of running text).
    • Replace Magic ePaper HardwareMagic ePaper device.
    • Standardize labels/buttons in sentence case.
  • Pluralize with ICU syntax
    Merge duplicate keys such as:

    • imageDeletedSuccessfully / imagesDeletedSuccessfully
    • deletingImage / deletingImages
    • failedToDeleteImage / failedToDeleteImages
      into one ICU plural message with a {count} placeholder.
  • Add @metadata for placeholders
    Define descriptions and types for all placeholder variables ({count}, {reason}, etc.).

  • Improve error messages
    Change messages like Error creating Wi-Fi record: to include a placeholder for reason:

    "errorCreatingWifiRecord": "Error creating Wi-Fi record: {reason}.",
    "@errorCreatingWifiRecord": {
      "description": "Shown when a Wi-Fi NDEF record cannot be created",
      "placeholders": { "reason": { "type": "String" } }
    }
  • Consistency in punctuation

    • Full stop (.): for complete sentences like errors, confirmations, info messages (“Error creating Wi-Fi record: {reason}.”).
    • Question mark (?): for confirmations and questions (“Are you sure you want to delete this image?”).
    • No punctuation: for labels, buttons, and short status texts (“Write NFC tag”, “Processing image”).
  • Consistency in capitalization

    • Use sentence case everywhere (e.g. Write NFC tag, not Write NFC Tag).
    • Keep acronyms uppercase (NFC, URL, SSID).
    • Keep Wi-Fi hyphenated and capitalized correctly.
    • Keep Magic ePaper capitalized as a brand/product name.
  • Fix capitalization after full stops and question marks
    Ensure every new sentence starts with a capital letter.

    • Example: “Data is too short. Minimum length for…” (not “minimum length”).

Example Fixes

"areYouSureDeleteMultipleImages": "{count, plural, one {Are you sure you want to delete this image? This action cannot be undone.} other {Are you sure you want to delete these # images? This action cannot be undone.}}",
"@areYouSureDeleteMultipleImages": {
  "description": "Confirmation dialog when deleting images",
  "placeholders": { "count": { "type": "int" } }
}
"errorCreatingWifiRecord": "Error creating Wi-Fi record: {reason}.",
"@errorCreatingWifiRecord": {
  "description": "Shown when a Wi-Fi record cannot be created",
  "placeholders": { "reason": { "type": "String" } }
}

Outcome

  • Cleaner, more maintainable ARB files
  • Easier translation process
  • Better UX consistency across the app
  • Clear punctuation and sentence case policy for translators and contributors
  • No more lowercase starts after periods or question marks

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