Skip to content

Commit

Permalink
Fix gettext format string
Browse files Browse the repository at this point in the history
  • Loading branch information
georgeto committed Jan 23, 2019
1 parent 50a39c4 commit ad71adc
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion sipa/blueprints/generic.py
Expand Up @@ -106,7 +106,7 @@ def exceptionhandler_ldap(ex):
@bp_generic.app_errorhandler(BackendError)
def exceptionhandler_backend(ex: BackendError):
flash(gettext("Fehler bei der Kommunikation mit unserem Server"
f" (Backend '{ex.backend_name}')"),
" (Backend '%(name)')", name=ex.backend_name),

This comment has been minimized.

Copy link
@lukasjuhrich

lukasjuhrich Jan 24, 2019

Collaborator

Ah, yeah, not formatting the string before calling gettext makes more sense. Must've slipped through my fingers when adapting to f-strings, sorry about that.

'error')
logger.critical(
'Backend error: %s', ex.backend_name,
Expand Down
Binary file modified sipa/translations/de/LC_MESSAGES/messages.mo
Binary file not shown.
9 changes: 6 additions & 3 deletions sipa/translations/de/LC_MESSAGES/messages.po
@@ -1,13 +1,13 @@
# German translations for sipa.
# Copyright (C) 2018 AG DSN
# Copyright (C) 2019 AG DSN
# This file is distributed under the same license as the sipa project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2018.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2019.
#
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2018-10-23 20:54+0200\n"
"POT-Creation-Date: 2019-01-24 00:47+0100\n"
"PO-Revision-Date: 2014-08-01 19:22+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: de\n"
Expand Down Expand Up @@ -206,6 +206,9 @@ msgstr ""
msgid "Verbindung zum LDAP-Server konnte nicht hergestellt werden!"
msgstr ""

msgid "Fehler bei der Kommunikation mit unserem Server (Backend '%(name)')"
msgstr ""

msgid "Anmeldedaten fehlerhaft!"
msgstr ""

Expand Down
Binary file modified sipa/translations/en/LC_MESSAGES/messages.mo
Binary file not shown.
13 changes: 8 additions & 5 deletions sipa/translations/en/LC_MESSAGES/messages.po
@@ -1,14 +1,14 @@
# English translations for sipa.
# Copyright (C) 2018 AG DSN
# Copyright (C) 2019 AG DSN
# This file is distributed under the same license as the sipa project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2018.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2019.
#
msgid ""
msgstr ""
"Project-Id-Version: Sipa\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2018-10-23 20:54+0200\n"
"PO-Revision-Date: 2018-10-23 20:56+0200\n"
"POT-Creation-Date: 2019-01-24 00:47+0100\n"
"PO-Revision-Date: 2019-01-24 00:49+0100\n"
"Last-Translator: Lukas Juhrich <lukasjuhrich@wh2.tu-dresden.de>\n"
"Language: en\n"
"Language-Team: \n"
Expand All @@ -18,7 +18,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.6.0\n"
"X-Source-Language: de\n"
"X-Generator: Poedit 2.2\n"
"X-Generator: Poedit 2.0.6\n"

msgid "Kleinbuchstaben (a-z)"
msgstr "lower case letters (a-z)"
Expand Down Expand Up @@ -213,6 +213,9 @@ msgstr ""
msgid "Verbindung zum LDAP-Server konnte nicht hergestellt werden!"
msgstr "Connection to LDAP server could not be established!"

msgid "Fehler bei der Kommunikation mit unserem Server (Backend '%(name)')"
msgstr "Error during communication with the backend server ('%(name)')"

msgid "Anmeldedaten fehlerhaft!"
msgstr "Authentication data incorrect!"

Expand Down

0 comments on commit ad71adc

Please sign in to comment.