From e2e2a7f05a564c0aa8b9ad4f3a263098e3c82a58 Mon Sep 17 00:00:00 2001 From: Marco Bonetti Date: Tue, 20 Jul 2021 20:06:35 +0200 Subject: [PATCH] Move context and comments hints into the rightmost column. Fixes #260 --- CHANGES | 1 + rosetta/templates/rosetta/css/rosetta.css | 4 +-- rosetta/templates/rosetta/form.html | 31 +++++++++----------- testproject/locale/fr/LC_MESSAGES/django.mo | Bin 457 -> 633 bytes testproject/locale/fr/LC_MESSAGES/django.po | 13 ++++++-- 5 files changed, 28 insertions(+), 21 deletions(-) diff --git a/CHANGES b/CHANGES index 53fb2ea..84f7b1b 100644 --- a/CHANGES +++ b/CHANGES @@ -8,6 +8,7 @@ Version 0.9.7 (unreleased) * Translations via the DeepL API (#258, thanks @halitcelik) * Fixed unicode handling in gettext headers (#259, thanks @NotSqrt) * Remove six as a dependency +* Move context and comment hints into the right-most column (#260 thanks @jieter) Version 0.9.6 diff --git a/rosetta/templates/rosetta/css/rosetta.css b/rosetta/templates/rosetta/css/rosetta.css index f043b7d..c7dc1cc 100644 --- a/rosetta/templates/rosetta/css/rosetta.css +++ b/rosetta/templates/rosetta/css/rosetta.css @@ -5,8 +5,8 @@ td.translation label {font-size: 95%;} td.translation textarea, td.original { font-size:110%;} td.translation,td.original {width:30%;} td.original .plural-container { position:relative} -td.original .context,td.original .message {display:block;} -td.original .context { margin-top: 2em; color: #bbb; font-size:90%; } +td .context,td.original .message {display:block;} +td .context { margin-top: 1rem; color: #999; } td.translation textarea{ width:98.5%; min-height:25px; margin:2px 0; } .rtl td.translation textarea { direction: rtl;} .plural span {display:block; margin:2px 0; position:absolute} diff --git a/rosetta/templates/rosetta/form.html b/rosetta/templates/rosetta/form.html index 657deb8..4a78246 100644 --- a/rosetta/templates/rosetta/form.html +++ b/rosetta/templates/rosetta/form.html @@ -88,15 +88,6 @@ {{message.msgid|format_message|linebreaksbr}} {{message.msgid_plural|format_message|linebreaksbr}} - - {% if message.msgctxt %} - {% trans "Context hint" %}: {{message.msgctxt|safe}} - {% else %} - {% if message.comment %} - {% trans "Context hint" %}: {{message.comment|safe}} - {% endif %} - {% endif %} - {% for k, msgstr in message.msgstr_plural.items %} @@ -111,13 +102,6 @@ {% else %} {{ message.msgid|format_message|linebreaksbr }} {% endif %} - {% if message.msgctxt %} - {% trans "Context hint" %}: "{{message.msgctxt|safe}}" - {% else %} - {% if message.comment %} - {% trans "Context hint" %}: {{message.comment|safe}} - {% endif %} - {% endif %} {% if main_language %}{{ message.main_lang|format_message|linebreaksbr }}{% endif %} @@ -128,13 +112,26 @@ - {% if rosetta_settings.SHOW_OCCURRENCES %} + {% if rosetta_settings.SHOW_OCCURRENCES %} + {% for fn,lineno in message.occurrences %} {{ fn }}{% if lineno %}:{{lineno}}{% endif %} {% endfor %} {% if message.occurrences|length|gt:"3" %} … ({% blocktrans count message.occurrences|length|minus:"3" as more_count %}{{more_count}} more{% plural %}{{more_count}} more{% endblocktrans %}) {% endif %} + {% if message.msgctxt or message.comment %} + + {% trans "Context hint" %}: + {% if message.msgctxt %} + {{message.msgctxt|safe}} + {% endif %} + {% if message.msgctxt and message.comment %}
{% endif %} + {% if message.comment %} + {{message.comment|safe}} + {% endif %} +
+ {% endif %} {% endif %} {% endfor %} diff --git a/testproject/locale/fr/LC_MESSAGES/django.mo b/testproject/locale/fr/LC_MESSAGES/django.mo index b53cd1688ca404709783e7d4ed358e2ea0be2b70..f8752366d8758caa134a45324dbef54853ee2128 100644 GIT binary patch delta 291 zcmX@f{F9~ro)F7a1|VPpVi_RT0dau9210@9NFdu5i1#rvFiZ#1Nv9 zGV{gr7*wm1^GoweYLP_qiYMyS#+d6G87LSUS(%#Y8km|Ia`_|{m*|ERCFT|9B$nhC zSt% i5=rU`3N{&uIhiF6$wj4k$r-6dddV4f>XY*sp928W-4kH| diff --git a/testproject/locale/fr/LC_MESSAGES/django.po b/testproject/locale/fr/LC_MESSAGES/django.po index 1731190..dccbf87 100644 --- a/testproject/locale/fr/LC_MESSAGES/django.po +++ b/testproject/locale/fr/LC_MESSAGES/django.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-09-14 02:28-0500\n" -"PO-Revision-Date: 2021-05-28 09:19-0551\n" -"Last-Translator: b' '\n" +"PO-Revision-Date: 2021-07-20 12:56-0551\n" +"Last-Translator: La présentation różnych sposobów. Nie \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" @@ -21,6 +21,7 @@ msgstr "" #: templates/test.html:3 #, fuzzy +#. I am a comment msgid "Some text to translate" msgstr "Crunchum ipsum dolor sit coder void, constructor function" @@ -38,3 +39,11 @@ msgstr[1] "" #: templates/test.html:3 msgid "We need %(num_bottles)s bottles!" msgstr "" + +#: templates/issue-260.html:260 +#. I am a comment, too +msgctxt "BADGE_PROGRESS_OBSERVATIONS yadda yadda this and that" +msgid "1 observation" +msgid_plural "%{count} observations" +msgstr[0] "1 waarneming" +msgstr[1] "%{count} waarnemingen"