diff --git a/scanblog/TODO b/scanblog/TODO index 8345043..fe4f67c 100644 --- a/scanblog/TODO +++ b/scanblog/TODO @@ -2,4 +2,12 @@ * replace ✍ by css class and css display -* optionnal sharing buttons +* optional sharing buttons + +* Replace atomic translations with blocktrans in the following: + - scanblog/templates/blogs/_sharing_buttons.html + - scanblog/templates/blogs/all_comments_list.html + - scanblog/templates/blogs/delete_post.html + - scanblog/templates/blogs/tag_post_list.html + - scanblog/templates/btb/admin-content-flagged.txt + - scanblog/templates/comments/unremove_comment.html diff --git a/scanblog/templates/about/terms.html b/scanblog/templates/about/terms.html index a4ea1bf..f71ee82 100644 --- a/scanblog/templates/about/terms.html +++ b/scanblog/templates/about/terms.html @@ -4,7 +4,11 @@ {% block title %}{% trans "Terms of Use" %}{% endblock %} {% block body %}
{% blocktrans %}
PLEASE REVIEW BEFORE USING THIS WEBSITE – IF YOU DO NOT AGREE TO THESE TERMS OF USE, DO NOT USE THIS WEBSITE.
diff --git a/scanblog/templates/blogs/page_picker.html b/scanblog/templates/blogs/page_picker.html
index c226540..621a7a6 100644
--- a/scanblog/templates/blogs/page_picker.html
+++ b/scanblog/templates/blogs/page_picker.html
@@ -40,7 +40,10 @@
}
{% trans "Every page" %}
diff --git a/scanblog/templates/blogs/post_detail.html b/scanblog/templates/blogs/post_detail.html
index abf6998..393115b 100644
--- a/scanblog/templates/blogs/post_detail.html
+++ b/scanblog/templates/blogs/post_detail.html
@@ -7,7 +7,8 @@
{% load favorites %}
-{% block title %}{% firstof post.title "Untitled" %} — {{post.author.profile}}{% endblock %}
+{% trans "Untitled" as untitled_i18n %}
+{% block title %}{% firstof post.title untitled_i18n %} — {{post.author.profile}}{% endblock %}
{% block head %}
{% with feed_author=post.author comment_feed_obj=post %}
@@ -33,7 +34,8 @@
{% endif %}
{% trans "by" %} {{ post.author.profile.display_name }}
{% if post.author.profile.has_public_profile %}
- ({% trans "author's profile" %})
+ {% blocktrans with profile_url=post.author.profile.get_absolute_url %}
+ (author's profile)
{% endif %}
{% if org.public %}, {% trans "writing for" %} {{ org.name }}{% endif %}
{% if org.public %}{{ org.footer|safe }}{% endif %}
diff --git a/scanblog/templates/btb/org_status_email.html b/scanblog/templates/btb/org_status_email.html
index 6a9c752..fa0a6d1 100644
--- a/scanblog/templates/btb/org_status_email.html
+++ b/scanblog/templates/btb/org_status_email.html
@@ -28,7 +28,11 @@
- {% trans "The State of the {{ org.name }} is" %} {{ adjective.word }}
+
+ {% blocktrans with org_name=org.name adjective_word=adjective.word %}
+ The State of the {{ org_name }} is {{ adjective_word }}
+ {% endblocktrans %}
+
{{ adjective.word }}: {{ adjective.definition }}
{% trans "Distance from inbox zero:" %} {{ inbox_zero_distance }}.
{% if inbox_zero_distance == 0 %}
diff --git a/scanblog/templates/comments/_comment.html b/scanblog/templates/comments/_comment.html
index 1d3ff5b..b913d75 100644
--- a/scanblog/templates/comments/_comment.html
+++ b/scanblog/templates/comments/_comment.html
@@ -14,12 +14,15 @@
- {% trans "This comment has been removed." %} {% trans "You can edit the messages that haven't been sent below. - Changed your mind?" %} {% trans "Restore (unremove) this comment" %}. + {% trans "This comment has been removed." %} + {% trans "You can edit the messages that haven't been sent below. Changed your mind?" %} {% trans "Restore (unremove) this comment" %}.
{% else %} -{% trans "Remove the following comment by {{ comment.user.profile }}? (If this is spam, use this form instead)" %}
++ {% url "comments.spam_can_comment" comment.pk as spam_comment_url %} + {% blocktrans with commenter=comment.user.profile %} + Remove the following comment by {{ commenter }}? (If this is spam, use this form instead)
+ {% endblocktrans %} {% endif %}posted {{ comment.created|date }} on @@ -107,8 +111,7 @@
{% trans "The cryptic error message we got was:" %}
{{ form.post_author_message.errors }}diff --git a/scanblog/templates/comments/unremove_comment.html b/scanblog/templates/comments/unremove_comment.html index c0ab1f5..caef5c9 100644 --- a/scanblog/templates/comments/unremove_comment.html +++ b/scanblog/templates/comments/unremove_comment.html @@ -7,7 +7,11 @@ {% block body %}
{% trans "Restore the following comment, which was removed on {{ removal.date|date }}?" %}
++{% blocktrans with removal_date=removal.date|date %} +Restore the following comment, which was removed on {{ removal_date }}? +{% endblocktrans %} +
posted {{ comment.created|date }} on {{ comment.document.get_title }} by diff --git a/scanblog/templates/lint.py b/scanblog/templates/lint.py index f0199c7..004e011 100644 --- a/scanblog/templates/lint.py +++ b/scanblog/templates/lint.py @@ -3,6 +3,8 @@ for root, dirs, files in os.walk(os.path.abspath(os.path.dirname(__file__))): for fn in files: + if fn.endswith(".swp"): + continue path = os.path.join(root, fn) with open(path) as fh: txt = fh.read() @@ -31,3 +33,9 @@ # Look for tabs if "\t" in txt: print "has tab characters", path + + # Look for blocks and variables inside {% trans "" %} tags + for match in re.finditer(r"""\{\% trans ((.(?!\%\}))*) \%\}""", txt): + if re.search("[\{\}]+", match.group(1)): + print "tags in trans", path + diff --git a/scanblog/templates/notification/notice_settings.html b/scanblog/templates/notification/notice_settings.html index 9bb710b..5220df1 100644 --- a/scanblog/templates/notification/notice_settings.html +++ b/scanblog/templates/notification/notice_settings.html @@ -63,7 +63,9 @@
{% trans "A flag lets moderators now that something is not right about a particular post, profile, or comment. Please help us by flagging any posts that seem to be against our guidelines, or have been improperly edited (for example, pages not rotated correctly)." %} +
+{% url "about.guidelines" as about_guidelines_url %} +{% blocktrans %} +A flag lets moderators now that something is not right about a particular post, profile, or comment. Please help us by flagging any posts that seem to be against our guidelines, or have been improperly edited (for example, pages not rotated correctly). +{% endblocktrans %}