ihatemoney/ihatemoney
Baptiste Jonglez 18f24ac9b7 Fix language code parsing
Currently, norwegian (nb_NO) displays as "None" in the language change
select (upper right corner of the UI).

This is because language codes were not parsed correctly when they contain "_".

Here is a summary of the changes for the languages we support, before:

```
>>> Locale('nb_NO')
Locale('nb_NO')
>>> Locale('nb_NO').display_name
None

>>> Locale('es_419')
Locale('es', territory='419')
>>> Locale('es_419').display_name
'español latinoamericano'

>>> Locale('zh_HANS-CN')
babel.core.UnknownLocaleError: unknown locale 'zh_HANS-CN'
>>> Locale('zh_HANS-CN').display_name
babel.core.UnknownLocaleError: unknown locale 'zh_HANS-CN'
```

After:

```
>>> Locale.parse('nb_NO')
Locale('nb', territory='NO')
>>> Locale.parse('nb_NO').display_name
'norsk bokmål (Norge)'

>>> Locale.parse('es_419')
Locale('es', territory='419')
>>> Locale.parse('es_419').display_name
'español (Latinoamérica)'

>>> Locale.parse('zh_HANS-CN')
Locale('zh', script='Hans')
>>> Locale.parse('zh_HANS-CN').display_name
'中文 (简体)'
```

Summary: it fixes support for Norwegian and Chinese, and slightly changes
the display string for es_419.
2020-04-26 15:11:14 +02:00
..
api Remove obsolete python code (<3.6). (#571) 2020-04-24 12:32:52 +02:00
conf-templates Fix Apache conf template, without relying on environment var (#359) 2018-07-16 22:55:54 +02:00
migrations Direct Alembic to ignore the sqlite_sequence table (#586) 2020-04-26 14:20:24 +02:00
static Add Project History Page (#553) 2020-04-20 15:30:27 +02:00
templates Fix missing HTML tag (#583) 2020-04-25 14:03:40 +02:00
tests Fix string representation of bills (#584) 2020-04-26 14:22:54 +02:00
translations Translated using Weblate (French) (#582) 2020-04-25 13:15:02 +02:00
__init__.py Absolute imports & some other improvements (#243) 2017-07-07 00:06:56 +02:00
babel.cfg Absolute imports & some other improvements (#243) 2017-07-07 00:06:56 +02:00
default_settings.py Add Indonesian and Norwegian to the list of supported languages (#572) 2020-04-25 11:48:32 +02:00
forms.py Add isort support. (#561) 2020-04-21 13:59:41 +02:00
history.py Fix translations (#575) 2020-04-25 11:55:20 +02:00
manage.py Remove obsolete python code (<3.6). (#571) 2020-04-24 12:32:52 +02:00
messages.pot Fix last history string. 2020-04-25 13:04:47 +02:00
models.py Fix string representation of bills (#584) 2020-04-26 14:22:54 +02:00
patch_sqlalchemy_continuum.py Add isort support. (#561) 2020-04-21 13:59:41 +02:00
run.py Add isort support. (#561) 2020-04-21 13:59:41 +02:00
utils.py Fix language code parsing 2020-04-26 15:11:14 +02:00
versioning.py Add Project History Page (#553) 2020-04-20 15:30:27 +02:00
web.py Fix translations (#575) 2020-04-25 11:55:20 +02:00
wsgi.py Absolute imports & some other improvements (#243) 2017-07-07 00:06:56 +02:00