Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Consistenly use _ as alias for ugettext_lazy in the i18n docs.

  • Loading branch information...
commit d2975718fe0585cad1ed1462cc4d65373a6c7bb0 1 parent 45baaab
Florian Apolloner authored August 13, 2012

Showing 1 changed file with 6 additions and 6 deletions. Show diff stats Hide diff stats

  1. 12  docs/topics/i18n/translation.txt
12  docs/topics/i18n/translation.txt
@@ -317,10 +317,10 @@ Model fields and relationships ``verbose_name`` and ``help_text`` option values
317 317
 For example, to translate the help text of the *name* field in the following
318 318
 model, do the following::
319 319
 
320  
-    from django.utils.translation import ugettext_lazy
  320
+    from django.utils.translation import ugettext_lazy as _
321 321
 
322 322
     class MyThing(models.Model):
323  
-        name = models.CharField(help_text=ugettext_lazy('This is the help text'))
  323
+        name = models.CharField(help_text=_('This is the help text'))
324 324
 
325 325
 You can mark names of ``ForeignKey``, ``ManyTomanyField`` or ``OneToOneField``
326 326
 relationship as translatable by using their ``verbose_name`` options::
@@ -344,14 +344,14 @@ It is recommended to always provide explicit
344 344
 relying on the fallback English-centric and somewhat naïve determination of
345 345
 verbose names Django performs bu looking at the model's class name::
346 346
 
347  
-    from django.utils.translation import ugettext_lazy
  347
+    from django.utils.translation import ugettext_lazy as _
348 348
 
349 349
     class MyThing(models.Model):
350  
-        name = models.CharField(_('name'), help_text=ugettext_lazy('This is the help text'))
  350
+        name = models.CharField(_('name'), help_text=_('This is the help text'))
351 351
 
352 352
         class Meta:
353  
-            verbose_name = ugettext_lazy('my thing')
354  
-            verbose_name_plural = ugettext_lazy('my things')
  353
+            verbose_name = _('my thing')
  354
+            verbose_name_plural = _('my things')
355 355
 
356 356
 Model methods ``short_description`` attribute values
357 357
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 notes on commit d297571

Please sign in to comment.
Something went wrong with that request. Please try again.