Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Update master #147

Closed
wants to merge 1 commit into from

2 participants

@mozzadrella

Voice and tone updates to email notifications.

@dirkcuys dirkcuys commented on the diff
lernanta/templates/statuses/emails/wall_updated.txt
((4 lines not shown))
{% if status.important %}
-{{ status.author }}{{ _(' posted an important message to the wall:') }}
+{{ status.author }}{{ _(Update from the flight deck: ' posted an urgent message:') }}
@dirkcuys Owner

_(Update from the flight deck: ' posted an urgent message:') will give an error when we run it on the site.

In django templates _() is shorthand for saying, please translate whatever is between the brackets. The bit that is between the brackets needs to be a string. Strings can be quoted with a single apostrophe ex. 'This is a string.' or a double apostrophe "This is a string".

So, an example of using _() is _("Please translate this string?")

If you need to use a variable like {{ satus.author }} in the middle of the sentence you can break the sentence in two or use blocktrans. It's better to use blocktrans, since splitting the sentence will make translation very difficult!

The above using blocktrans will look like this:

{% blocktrans %}Update from the flight deck: {{ status.author }} posted an urgent message:{% endblocktrans %}

Notice that the sentence is not a string anymore and is treated as normal HTML!

I hope this helps a little, if anything is unclear, please ask

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@dirkcuys dirkcuys closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 25, 2012
  1. @mozzadrella

    Update master

    mozzadrella authored
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 6 deletions.
  1. +6 −6 lernanta/templates/statuses/emails/wall_updated.txt
View
12 lernanta/templates/statuses/emails/wall_updated.txt
@@ -1,21 +1,21 @@
{% load l10n_tags %}
-{{ project.name|safe }}{{ _(' was updated.') }}
+{{ project.name|safe }}{{ _(' update.') }}
{% if status.important %}
-{{ status.author }}{{ _(' posted an important message to the wall:') }}
+{{ status.author }}{{ _(Update from the flight deck: ' posted an urgent message:') }}
@dirkcuys Owner

_(Update from the flight deck: ' posted an urgent message:') will give an error when we run it on the site.

In django templates _() is shorthand for saying, please translate whatever is between the brackets. The bit that is between the brackets needs to be a string. Strings can be quoted with a single apostrophe ex. 'This is a string.' or a double apostrophe "This is a string".

So, an example of using _() is _("Please translate this string?")

If you need to use a variable like {{ satus.author }} in the middle of the sentence you can break the sentence in two or use blocktrans. It's better to use blocktrans, since splitting the sentence will make translation very difficult!

The above using blocktrans will look like this:

{% blocktrans %}Update from the flight deck: {{ status.author }} posted an urgent message:{% endblocktrans %}

Notice that the sentence is not a string anymore and is treated as normal HTML!

I hope this helps a little, if anything is unclear, please ask

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
{% else %}
-{{ status.author }}{{ _(' posted a message to the wall:') }}
+{{ status.author }}{{ _(Update from the flight deck:' made an update:') }}
{% endif %}
{{ status.status|striptags|safe }}
-{{ _('See message at:') }} http://{{domain}}{{ status.get_absolute_url }}
+{{ _('See what they said at:') }} http://{{domain}}{{ status.get_absolute_url }}
-{{ _('Sincerely,') }}
+{{ _('Go get 'em,') }}
{{ _('The P2PU Team') }}
{% if status.important %}
{{ _('This message was marked as important by an organizer. Participants can not turn off notifications for important updates.') }}
{% else %}
-{{ _('Manage your subscriptions:') }} http://{{domain}}/profile/edit/settings/
+{{ _('Manage how often you get these delightful messages at:') }} http://{{domain}}/profile/edit/settings/
{% endif %}
Something went wrong with that request. Please try again.