diff --git a/ihatemoney/default_settings.py b/ihatemoney/default_settings.py index 6033d0ab..82e6a435 100644 --- a/ihatemoney/default_settings.py +++ b/ihatemoney/default_settings.py @@ -8,3 +8,4 @@ ACTIVATE_DEMO_PROJECT = True ADMIN_PASSWORD = "" ALLOW_PUBLIC_PROJECT_CREATION = True ACTIVATE_ADMIN_DASHBOARD = False +SUPPORTED_LANGUAGES = ['en', 'fr', 'nl'] diff --git a/ihatemoney/run.py b/ihatemoney/run.py index e9b3ce16..41598ce8 100644 --- a/ihatemoney/run.py +++ b/ihatemoney/run.py @@ -10,7 +10,8 @@ from werkzeug.contrib.fixers import ProxyFix from ihatemoney.api import api from ihatemoney.models import db -from ihatemoney.utils import PrefixedWSGI, minimal_round, IhmJSONEncoder +from ihatemoney.utils import (IhmJSONEncoder, PrefixedWSGI, locale_from_iso, + minimal_round, static_include) from ihatemoney.web import main as web_interface from ihatemoney import default_settings @@ -135,6 +136,8 @@ def create_app(configuration=None, instance_path='/etc/ihatemoney', app.mail = mail # Jinja filters + app.jinja_env.globals['static_include'] = static_include + app.jinja_env.globals['locale_from_iso'] = locale_from_iso app.jinja_env.filters['minimal_round'] = minimal_round # Translations @@ -144,7 +147,10 @@ def create_app(configuration=None, instance_path='/etc/ihatemoney', def get_locale(): # get the lang from the session if defined, fallback on the browser "accept # languages" header. - lang = session.get('lang', request.accept_languages.best_match(['fr', 'en'])) + lang = session.get( + 'lang', + request.accept_languages.best_match(app.config['SUPPORTED_LANGUAGES']) + ) setattr(g, 'lang', lang) return lang diff --git a/ihatemoney/static/css/main.css b/ihatemoney/static/css/main.css index ae056c82..47ede778 100644 --- a/ihatemoney/static/css/main.css +++ b/ihatemoney/static/css/main.css @@ -328,3 +328,16 @@ tr:hover .extra-info { .row-fluid > .offset1 { margin-left: 8.5%; } + +.globe-europe svg { + display: inline-block; + border-bottom: 0.2em solid transparent; + height: 1.2em; + fill: rgba(255,255,255,.5) +} +.navbar-nav .dropdown-toggle:hover .globe-europe svg { + fill: rgba(255,255,255,.75); +} +.navbar-dark .navbar-nav .show > .nav-link svg { + fill: white; +} \ No newline at end of file diff --git a/ihatemoney/static/images/globe.svg b/ihatemoney/static/images/globe.svg new file mode 100644 index 00000000..59823305 --- /dev/null +++ b/ihatemoney/static/images/globe.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ihatemoney/static/images/glyphicons-halflings-white.png b/ihatemoney/static/images/glyphicons-halflings-white.png deleted file mode 100644 index a20760bf..00000000 Binary files a/ihatemoney/static/images/glyphicons-halflings-white.png and /dev/null differ diff --git a/ihatemoney/static/images/glyphicons-halflings.png b/ihatemoney/static/images/glyphicons-halflings.png deleted file mode 100644 index 92d4445d..00000000 Binary files a/ihatemoney/static/images/glyphicons-halflings.png and /dev/null differ diff --git a/ihatemoney/templates/layout.html b/ihatemoney/templates/layout.html index 84e75b46..10bb6281 100644 --- a/ihatemoney/templates/layout.html +++ b/ihatemoney/templates/layout.html @@ -28,55 +28,71 @@