Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 1st, 2012  |  syntax: None  |  size: 0.80 KB  |  hits: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to properly add entries for computed values to the django internationalization messages file?
  2. {% trans var %}
  3.        
  4. msgid "Alice"
  5. msgstr "Alicja"
  6.        
  7. #~ msgid "Alice"
  8. #~ msgstr "Alicja"
  9.        
  10. from django.utils.translation import ugettext_lazy as _, pgettext
  11.  
  12. def dummy_for_makemessages():
  13.     """
  14.     This function allows manage makemessages to find the forecast types for translation.
  15.     Removing this code causes makemessages to comment out those PO entries, so don't do that
  16.     unless you find a better way to do this
  17.     """
  18.     pgettext('forecast type', 'some string')
  19.     pgettext('forecast type', 'some other string')
  20.     pgettext('forecast type', 'yet another string')
  21.     pgettext('forecast type', 'etc')
  22.     pgettext('forecast type', 'etc again')
  23.     pgettext('forecast type', 'and again and again')