• Nicolas Gelot's avatar
    Fix locale and search language · 443c45a9
    Nicolas Gelot authored
    Locale and search language was always defined with english value.
    This patch inits the locale on `pre_request` in order to define the
    default value of locale and language preferences.
    Plus the `best_match` function provided by flask babel library did not
    work as expected. So the function `match_language` provided
    by searx is used to detect that the language from Accepted-Language
    header can be used in searx project.
    Close: https://github.com/asciimoo/searx/issues/844
    Close: #35, #42
preferences.py 14 KB