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

Fallback to hardcoded units in browsers without NumberFormat support in ScaleControl #12068

Merged
merged 5 commits into from
Jul 8, 2022

Conversation

stepankuzmin
Copy link
Contributor

@stepankuzmin stepankuzmin commented Jul 7, 2022

This PR reverts i18n support added in #11850 due to the lack of support in Safari <14.1 #12021
Closes #12021

Screen Shot 2022-07-07 at 15 45 15

Launch Checklist

  • briefly describe the changes in this PR
  • manually test the debug page
  • apply changelog label ('bug', 'feature', 'docs', etc) or use the label 'skip changelog'
  • add an entry inside this element for inclusion in the mapbox-gl-js changelog: <changelog>Add a workaround in ScaleControl to support localization in browsers without NumberFormat support</changelog>

@stepankuzmin stepankuzmin added bug 🐞 skip changelog Used for PRs that do not need a changelog entry labels Jul 7, 2022
@mourner
Copy link
Member

mourner commented Jul 7, 2022

Given that browser share for Safari <= 14.0 is marginal, should we instead consider the option of simply showing non-localized scale (English) for unsupported browsers? I think the tradeoff might be worth, since we'd otherwise have to support manual translation of all these strings across all languages in the future.

@stepankuzmin
Copy link
Contributor Author

Yep, we can do that 👍

Copy link
Contributor

@ansis ansis left a comment

Choose a reason for hiding this comment

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

Looks good to me!

Can you do two small things before merging?

  • edit the title to reflect that this isn't a full reversion (new approach still exists)
  • add a changelog entry documenting the fix (since we released the bug)

@stepankuzmin stepankuzmin changed the title Revert i18n support in ScaleControl Fallback to hardcoded units in browsers without NumberFormat support in ScaleControl Jul 8, 2022
@stepankuzmin stepankuzmin merged commit d821c49 into main Jul 8, 2022
@stepankuzmin stepankuzmin deleted the revert-i18n-in-scale-control branch July 8, 2022 14:02
karimnaaji pushed a commit that referenced this pull request Jul 14, 2022
…t in `ScaleControl` (#12068)

Add a workaround in ScaleControl to support localization in browsers without NumberFormat support

Co-authored-by: Ansis Brammanis <[email protected]>
karimnaaji added a commit that referenced this pull request Jul 14, 2022
* Fallback to hardcoded units in browsers without `NumberFormat` support in `ScaleControl` (#12068)

Add a workaround in ScaleControl to support localization in browsers without NumberFormat support

Co-authored-by: Ansis Brammanis <[email protected]>

* Fix GeolocateControl in Safari (#12080)

* fix GeolocateControl in Safari

* update geolocate unit test to cover the fix

Co-authored-by: Stepan Kuzmin <[email protected]>
Co-authored-by: Ansis Brammanis <[email protected]>
Co-authored-by: Volodymyr Agafonkin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 skip changelog Used for PRs that do not need a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Safari exceptions < 14.1 with NumberFormat
3 participants