Streetcomplete: opening_hours uses localized number format

Created on 15 Oct 2018  ·  10Comments  ·  Source: westnordost/StreetComplete

The format string for opening_hours uses localized number format strings, resulting in unparseable data. Example:
Mo-Fr ٠٩:٠٠-١٨:٠٠; Sa ١٠:٠٠-١٣:٠٠
when it should have been
Mo-Fr 09:00-18:00; Sa 10:00-13:00

How to Reproduce
Switch device’s locale to a language that uses eastern arabic numerals, add opening hours to a shop and upload to OSM.

Versions affected
StreetComplete 8.1, Android 7.1.2

bug

Most helpful comment

It is impessive that you always act responsible for your app and fix all wrong tagging after an error.
A big thanks for that!

All 10 comments

Are these numerals also shown in the UI when selecting the time?

Yes, this is fine. I’m mainly concerned about what ends up in OSM’s database.

screenshot_ - png scaled
screenshot_ - png scaled

Ok, will solve this. The numerals need to be translated after selection. I wonder if I have to implement this myself (thinking that Arabic is certainly not the only language with own numerals) or if there is already something for that.

I doubt that’ll be necessary.
https://github.com/westnordost/StreetComplete/blob/e371bed9e4f6e7de92c3961de20af35193ec3270/app/src/main/java/de/westnordost/streetcomplete/quests/opening_hours/model/TimeRange.java#L75
does not pass a locale, thus the system’s locale settings are applied.
Explicitly selecting English should do the trick. The question is: Does
that affect the UI as well or just the data sent to OSM?

Thank you for the hint. This bug needs to stay open so I can clean up possible wrong taggings made by this app so far. (After all users have upgraded to the bugfixed version).

Oh, I overread your comment. Yes, it affects the UI. I should change that then.

I used this overpass-query to look for where it was tagged incorrectly

nwr[opening_hours~"[٠١٢٣٤٥٦٧٨٩۰۱۲۳۴۵۶۷۸۹۰۱۲۳۴۵۶۷۸۹௧௨௩௪௫௬௭௮௯०१२३४५६७८९੦੧੨੩੪੫੬੭੮੯૦૧૨૩૪૫૬૭૮૯০১২৩৪৫৬৭৮৯୦୧୨୩୪୫୬୭୮୯౦౧౨౩౪౫౬౭౮౯೦೧೨೩೪೫೬೭೮೯௦௧௨௩௪௫௬௭௮௯൦൧൨൩൪൫൬൭൮൯၀၁၂၃၄၅၆၇၈၉၁၀꧑꧒꧓꧔꧕꧖꧗꧘꧙០១២៣៤៥៦៧៨៩໐໑໒໓໔໕໖໗໘໙๐๑๒๓๔๕๖๗๘๙᠐᠑᠒᠓᠔᠕᠖᠗᠘᠙༠༡༢༢༣༤༥༦༧༨༩零〇一二三四五六七八九十零空一二三四五六七八九十영령공일이삼사오육륙칠팔구십〡〢〣〤〥〦〧〨〩〸〹〺א‬ב‬ג‬ד‬ה‬ו‬ז‬ח‬ט‬י‬აბგდევზჱთიԱԲԳԴԵԶԷԸԹԺ]"];
(._;>;);
out body;

The query also returns quite a few false-positives. Basically, there was only one survey in Germany and a few POIs in Iran and Saudi Arabia where a tagging with non-western numerals was made by StreetComplete.

Thanks :)

It is impessive that you always act responsible for your app and fix all wrong tagging after an error.
A big thanks for that!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

monikarora picture monikarora  ·  3Comments

nmxcgeo picture nmxcgeo  ·  3Comments

forteller picture forteller  ·  3Comments

ecksun picture ecksun  ·  3Comments

lost-geographer picture lost-geographer  ·  3Comments