diff --git a/ihatemoney/messages.pot b/ihatemoney/messages.pot index bc8a8f39..bd4dcc49 100644 --- a/ihatemoney/messages.pot +++ b/ihatemoney/messages.pot @@ -182,6 +182,12 @@ msgstr "" msgid "The bill has been modified" msgstr "" +msgid "Sorry, we were unable to find the page you've asked for." +msgstr "" + +msgid "The best thing to do is probably to get back to the main page." +msgstr "" + msgid "Back to the list" msgstr "" diff --git a/ihatemoney/run.py b/ihatemoney/run.py index 1a5ac17e..e9b3ce16 100644 --- a/ihatemoney/run.py +++ b/ihatemoney/run.py @@ -2,7 +2,7 @@ import os import os.path import warnings -from flask import Flask, g, request, session +from flask import Flask, g, request, session, render_template from flask_babel import Babel from flask_mail import Mail from flask_migrate import Migrate, upgrade, stamp @@ -102,6 +102,10 @@ def validate_configuration(app): ) +def page_not_found(e): + return render_template('404.html', root="main"), 404 + + def create_app(configuration=None, instance_path='/etc/ihatemoney', instance_relative_config=True): app = Flask( @@ -121,8 +125,9 @@ def create_app(configuration=None, instance_path='/etc/ihatemoney', validate_configuration(app) app.register_blueprint(web_interface) app.register_blueprint(api) + app.register_error_handler(404, page_not_found) - # Configure the application + # Configure the a, root="main"pplication setup_database(app) mail = Mail() diff --git a/ihatemoney/templates/404.html b/ihatemoney/templates/404.html new file mode 100644 index 00000000..7e282c2e --- /dev/null +++ b/ihatemoney/templates/404.html @@ -0,0 +1,13 @@ +{% extends "layout.html" %} + +{% block body %} + +
+
+ {{ _("The best thing to do is probably to get back to the main page.")}} +
+{% endblock %} diff --git a/ihatemoney/templates/layout.html b/ihatemoney/templates/layout.html index cb36a6fe..3523ef7b 100644 --- a/ihatemoney/templates/layout.html +++ b/ihatemoney/templates/layout.html @@ -32,13 +32,13 @@ diff --git a/ihatemoney/translations/fr/LC_MESSAGES/messages.mo b/ihatemoney/translations/fr/LC_MESSAGES/messages.mo index 3fa8d8f4..ab8a8316 100644 Binary files a/ihatemoney/translations/fr/LC_MESSAGES/messages.mo and b/ihatemoney/translations/fr/LC_MESSAGES/messages.mo differ diff --git a/ihatemoney/translations/fr/LC_MESSAGES/messages.po b/ihatemoney/translations/fr/LC_MESSAGES/messages.po index ccab28b1..b3e2fdbe 100644 --- a/ihatemoney/translations/fr/LC_MESSAGES/messages.po +++ b/ihatemoney/translations/fr/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2018-07-16 23:26+0200\n" +"POT-Creation-Date: 2018-08-05 23:41+0200\n" "PO-Revision-Date: 2018-05-15 22:00+0200\n" "Last-Translator: Adrien CLERC <>\n" "Language: fr\n" @@ -16,7 +16,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.5.3\n" +"Generated-By: Babel 2.6.0\n" msgid "Project name" msgstr "Nom de projet" @@ -210,6 +210,12 @@ msgstr "La facture a été supprimée" msgid "The bill has been modified" msgstr "La facture a été modifiée" +msgid "Sorry, we were unable to find the page you've asked for." +msgstr "Navré, nous ne trouvons pas la page que vous avez demandé." + +msgid "The best thing to do is probably to get back to the main page." +msgstr "Votre meilleure piste est probablement la page d'accueil." + msgid "Back to the list" msgstr "Retourner à la liste" @@ -488,4 +494,3 @@ msgstr "Solde" #~ msgid "Invite" #~ msgstr "Invitez" -