Skip to content

Enhance localization and improve device questionnaire handling#6

Merged
Andx667 merged 3 commits into
mainfrom
dev
May 13, 2026
Merged

Enhance localization and improve device questionnaire handling#6
Andx667 merged 3 commits into
mainfrom
dev

Conversation

@Andx667
Copy link
Copy Markdown
Collaborator

@Andx667 Andx667 commented May 13, 2026

Description

This pull request introduces improvements to localization handling, device questionnaire robustness, and test coverage. The most significant changes include ensuring all locales have complete key coverage with English as a fallback, improving the handling of missing devices in the questionnaire screen, and adding comprehensive tests for localization and device risk scoring logic.

Localization improvements:

  • Ensured all supported locales have a complete set of localization keys by merging each locale's keys with English defaults, and provided a method to retrieve the set of keys for each locale. (lib/l10n/app_localizations.dart) [1] [2] [3]
  • Added a test that verifies all supported locales have exactly the same keys as English, improving localization consistency. (test/app_localizations_test.dart)

Device questionnaire robustness:

  • Improved device lookup in the questionnaire screen to handle missing devices gracefully by displaying a loading indicator and navigating back if the device is not found, preventing crashes. (lib/screens/device_questionnaire_screen.dart) [1] [2]
  • Updated callbacks to pass the device instance explicitly, ensuring correct state updates and navigation. (lib/screens/device_questionnaire_screen.dart) [1] [2]

Test coverage enhancements:

  • Added tests to verify that all non-generic device questions have dedicated remedies and that "don't know" answers only trigger the generic learning action, improving the reliability of device risk scoring logic. (test/device_risk_scoring_test.dart)

Other changes:

  • Updated the app version to 1.0.0+5. (pubspec.yaml)
  • Simplified error handling for export failures in the summary screen. (lib/screens/summary_screen.dart)

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Documentation
  • Other:

Checklist

  • flutter analyze passes with no new issues
  • flutter test passes
  • New or updated strings have translations in all supported locales
  • Self-reviewed the diff

@Andx667 Andx667 merged commit 54ec2ef into main May 13, 2026
1 check passed
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