diff --git a/re2o/locale/fr/LC_MESSAGES/django.mo b/re2o/locale/fr/LC_MESSAGES/django.mo index eb533f3e..f5ba8273 100644 Binary files a/re2o/locale/fr/LC_MESSAGES/django.mo and b/re2o/locale/fr/LC_MESSAGES/django.mo differ diff --git a/re2o/locale/fr/LC_MESSAGES/django.po b/re2o/locale/fr/LC_MESSAGES/django.po index 2cabc6ec..cb06fb57 100644 --- a/re2o/locale/fr/LC_MESSAGES/django.po +++ b/re2o/locale/fr/LC_MESSAGES/django.po @@ -30,6 +30,14 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +#: settings.py:140 +msgid "English" +msgstr "Anglais" + +#: settings.py:141 +msgid "French" +msgstr "Français" + #: templates/re2o/about.html:29 templates/re2o/about.html:35 msgid "About Re2o" msgstr "A propos de Re2o" diff --git a/re2o/settings.py b/re2o/settings.py index bac8982b..52606b6d 100644 --- a/re2o/settings.py +++ b/re2o/settings.py @@ -37,6 +37,7 @@ from __future__ import unicode_literals import os from .settings_local import * +from django.utils.translation import ugettext_lazy as _ # The root directory for the project # Build paths inside the project like this: os.path.join(BASE_DIR, ...) @@ -135,6 +136,10 @@ LOCALE_PATHS = [ # For translations outside of apps os.path.join(BASE_DIR, 'templates', 'locale').replace('\\', '/') ] +LANGUAGES = [ + ('en', _('English')), + ('fr', _('French')) +] # Should use time zone ? USE_TZ = True diff --git a/re2o/urls.py b/re2o/urls.py index b1cccfd9..47172521 100644 --- a/re2o/urls.py +++ b/re2o/urls.py @@ -55,6 +55,7 @@ urlpatterns = [ url(r'^about/$', about_page, name='about'), url('^logout/', auth_views.logout, {'next_page': '/'}), url('^', include('django.contrib.auth.urls')), + url(r'^i18n/', include('django.conf.urls.i18n')), url(r'^admin/', include(admin.site.urls)), url(r'^users/', include('users.urls', namespace='users')), url(r'^search/', include('search.urls', namespace='search')), diff --git a/static/css/base.css b/static/css/base.css index 7338fab6..b6a7ae26 100644 --- a/static/css/base.css +++ b/static/css/base.css @@ -35,6 +35,26 @@ footer a { border-radius: 0; } +/* Add right colors for buttons in dropdown in navbar-inverse (else it is light + * gray on white bg and white when hovered */ +.navbar-inverse .dropdown-menu .btn-link { + text-decoration: none; + color: #262626; + padding: 0; +} +.navbar-inverse .dropdown-menu .btn-link:hover { + background-color: #f5f5f5; +} +@media screen and (max-width: 767px) { + .navbar-inverse .dropdown-menu .btn-link { + color: #9d9d9d; + } + .navbar-inverse .dropdown-menu .btn-link:hover { + color: #fff; + background-color: transparent; + } +} + /* Set height of the grid so .sidenav can be 100% (adjust as needed) */ .row.content { height: 100%; diff --git a/templates/base.html b/templates/base.html index 297cac89..f198feec 100644 --- a/templates/base.html +++ b/templates/base.html @@ -118,7 +118,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% acl_end %}
  • - {% trans "About" %} + {% trans "About" %}
  • {% if not request.user.is_authenticated %} {% if var_sa %} @@ -145,48 +145,11 @@ with this program; if not, write to the Free Software Foundation, Inc., - {% endif %} - - - {% comment %} - - - {% endcomment %} diff --git a/templates/buttons/setlang.html b/templates/buttons/setlang.html new file mode 100644 index 00000000..0789685a --- /dev/null +++ b/templates/buttons/setlang.html @@ -0,0 +1,48 @@ +{% comment %} +Re2o est un logiciel d'administration développé initiallement au rezometz. Il +se veut agnostique au réseau considéré, de manière à être installable en +quelques clics. + +Copyright © 2018 Maël Kervella + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +{% endcomment %} + +{% load i18n %} + +{% get_current_language as LANGUAGE_CODE %} +{% get_available_languages as LANGUAGES %} +{% get_language_info_list for LANGUAGES as languages %} + + + + +