Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: localeIdentifier not working in iOS #208

Closed
3 of 4 tasks
tomasAlabes opened this issue Feb 27, 2024 · 3 comments
Closed
3 of 4 tasks

[Bug]: localeIdentifier not working in iOS #208

tomasAlabes opened this issue Feb 27, 2024 · 3 comments
Assignees
Labels
platform: ios Issue is related to the iOS platform

Comments

@tomasAlabes
Copy link

tomasAlabes commented Feb 27, 2024

Please check the following before submitting a new issue.

Please select affected platform(s)

  • Android
  • iOS

Steps to reproduce

I believe this used to work recently.

final List<Placemark> placemarks = await placemarkFromCoordinates(
                52.36477, 4.88124,
                localeIdentifier: "en_US");

Expected results

{
      // ...
      "country": "Netherlands", 
}

Actual results

{
      // ...
      "country": "Nederland", 
}

Code sample

Code sample
final List<Placemark> placemarks = await placemarkFromCoordinates(
                52.36477, 4.88124,
                localeIdentifier: "en_US");

Screenshots or video

No response

Version

2.2.0

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.19.1, on macOS 14.3.1 23D60 darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2023.3.4)
[✓] VS Code (version 1.86.2)
[✓] Connected device (5 available)
[✓] Network resources

• No issues found!
@Mohamed-Nagdy
Copy link

I face the same issue in both android and iOS I provide the locale (ar) and it give me back the result in English

tomasAlabes added a commit to tomasAlabes/flutter-geocoding that referenced this issue Feb 29, 2024
@tomasAlabes
Copy link
Author

tomasAlabes commented Feb 29, 2024

@TimHoogstrate @mvanbeusekom this was introduced in this PR: #205

Version 2.2.0 breaks the localIdentifier feature. See geocoding.dart: https://github.com/Baseflow/flutter-geocoding/pull/205/files#diff-2b11c3984a637300869b693b92f909a812bfb0d028ead4d7959f2f90b4348bcb

@Mohamed-Nagdy, reverting to 2.1.1 "fixes" it.

@TimHoogstrate TimHoogstrate self-assigned this Mar 4, 2024
@TimHoogstrate TimHoogstrate added the platform: ios Issue is related to the iOS platform label Mar 4, 2024
@TimHoogstrate
Copy link
Contributor

Dear @tomasAlabes, @Mohamed-Nagdy,

It is expected behaviour. Recently the functionality for Android has been changed. As shown below (from the CHANGELOG) the locale is now set via a separate method. 'setLocaleIdentifier'.

CHANGELOG Android

## 3.0.0

* **BREAKING CHANGES**:
  * Updates `geocoding_platform_interface` to version 3.1.0.
  * Adds method `setLocaleIdentifier` to set the locale for all calls to the geocoding platform.
  * Removes the `localeIdentifier` argument from all methods. Use method `setLocaleIdentifier` to configure the locale.
* Implements `placemarkFromAddress`.

The locale should be set separately from version 2.2.0 by:

 /// Sets the locale identifier used for the geocoding.
  ///
  /// The `localeIdentifier` should be formatted using the syntax:
  /// [languageCode]_[countryCode] (eg. en_US or nl_NL).
  Future<void> setLocaleIdentifier(
    String localeIdentifier,
  ) {
    throw UnimplementedError(
        'setLocaleIdentifier() has not been implementated.');
  }

HOWEVER, apparently the functionality was not properly updated on iOS. Therefore I made two PR's (1) (#209) to update the functionality on iOS to make it in line with Android. (2) update the documentation (#210).

Kind regard,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: ios Issue is related to the iOS platform
Projects
None yet
Development

No branches or pull requests

4 participants