Skip to content

Fixed nearby map not localized(Fixed #2335) #2504

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

Closed
wants to merge 1 commit into from

Conversation

zhao-gang
Copy link
Contributor

Description (required)

Fixes #2335

What changes did you make and why?

Correctly load wikimedia tiles. This seems made the map more localized.

Tests performed (required)

Tested master betaDebug on Nexus 6P with API level 27.

Screenshots showing what changed (optional - for UI changes)

before after after with French
before after after-french

It is clear that the map makes no changes with different android system language settings. But with wikimedia tiles correctly loaded, there are more localization data than before.

@nicolas-raoul
Copy link
Member

nicolas-raoul commented Feb 22, 2019

The "after with French" looks great, but the "after" is not correctly localized.
When displaying a map (even the map of Paris) in an English Android, the map should have labels in English.
On the opposite, when displaying a map of London in a French Android, it should show "Palais de Buckingham" and not "Buckingham Palace" (the underlying OpenStreetMap data has the labels for many languages).

@codecov-io
Copy link

codecov-io commented Feb 22, 2019

Codecov Report

Merging #2504 into master will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2504      +/-   ##
=========================================
- Coverage     2.7%   2.69%   -0.01%     
=========================================
  Files         258     258              
  Lines       12283   12301      +18     
  Branches     1113    1115       +2     
=========================================
  Hits          332     332              
- Misses      11925   11943      +18     
  Partials       26      26
Impacted Files Coverage Δ
.../fr/free/nrw/commons/nearby/NearbyMapFragment.java 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 44c18ac...0707671. Read the comment docs.

@zhao-gang
Copy link
Contributor Author

@nicolas-raoul I am not sure if it's possible with wikimedia tiles. I uploaded a screenshot of Wikimedia app nearby map, the map language in China Shenzhen is in Chinese even my Android system language is English. Also I checked Google Maps, it is more friendly localized but even it does not have much differences in English and French system languages in China Shenzhen city. Also I am not a map master and not sure if mapbox with wikimedia tiles can do things like Google Maps did.

wikimedia nearby with English google maps with English google maps with French
wikimedia-nearby-shenzhen google-maps-english google-maps-french

@maskaravivek
Copy link
Member

@zhao-gang Just wanted to check if this PR fixes the issue and is it ready for testing? :)

@zhao-gang zhao-gang changed the title Fixed wikimedia tiles not loaded in nearby map(Fixed #2335) Fixed nearby map not localized(Fixed #2335) Feb 25, 2019
@zhao-gang
Copy link
Contributor Author

@mashawan Yes. It can be tested. Also changed the PR's title to indicate what it really did.

@zhao-gang
Copy link
Contributor Author

This PR updated mapbox sdk version and added a new dependency to mapbox localization plugin. I checked the beta release apk size changed from 14883136 to 14962535. Just FYI :-)

@zhao-gang
Copy link
Contributor Author

After reading some documents I found it's easy to set preferred language for wikimedia tiles. It just needs to add a "?lang=xx" parameter to tiles url.

When loading the map, add the parameter according to user's Android system default Locale. By this way it's not needed to add mapbox localization plugin and also does not need to upgrade mapbox sdk.

…pp#2335)

Wikimedia tiles support adding a "?lang=xx" suffix to tiles url to set
preferred language. Use this feature to set the preferred language to
user's default Locale.
@nicolas-raoul
Copy link
Member

Could you please post new screenshots showing Paris in both French and English locales? Thanks :-)

@maskaravivek
Copy link
Member

Closing this as #2614 fixes the issue.

@nicolas-raoul
Copy link
Member

Thanks for your solution @zhao-gang , even though another solution got merged your contribution is very much appreciated! :-)

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.

4 participants