[Geonames] Return localized city names

Bug #1324636 reported by David Planella on 2014-05-29
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Canonical System Image
High
David Planella
Ubuntu Clock App
Medium
Unassigned
Ubuntu Geonames
Undecided
Alan Pope ๐Ÿบ๐Ÿง๐Ÿฑ ๐Ÿฆ„

Bug Description

Right now the names of the cities to add to the world clock are in English. As it seems that geonames.org supports localized names using the 'lang' parameter, we should use the user's locale (Qt.locale().name) and set 'lang' when doing queries to their API.

A few caveats:

- lang only supports the language code, so the country code will need to be stripped out. E.g. Qt.locale().name returns 'ca_ES', but geonames.org only supports 'ca'. It's not clear how they support zh_CN vs. zh_TW
- It seems that if name_startsWith is specified in the query, the English names instead of the localized ones are returned
- To display the localized results in the app, we should be using name instead of the current toponymName

[1] http://www.geonames.org/export/geonames-search.html

David Planella (dpm) on 2014-05-29
Changed in ubuntu-clock-app:
status: New → Triaged
importance: Undecided → Medium
tags: added: bitesize touch-cn
David Planella (dpm) on 2014-05-29
description: updated
Nekhelesh Ramananthan (nik90) wrote :

I remember riccardo bringing this up in the previous cycle. The issue here is that the languages that geonames support are limited. So we could hit a language used by the user that is not supported by geonames. What do you recommend we do in those cases?

David Planella (dpm) wrote :

If the language is not supported, then the fallback in geonames.org is to return the result in English. While not optimal, that's still better than the current situation, since we'd at least return the localized results for those languages that are supported at geonames.org. The unsupported ones would get returns in English just as today.

TBH, I'd like to use a better service, as the support for Chinese it's not too good (it does not make a distinction between Simplified and Traditional), but at a quick glance I've not found any other non-commercial alternative.

Changed in canonical-devices-system-image:
assignee: nobody → David Planella (dpm)
importance: Undecided → High
milestone: none → ww09-2015
status: New → Confirmed
Changed in ubuntu-clock-app:
assignee: nobody → Nekhelesh Ramananthan (nik90)
milestone: none → ota-1
Nekhelesh Ramananthan (nik90) wrote :

@david, Hmm while you are correct that when looking at [1] it does provide the "lang" argument which one can use to return localized results from the official geonames.org website. However clock app and the weather app were asked to switch to ubuntu geonames where the url we use for searching is [2] and it does not seem to support the "lang" parameter. Or may be I am missing something?

So do we switch back from ubuntu geonames to geonames.org? Please let me know how I can proceed since it took a lot of effort by IS and alan pope to set up ubuntu geonames specifically for the clock and weather app.

[1] http://www.geonames.org/export/geonames-search.html
[2] http://geoname-lookup.ubuntu.com/?query=delhi

David Planella (dpm) wrote :

I think we need to stick to Ubuntu geonames, so that we have control of the number of queries and we're not shut down for exceeding limits.

As I understand it, after the initial effort it should be easier to modify Ubuntu geonames. Alan, could you perhaps look at what it would take to add the 'lang' parameter to Ubuntu geonames, so that we can return localized cities?

Nekhelesh Ramananthan (nik90) wrote :

#blocked until ubuntu geonames supports returning localized search results.

Changed in ubuntu-geonames:
status: New → Confirmed
Changed in canonical-devices-system-image:
milestone: ww09-2015 → ww13-2015
Changed in canonical-devices-system-image:
milestone: ww13-2015 → ww17-2015
Changed in canonical-devices-system-image:
milestone: ww17-2015 → ww21-2015
status: Confirmed → Incomplete
Pat McGowan (pat-mcgowan) wrote :

can we get this assigned to someone?

Changed in canonical-devices-system-image:
milestone: ww21-2015 → none
Changed in ubuntu-geonames:
assignee: nobody → Alan Pope ๎ƒฟ (popey)
Changed in ubuntu-clock-app:
milestone: 3.3 → 3.4
Changed in ubuntu-clock-app:
assignee: Nekhelesh Ramananthan (nik90) → nobody
Changed in ubuntu-clock-app:
milestone: 3.4 → 3.5
summary: - Return localized city names
+ [Geonames] Return localized city names
Changed in ubuntu-clock-app:
milestone: 3.5 → 3.6
Changed in ubuntu-clock-app:
milestone: 3.6 → 3.x.backlog
Changed in ubuntu-clock-app:
status: Triaged → Incomplete
TarotChen (tarotchen) on 2016-06-03
tags: added: l10n zh
Changed in canonical-devices-system-image:
milestone: none → 12
no longer affects: band-aids-uphone
Pat McGowan (pat-mcgowan) wrote :

moving tounscheduled backlog to match the clock app

Changed in canonical-devices-system-image:
milestone: 12 → backlog
Doctor Rover (doctor-rover) wrote :

I encountered an issue which seems to be related to this bug. The matter is that cities in the list of the Clock App are sorted by their English names, though they are displayed in Russian (which is the system language). For example, ะŸะตะบะธะฝ (Beijing in Russian) goes before ะ‘ั€ัŽััะตะปัŒ (Brussels) which is correct for English but wrong for Russian.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers