From 37cb3b2b3935871ffecd03f7760c831e68116ab6 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Sat, 22 Jun 2019 22:23:51 +0200 Subject: [PATCH] manager: use ngettext (#34237) --- .../manager/locale/fr/LC_MESSAGES/django.po | 36 ++++++++++++++----- .../manager/user_import_report.html | 8 ++--- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/src/authentic2/manager/locale/fr/LC_MESSAGES/django.po b/src/authentic2/manager/locale/fr/LC_MESSAGES/django.po index 3711254d..1da8e330 100644 --- a/src/authentic2/manager/locale/fr/LC_MESSAGES/django.po +++ b/src/authentic2/manager/locale/fr/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: authentic2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-06-22 16:47+0200\n" +"POT-Creation-Date: 2019-06-22 22:23+0200\n" "PO-Revision-Date: 2019-06-19 11:09+0200\n" "Last-Translator: Benjamin Dauvergne \n" "Language-Team: French \n" @@ -986,20 +986,32 @@ msgid "Abstract" msgstr "Résumé" #: src/authentic2/manager/templates/authentic2/manager/user_import_report.html:80 -msgid "rows" -msgstr "lignes" +#, python-format +msgid "%(rows)s row" +msgid_plural "%(rows)s rows" +msgstr[0] "%(rows)s ligne" +msgstr[1] "%(rows)s lignes" #: src/authentic2/manager/templates/authentic2/manager/user_import_report.html:81 -msgid "user(s) created" -msgstr "utilisateur(s) créé(s)" +#, python-format +msgid "%(created)s user created" +msgid_plural "%(created)s users created" +msgstr[0] "%(created)s utilisateur créé" +msgstr[1] "%(created)s utilisateurs créés" #: src/authentic2/manager/templates/authentic2/manager/user_import_report.html:82 -msgid "user(s) updated" -msgstr "utilisateur(s) mis à jour" +#, python-format +msgid "%(updated)s user updated" +msgid_plural "%(updated)s users updated" +msgstr[0] "%(updated)s utilisateur mis à jour" +msgstr[1] "%(updated)s utilisateurs mis à jour" #: src/authentic2/manager/templates/authentic2/manager/user_import_report.html:83 -msgid "rows have errors" -msgstr "des lignes contiennent des erreurs" +#, python-format +msgid "%(error_rows)s row has error" +msgid_plural "%(error_rows)s rows have errors" +msgstr[0] "%(error_rows)s·avec des erreurs" +msgstr[1] "%(error_rows)s·avec des erreurs" #: src/authentic2/manager/templates/authentic2/manager/user_import_report.html:84 #, python-format @@ -1186,3 +1198,9 @@ msgstr "Éditer l'objet « %s »" #: src/authentic2/manager/views.py:713 msgid "File is not in the expected JSON format." msgstr "Le fichier n'est pas au format JSON attendu." + +#~ msgid "rows" +#~ msgstr "lignes" + +#~ msgid "rows have errors" +#~ msgstr "des lignes contiennent des erreurs" diff --git a/src/authentic2/manager/templates/authentic2/manager/user_import_report.html b/src/authentic2/manager/templates/authentic2/manager/user_import_report.html index f7ba4957..e088cdf1 100644 --- a/src/authentic2/manager/templates/authentic2/manager/user_import_report.html +++ b/src/authentic2/manager/templates/authentic2/manager/user_import_report.html @@ -77,10 +77,10 @@ {% endif %}

{% trans "Abstract" %}

    -
  • {{ importer.rows|length }} {% trans "rows" %}
  • -
  • {{ importer.created }} {% trans "user(s) created" %}
  • -
  • {{ importer.updated }} {% trans "user(s) updated" %}
  • -
  • {{ importer.rows_with_errors }} {% trans "rows have errors" %}
  • +
  • {% blocktrans count rows=importer.rows|length %}{{ rows }} row{% plural %}{{ rows }} rows{% endblocktrans %}
  • +
  • {% blocktrans count created=importer.created %}{{ created }} user created{% plural %}{{ created }} users created{% endblocktrans %}
  • +
  • {% blocktrans count updated=importer.updated %}{{ updated }} user updated{% plural %}{{ updated }} users updated{% endblocktrans %}
  • +
  • {% blocktrans count error_rows=importer.rows_with_errors %}{{ error_rows }} row has error{% plural %}{{ error_rows }} rows have errors{% endblocktrans %}
  • {% blocktrans with duration=report.duration %}import took {{ duration }}{% endblocktrans %}

{% trans "Details" %}

-- 2.20.1