reintroduce 'name:' prefix to country name keys

This commit is contained in:
Tareq Al-Ahdal
2022-03-13 18:58:27 +08:00
parent 3939cb614e
commit 165d17f7f7
2 changed files with 254 additions and 254 deletions

View File

@@ -7,12 +7,12 @@
"""
Functions for importing and managing static country information.
"""
import json
import psycopg2.extras
from nominatim.db import utils as db_utils
from nominatim.db.connection import connect
from io import StringIO
import json
class _CountryInfo:
""" Caches country-specific properties from the configuration file.
@@ -109,8 +109,8 @@ def create_country_names(conn, tokenizer, languages=None):
languages = languages.split(',')
def _include_key(key):
return key == 'default' or \
(not languages or key in languages)
return key == 'name' or \
(key.startswith('name:') and (not languages or key[5:] in languages))
with conn.cursor() as cur:
psycopg2.extras.register_hstore(cur)

File diff suppressed because one or more lines are too long