Browse Source

Handle hidden translations better

Alec Nikolas Reiter 7 years ago
parent
commit
38303e93b7
3 changed files with 4 additions and 4 deletions
  1. 1 1
      flaskbb/app.py
  2. 1 1
      flaskbb/templates/forum/forum.html
  3. 2 2
      flaskbb/templates/forum/topic.html

+ 1 - 1
flaskbb/app.py

@@ -249,7 +249,7 @@ def configure_context_processors(app):
         templates.
         """
 
-        return dict(flaskbb_config=flaskbb_config)
+        return dict(flaskbb_config=flaskbb_config, format_date=format_date)
 
 
 def configure_before_handlers(app):

+ 1 - 1
flaskbb/templates/forum/forum.html

@@ -94,7 +94,7 @@
 
                             {% if topic.hidden %}
                             <div class="topic-author">
-                                {% trans %}Hidden on{% endtrans %} {{ topic.hidden_at|format_date('%b %d %Y') }} {% trans %}by{% endtrans %} {{ topic.hidden_by.username }}
+                                {{ gettext("Hidden on %(when)s  by %(who)s", who=topic.hidden_by.username, when=format_date(topic.hidden_at, '%b %d %Y'))}}
                             </div>
                             {% endif %}
                         </div>

+ 2 - 2
flaskbb/templates/forum/topic.html

@@ -17,7 +17,7 @@
     {% if topic.hidden %}
     <div class="alert alert-warning">
         <span class="fa fa-user-secret"></span>
-        {% trans %}This is topic is hidden{% endtrans %} ({{ topic.hidden_at|format_date('%b %d %Y') }} {% trans %} by {% endtrans %} {{ topic.hidden_by.username }})
+        {{ gettext("This topic is hidden (%(when)s  by %(who)s)", who=topic.hidden_by.username, when=format_date(topic.hidden_at, '%b %d %Y'))}}
     </div>
     {% endif %}
 
@@ -93,7 +93,7 @@
                             {% if post.hidden %}
                             <div class="alert alert-warning">
                                 <span class="fa fa-user-secret"></span>
-                                {% trans %}This is post is hidden{% endtrans %} ({{ post.hidden_at|format_date('%b %d %Y') }} {% trans %} by {% endtrans %} {{ post.hidden_by.username }})
+                                {{ gettext("This post is hidden (%(when)s  by %(who)s)", who=topic.hidden_by.username, when=format_date(topic.hidden_at, '%b %d %Y'))}}
                             </div>
                             {% endif %}
                         {{ post.content|markup }}