Skip to content

fix(l10n): extract hard-coded Flutter UI strings into ARB - #426

Open
blacktea1891 wants to merge 4 commits into
pounat:mainfrom
blacktea1891:l10n/extract-hardcoded-flutter-ui-pr1
Open

blacktea1891 wants to merge 4 commits into
pounat:mainfrom
blacktea1891:l10n/extract-hardcoded-flutter-ui-pr1

Conversation

@blacktea1891

Copy link
Copy Markdown
Contributor

Summary

Move 66 previously hard-coded English UI strings into app_en.arb and replace their Flutter call sites with the existing AppLocalizations API.

This covers 12 Flutter source files, including:

  • Home screen hints and remaining-time text
  • Library lists, item counts, and related actions
  • Settings labels and settings search entries
  • Administration screens, server logs, and library metadata cleanup dialogs
  • Card actions, tooltips, and feature hints

Placeholder metadata is included for strings with dynamic values.

Why

Some user-facing text still appears in English when another app language is selected, because the strings are not exposed to the Flutter localization system.

Extracting them into the English source ARB makes them available to all supported languages through the existing Crowdin workflow.

Changes

  • Add 66 English source localization keys and applicable placeholder definitions.
  • Replace the corresponding hard-coded English literals with localized lookups.
  • Preserve runtime values such as filenames, counts, and user-defined names.
  • Add English localization regression tests for placeholder interpolation.

Existing English source entries are unchanged. No translated ARB files are modified; translations can follow through Crowdin.

Testing

Validated in GitHub Actions: PR1 Flutter Validation — successful run.

  • flutter pub get — passed
  • flutter gen-l10n — passed
  • flutter test test/localization_source_strings_test.dart — passed
  • flutter analyze --no-pub (12 changed Flutter source files and the new test) — passed
  • flutter build apk --debug --flavor github — passed

The validation workflow lives only on a temporary test branch. Its source tree was checked against this PR branch; the only difference is the temporary GitHub Actions workflow file.

No manual device-level UI testing was performed.

Out of scope

  • Direct Simplified Chinese translation changes or bulk imports
  • Classic terminology and year-in-review localization
  • Android Auto / CarPlay strings
  • Background notification localization and native Android widgets
  • Unrelated responsive layout fixes
  • Personal APK build workflow

Related translation contribution discussion: #425 (not closed by this PR).

This is a focused first step in making remaining UI strings available to community translators.

blacktea1891 added a commit to blacktea1891/absorb that referenced this pull request Oct 14, 2026
Preserve upstream authentication settings, deferred library counts, BookOrbit features, and all extracted Flutter localization strings. Resolve admin navigation by retaining Authentication and localizing both Server logs labels.
blacktea1891 added a commit to blacktea1891/absorb that referenced this pull request Oct 14, 2026
Source tree matches the candidate PR merge exactly except for this temporary validation workflow. Run dependency resolution, localization generation, regression tests, changed-file analysis, and debug APK build before updating the original PR branch.
Keep all upstream features, the iOS Whisper GPU repair, and all 66 extracted Flutter localization strings. Resolve admin navigation by retaining Authentication and localizing both Server logs labels.

Flutter 3.47.7 validation passed: dependency resolution, localization generation, 4 localization regression tests, changed-file static analysis, and Android debug APK build.
https://github.com/blacktea1891/absorb/actions/runs/38488798572

Later upstream additions only changed the Whisper GPU workflow, iOS precompiled Metal resource, and version/beta markers; localization and application behavior source tested by the run is unchanged.
Retain upstream 1.12.1+300, including BookOrbit reading shelves, EPUB3 narration, Siri, and smart scopes. Resolve the home screen conflict by retaining the upstream hero shelf refactor and moving the localized resume hint into the shared shelf builder. Preserve all 66 extracted English strings and regression tests.

Tree verified byte-for-byte against the local Git three-way merge.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant