Author: leidel
Date: Wed Jan 21 01:11:57 2009
New Revision: 145
Modified:
trunk/docs/usage.txt
Log:
Documentation now shows how to mark notice types for translations
Modified: trunk/docs/usage.txt
==============================================================================
--- trunk/docs/usage.txt (original)
+++ trunk/docs/usage.txt Wed Jan 21 01:11:57 2009
@@ -27,20 +27,25 @@
Here is an example::
from django.conf import settings
+ from django.utils.translation import ugettext_noop as _
if "notification" in settings.INSTALLED_APPS:
- from notification.models import create_notice_type
-
+ from notification import models as notification
+
def create_notice_types(app, created_models, verbosity, **kwargs):
- create_notice_type("friends_invite", "Invitation
Received", "you have received an invitation")
- create_notice_type("friends_accept", "Acceptance
Received", "an invitation you sent has been accepted")
-
+ notification.create_notice_type("friends_invite",
_("Invitation Received"), _("you have received an invitation"))
+ notification.create_notice_type("friends_accept",
_("Acceptance Received"), _("an invitation you sent has been accepted"))
+
signals.post_syncdb.connect(create_notice_types,
sender=notification)
else:
print "Skipping creation of NoticeTypes as notification app not
found"
Notice that the code is wrapped in a conditional clause so if
django-notification is not installed, your app will proceed anyway.
+
+Note that the display and description arguments are marked for translation
by
+using ugettext_noop. That will enable you to use Django's makemessage
+management command and use django-notification's i18n capabilities.
Notification templates
======================
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pinax-updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/pinax-updates?hl=en
-~----------~----~----~----~------~----~------~--~---