yourlabs / django-cities-light

A simple app providing three models: Country, Region and City model. Also provided, a command to insert or update data from geonames database dumps. Status: stable.
http://django-cities-light.rtfd.org/
MIT License
336 stars 126 forks source link

Translations not being populated, english instead #145

Open hectorcanto opened 7 years ago

hectorcanto commented 7 years ago

I'm using version 3.2 with Django 1.8.2. I've populated both to MySQL and SQLite.

I've stated in Django settings: CITIES_LIGHT_TRANSLATION_LANGUAGES = ['es'] But population is with English names and sources seem unaltered, as imported from cities_light module:

from cities_light import SOURCES

[u'http://download.geonames.org/export/dump/countryInfo.txt', u'http://download.geonames.org/export/dump/admin1CodesASCII.txt', u'http://download.geonames.org/export/dump/cities15000.zip', u'http://download.geonames.org/export/dump/alternateNames.zip']

I've also overridden the translation source but it didn't work either: CITIES_LIGHT_TRANSLATION_SOURCES = [u'http://download.geonames.org/export/dump/ES.zip']

Please, require any more information to understand the context

max-arnold commented 7 years ago

ES.zip contains features (not translations) for country with iso code ES. It should not be specified in TRANSLATION_SOURCES.

And TRANSLATION_LANGUAGES setting only affects alternate_names column in each table.

Could you please give an example (specific city with geoname_id) which you think should be translated to Spanish but isn't? You can search for this geoname_id in alternateNames.txt and check if there are any translations at all.

Also it would be nice to know your use case. How do you want your geo database to be translated? All cities in Spanish only? Each city in each language? Country-specific languages?

max-arnold commented 7 years ago

@hectorcanto ?

hectorcanto commented 7 years ago

Sorry for the long time without answering.

I was expecting the "names" to be translated - didn't read the documentation as thoroughly as I should - but as you @max-arnold points out, only alternate_name are translated.

At this point I may compromise by translating region and country only, which is reasonable for the case I'm working right now. My use case is that I would like users to be able to see cities in their own languages. Example:

At this point I can think in a few options:

So,

  1. Any recommendation or suggestion? Is there a better forum to continue this conversation - I believe is no longer
  2. Could be interesting to contribute a extension using for instance django-modeltranslations to download and populate translations for the translation languages? If it is that way, I'm willing to try.

Thanks in advance

max-arnold commented 7 years ago

Translation is hard, so before investing significant amount of time, I'd suggest to do two things:

  1. Have some stats about geonames data - % of translation coverage by language (separately for Country/Region/City and each language); also it would be useful to know if the geonames.org data has some information about official languages for each Country (for example, English and French are the official languages in Canada).

  2. Post your findings and possible approaches in the mailing list, so more people can chime in: https://groups.google.com/forum/#!forum/yourlabs