Skip to content
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

Alternate Names not created for regions #274

Open
mi01 opened this issue Nov 3, 2022 · 2 comments
Open

Alternate Names not created for regions #274

mi01 opened this issue Nov 3, 2022 · 2 comments

Comments

@mi01
Copy link

mi01 commented Nov 3, 2022

Hello,
this is possibly a bug or I'm doing something wrong here. My settings:

CITIES_LIGHT_TRANSLATION_LANGUAGES = ['de']
CITIES_LIGHT_INCLUDE_COUNTRIES = ['DE']
CITIES_LIGHT_INCLUDE_CITY_TYPES = ['PPL', 'PPLA', 'PPLA2', 'PPLA3', 'PPLA4', 'PPLC', 'PPLF', 'PPLG', 'PPLL', 'PPLR', 'PPLS',]
CITIES_LIGHT_CITY_SOURCES = ['http://download.geonames.org/export/dump/cities500.zip']

After running manage.py cities_light without any errors i had a look into the database:

python manage.py shell
>>> from cities_light.models import Country, Region, City
>>> c = Country.objects.first()
>>> c.name
'Germany'
>>> c.alternate_names
'Bundesrepublik Deutschland'
>>> r = Region.objects.filter(name="Bavaria").first()
>>> r.name
Bavaria
>>> r.alternate_names
''

So the alternate name for the country is created, but not for the regions. But actually the translation is given in the dataset from geonames.org:

https://download.geonames.org/export/dump/admin1CodesASCII.txt
DE.02 Bavaria Bavaria 2951839

https://download.geonames.org/export/dump/alternateNames.zip
1894550 2951839 de Bayern 1 1

Any idea if this is a bug or why this is not working?

@ahmad88me
Copy link

ahmad88me commented Aug 30, 2023

I am facing the same thing.

CITIES_LIGHT_APP_NAME = 'cities_light'
CITIES_LIGHT_TRANSLATION_LANGUAGES = ['en', "ar", "es"]
CITIES_LIGHT_INCLUDE_COUNTRIES = ['KW']
CITIES_LIGHT_INCLUDE_CITY_TYPES = ['PPL', 'PPLA', 'PPLA2', 'PPLA3', 'PPLA4', 'PPLC', 'PPLF', 'PPLG', 'PPLL', 'PPLR', 'PPLS', 'STLMT',]

The names only shows in weird English e.g., Abraq Khayţān, Abū Ḩalīfah

@marianoeramirez
Copy link
Collaborator

Thanks to @ahmad88me we have a new fix for the subregion issue with Alternate names. Can @mi01 verify if that solves his issue?

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

No branches or pull requests

3 participants