thermondo / pytest-translations

test translation files with pytest
Other
17 stars 3 forks source link

List supported languages, not dialects #26

Closed grunskis closed 7 years ago

grunskis commented 7 years ago

On macOS enchant returns a list of dialects and not languages:

(env) ~/src/github.com/Thermondo/thermondo-backend$ python3
Python 3.6.1 (default, Apr  4 2017, 09:40:51)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import enchant
>>> enchant.list_dicts()
[('de_DE', <Enchant: Myspell Provider>), ('en_AU', <Enchant: Myspell Provider>), ('en_GB', <Enchant: Myspell Provider>), ('en_US', <Enchant: Myspell Provider>), ('fr_FR', <Enchant: Myspell Provider>)

This PR adds a fix that makes sure that we strip the dialect part.

Some more context here: https://github.com/Thermondo/thermondo-backend/issues/7831