django-cities-light
django-cities-light copied to clipboard
Translations not being populated, english instead
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
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?
@hectorcanto ?
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:
- EN: Seville, Andalusia, Spain
- ES (Spanish): Sevilla, Andalucía, España
At this point I can think in a few options:
- Translate regions and countries with django translations
- Use django-cities, although I am reluctant because of the size of the app
- Use django-modeltranslations to provide a translation for each city
So,
- Any recommendation or suggestion? Is there a better forum to continue this conversation - I believe is no longer
- 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
Translation is hard, so before investing significant amount of time, I'd suggest to do two things:
-
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).
-
Post your findings and possible approaches in the mailing list, so more people can chime in: https://groups.google.com/forum/#!forum/yourlabs