Integrate pycountry
fizyk opened this issue · comments
Integrate pycountry into the locale model, we should be able to return data from pycountry, throu Language model (specific data based on the Language instance - language_code dependant)
Hi, what data should be returned from pycountry?
language name (names) and later on maybe a country name the language belongs to.
Should that replace current attributes of the model such as name
or native_name
or offer the information as a new attribute (for instance, language_name
)?
In the first case, it may be possible to use an event to set these fields according to the language_code
attribute if they are not provided when creating the model, while the second would not affect the values stored in the database and simply act as a lookup.
Plus having a database duplicate would allow to prepare proper sorting.
Let's go with the second case rather. Fill in the name and native_name automatically during model's instance creation based on the language code. though
Thanks @rmed !