You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add English and Chinese internationalization with persistent language selection - #27
Introduce Flutter's standard ARB / gen-l10n localization pipeline with 701 messages in both Simplified Chinese and English.
Add immediate, persistent language selection: system default, Simplified Chinese, or English. Unsupported system languages fall back to English.
Localize navigation, all 30 operation pages and their tabs, dialogs, warnings, validation, framework widgets, command help, and dump analysis.
Store write-back status and per-block outcomes independently of the locale, so active, finished, cancelled, and connection-lost sequences follow language changes without losing results or restarting commands.
Distinguish DESFire Applications from Apply and HID reader brute-force from cryptographic key recovery. Preserve the active language during command-card imports and report language-storage failures in Settings without blocking startup or later save retries.
Keep standalone Dart tools framework-free by adapting Flutter localizations at the backend boundary.
Preserve PM3 command syntax, raw client output, serialized data formats, existing client settings, and in-progress UI data.
Update both READMEs, synchronized HTML snapshots, contributor guidance, localization/storage/tooling documentation, and clearly marked historical specifications. Add translation checks to CI and focused bilingual regression coverage.
Upstream compatibility
Based directly on upstream main (b7464cf), with no intervening fork-only commits.
Keep documentation upstream-neutral. Generated localization Dart files, build outputs, firmware, card data, and machine-specific SDK configuration are not included.
Validation
Latest follow-up validation on Windows:
Localization generation succeeded; the resource checker reports 701 complete messages per language.
Static analysis of the changed application and regression-test Dart files reported no issues.
40 related localization, write-state, session, and UI tests passed. Coverage includes Chinese -> English -> Chinese switching through Settings with a loaded dump, retained mixed block results, active writes, cancellation, connection loss, dedicated HID labels, and unchanged command syntax.
Earlier PR validation, before the latest HID/write-progress fixes:
All six standalone Dart tools compiled successfully; write-producing generators were compiled rather than executed.
A Windows release build completed using Flutter 3.47.7 / Dart 3.13.5; it has not been rebuilt for these latest follow-ups.
An earlier full-suite run had 80 passing tests. Subsequent runs exposed an intermittent existing Windows batch-handshake test; the same failure was reproduced using the unchanged upstream backend and fixture.
Linux builds and real-device operations were not run locally. The existing Windows/Linux CI workflow is retained. Widget-test viewports and limitations are documented in docs/localization.md.
Use Flutter ARB generation with persistent language selection, localized command help and dump analysis, bilingual UI coverage, and translation documentation.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds English and Simplified Chinese localization to the Flutter desktop client, with persistent language selection and integration across UI, command help, and application-generated messages.
Changes:
Introduces ARB generation, locale management, and separate language-preference storage.
Localizes pages, shared widgets, validation, and dump analysis while retaining command syntax and raw output.
Adds bilingual tests, translation checks in CI, and contributor documentation.
File
Description
tools/check_localizations.dart
Checks translation completeness and metadata.
test/ui/settings_page_test.dart
Uses the localized test wrapper.
test/ui/page_output_test.dart
Runs output tests with localization delegates.
test/ui/command_card_editor_test.dart
Provides localization for editor tests.
test/support/localized_test_app.dart
Adds a localized wrapper and in-memory preferences.
test/l10n/localization_test.dart
Covers bilingual rendering, switching, and analysis.
test/l10n/app_locale_controller_test.dart
Tests preference persistence and error handling.
README.md
Documents language selection and development setup.
README.en.md
Adds English usage and development instructions.
pubspec.yaml
Enables localization generation and dependencies.
pubspec.lock
Records localization and updated dependency versions.
lib/ui/widgets/command_card_editor.dart
Localizes draft editing and export controls.
lib/ui/pages/trace_page.dart
Localizes trace controls.
lib/ui/pages/terminal_page.dart
Localizes controls and reloads language-specific help.
lib/ui/pages/settings_page.dart
Adds language selection and persistence feedback.
lib/ui/pages/script_page.dart
Localizes script controls.
lib/ui/pages/nfc_page.dart
Localizes NFC decoding controls.
lib/ui/pages/mifare_page.dart
Localizes MIFARE operations and warnings.
lib/ui/pages/lf_pyramid_page.dart
Localizes Pyramid operations.
lib/ui/pages/lf_page.dart
Localizes general low-frequency operations.
lib/ui/pages/lf_keri_page.dart
Localizes Keri operations.
lib/ui/pages/lf_io_page.dart
Localizes ioProx operations.
lib/ui/pages/lf_indala_page.dart
Localizes Indala operations.
lib/ui/pages/lf_hitag_page.dart
Localizes Hitag operations.
lib/ui/pages/lf_hid_page.dart
Localizes HID operations and tabs.
lib/ui/pages/lf_fdxb_page.dart
Localizes FDX-B operations.
lib/ui/pages/lf_awid_page.dart
Localizes AWID operations.
lib/ui/pages/hf_sniff_page.dart
Localizes capture and tuning controls.
lib/ui/pages/hf_seos_page.dart
Localizes SEOS operations.
lib/ui/pages/hf_mfu_page.dart
Localizes Ultralight/NTAG operations and confirmations.
lib/ui/pages/hf_mfdes_page.dart
Localizes DESFire operations and tabs.
lib/ui/pages/hf_legic_page.dart
Localizes Legic operations and confirmations.
lib/ui/pages/hf_iclass_page.dart
Localizes iCLASS operations.
lib/ui/pages/hf_fido_page.dart
Localizes FIDO operations.
lib/ui/pages/hf_felica_page.dart
Localizes FeliCa operations.
lib/ui/pages/hf_emv_page.dart
Localizes EMV operations.
lib/ui/pages/hf_15_page.dart
Localizes ISO 15693 operations.
lib/ui/pages/hf_14b_page.dart
Localizes ISO 14443-B operations.
lib/ui/pages/dump_compare_page.dart
Localizes comparison labels and errors.
lib/ui/pages/data_page.dart
Localizes data-processing controls.
lib/ui/pages/connection_page.dart
Localizes connection and file-management UI.
lib/ui/home_page.dart
Localizes navigation and connection status.
lib/ui/components/result_display.dart
Localizes result controls without translating output.
lib/ui/components/hex_input_field.dart
Localizes input hints and limits.
lib/ui/components/connection_guard.dart
Localizes readiness warnings.
lib/state/hardware_state.dart
Makes smartcard status locale-aware.
lib/state/file_state.dart
Localizes scan-failure messages.
lib/state/connection_state.dart
Propagates localization and formats settings errors.
lib/state/app_state.dart
Propagates localization and translates write progress.
lib/services/pm3_command_catalog.dart
Supports injected asset bundles and language-specific loading.
lib/services/locale_settings_store.dart
Persists language preferences separately.
lib/services/dump_converter.dart
Adds localized format labels and conversion messages.
lib/parsers/key_parser.dart
Localizes key-text validation errors.
lib/parsers/dump_parser.dart
Makes analysis caching locale-aware.
lib/models/dump_analysis.dart
Localizes analysis descriptions.
lib/models/command_card.dart
Localizes card validation and export errors.
lib/main.dart
Connects locale selection, delegates, and shutdown flushing.
lib/l10n/localized_messages.dart
Adds shared localization support for non-UI objects.
Inject framework-independent process messages and adapt AppLocalizations only in the Flutter-facing backend. Preserve standalone Chinese defaults and cover the real Dart CLI entry points and live GUI language changes.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Convert directory lookup failures to handled storage errors
lib/services/locale_settings_store.dart:23
If getApplicationSupportDirectory() cannot resolve a directory, it throws MissingPlatformDirectoryException, not FileSystemException. This escapes the controller's handlers, and main() awaits initialization before runApp(), so the UI never starts instead of showing a Settings error. A directory-lookup failure during saving also leaves the save queue failed and blocks later saves. Convert directory-provider exceptions to a storage exception that the controller already handles.
Copy active localizations to both staging cards before validating imported data. Add English regressions for invalid blocks, Key A and Key B in draft and card imports, including atomicity and retained language checks.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add a separate Applications tab resource in English and Chinese without changing the editor Apply action. Cover both locales with widget regressions and document distinct resources for different meanings.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Unhandled preference-directory exceptions can prevent startup and leave subsequent language saves unable to recover.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Handle missing application support directory during settings I/O
lib/services/locale_settings_store.dart:21
getApplicationSupportDirectory() can throw MissingPlatformDirectoryException, which is not caught by the controller's FileSystemException/FormatException handlers. During restore, this prevents startup because main() awaits initialization before runApp(). During saving, it leaves _queue failed; later selections fail at await previous, skip cleanup, and leave the saving indicator active. Normalize directory-provider exceptions here so both paths report a Settings error, startup can continue, and later saves can recover.
Normalize path-provider directory failures to FileSystemException while preserving diagnostics and stack traces. Keep initialization and failed saves on the controller handled storage-error path, with coverage for startup, Settings errors, queued saves and successful retries.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Existing write-progress messages remain in the previous language after switching, leaving live localization incomplete.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Refresh write progress and results when the locale changes
lib/state/app_state.dart:322
Write-progress status and per-block results are stored as translated strings, but updateLocalizations does not refresh them. Complete or cancel a write in Chinese, switch to English in Settings, and return to the write-back tab: DumpViewer still displays progress.currentStatus and r.message verbatim in Chinese. Store locale-independent status/result data and format it with the current locale when displayed, so switching languages updates existing progress without losing results.
Refresh user and contributor guidance, language storage and standalone-tool contracts, and generated HTML snapshots. Add a documentation index, distinguish historical designs from current implementation, and record the outstanding HID wording issue without modifying functional code.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use dedicated HID reader brute-force resources and format stored write states and block outcomes with the current locale. Add bilingual regression coverage and refresh related documentation.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Store process error kinds and arguments and render them through the active framework-free message adapter. Cover Settings language switching after connection failure without reconnecting or rewriting terminal output, including startup and lifecycle diagnostics.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Format retained save confirmations with the current locale while preserving cancellation, status clearing and error replacement. Add regression coverage and replace stale localization anchors and the outdated HID status note, including the synchronized README HTML snapshot.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Cross-cutting locale propagation, persistence, and active device-state changes need final human review supported by current Windows and Linux validation.
Add the parallel docs.en tree and English root-document counterparts. Use README.en.md and README.en.html for the full English guide, retain the shorter guide as README.quickstart.en.md, and synchronize README navigation, cross-references and HTML snapshots. Preserve Chinese document bodies.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The cross-cutting UI, persistence, and backend integration needs final human review with current Windows and Linux validation evidence.
No open issues 🎉
Review effort: Balanced
This branch has not been deployed
No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gen-l10nlocalization pipeline with 701 messages in both Simplified Chinese and English.Upstream compatibility
main(b7464cf), with no intervening fork-only commits.Validation
Latest follow-up validation on Windows:
git diff --checkpassed.Commands:
Earlier PR validation, before the latest HID/write-progress fixes:
Linux builds and real-device operations were not run locally. The existing Windows/Linux CI workflow is retained. Widget-test viewports and limitations are documented in
docs/localization.md.