Skip to content

Added UserManager.setLocale#644

Merged
epou merged 1 commit intomainfrom
bug_fix_set_language
Nov 13, 2025
Merged

Added UserManager.setLocale#644
epou merged 1 commit intomainfrom
bug_fix_set_language

Conversation

@epou
Copy link
Member

@epou epou commented Nov 13, 2025

No description provided.

@epou epou requested a review from Copilot November 13, 2025 08:53
@epou epou self-assigned this Nov 13, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors locale management in the Mosquito Alert app by consolidating language and country code operations into a single setLocale method. The changes improve API design by accepting a Locale object instead of separate string parameters, and centralize locale identifier handling for the geocoding package.

Key changes:

  • Consolidated setLanguage and setLanguageCountry into a single setLocale(Locale) method
  • Moved locale identifier management for geocoding into UserManager
  • Removed deprecated getUserLocale method and its usage

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
lib/utils/UserManager.dart Added setLocale method that accepts a Locale object and handles locale identifier setup; made original setter methods private; removed getUserLocale method
lib/pages/settings_pages/settings_page.dart Updated to call setLocale with a Locale object instead of separate setLanguage and setLanguageCountry calls
lib/pages/my_reports_pages/detail/shared_report_widgets.dart Removed manual locale identifier setup since it's now handled in UserManager.setLocale


final String localeIdentifier =
countryCode != null ? '${languageCode}_$countryCode' : languageCode;
await setLocaleIdentifier(localeIdentifier); // From geolocator.
Copy link

Copilot AI Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected comment from 'geolocator' to 'geocoding' - the import at line 3 is package:geocoding/geocoding.dart, not geolocator.

Suggested change
await setLocaleIdentifier(localeIdentifier); // From geolocator.
await setLocaleIdentifier(localeIdentifier); // Set locale identifier.

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Nov 13, 2025

Codecov Report

❌ Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 25.66%. Comparing base (221e724) to head (d205884).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
lib/utils/UserManager.dart 0.00% 10 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #644      +/-   ##
==========================================
+ Coverage   25.45%   25.66%   +0.20%     
==========================================
  Files          25       25              
  Lines        1662     1664       +2     
==========================================
+ Hits          423      427       +4     
+ Misses       1239     1237       -2     
Flag Coverage Δ
unittests 25.66% <0.00%> (+0.20%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...my_reports_pages/detail/shared_report_widgets.dart 17.74% <ø> (+8.36%) ⬆️
lib/utils/UserManager.dart 15.15% <0.00%> (-4.21%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@epou epou added this pull request to the merge queue Nov 13, 2025
Merged via the queue into main with commit d8dfc4a Nov 13, 2025
6 checks passed
@epou epou deleted the bug_fix_set_language branch November 13, 2025 16:00
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.

2 participants