1. {% load i18n %}
    
  2. {% comment %}Translators: Django comment block for translators
    
  3. string's meaning unveiled
    
  4. {% endcomment %}
    
  5. {% translate "This literal should be included." %}
    
  6. {% translate "This literal should also be included wrapped or not wrapped depending on the use of the --no-wrap option." %}
    
  7. 
    
  8. {% comment %}Some random comment
    
  9. Some random comment
    
  10. Translators: One-line translator comment #1
    
  11. {% endcomment %}
    
  12. {% translate "Translatable literal #1a" %}
    
  13. 
    
  14. {% comment %}Some random comment
    
  15. Some random comment
    
  16. Translators: Two-line translator comment #1
    
  17. continued here.
    
  18. {% endcomment %}
    
  19. {% translate "Translatable literal #1b" %}
    
  20. 
    
  21. {% comment %}Some random comment
    
  22. Translators: One-line translator comment #2
    
  23. {% endcomment %}
    
  24. {% translate "Translatable literal #2a" %}
    
  25. 
    
  26. {% comment %}Some random comment
    
  27. Translators: Two-line translator comment #2
    
  28. continued here.
    
  29. {% endcomment %}
    
  30. {% translate "Translatable literal #2b" %}
    
  31. 
    
  32. {% comment %}
    
  33.     Translators: One-line translator comment #3
    
  34. {% endcomment %}
    
  35. {% translate "Translatable literal #3a" %}
    
  36. 
    
  37. {% comment %}
    
  38. Translators: Two-line translator comment #3
    
  39. continued here.
    
  40. {% endcomment %}
    
  41. {% translate "Translatable literal #3b" %}
    
  42. 
    
  43. {% comment %} Translators: One-line translator comment #4{% endcomment %}
    
  44. {% translate "Translatable literal #4a" %}
    
  45. 
    
  46. {% comment %}  Translators: Two-line translator comment #4
    
  47. continued here.{% endcomment %}
    
  48. {% translate "Translatable literal #4b" %}
    
  49. 
    
  50. {% comment %} Translators: One-line translator comment #5 -- with non ASCII characters: áéíóúö{% endcomment %}
    
  51. {% translate "Translatable literal #5a" %}
    
  52. 
    
  53. {% comment %}  Translators: Two-line translator comment #5 -- with non ASCII characters: áéíóúö
    
  54. continued here.{% endcomment %}
    
  55. {% translate "Translatable literal #6b" %}
    
  56. 
    
  57. {% translate "Translatable literal #7a" context "Special trans context #1" %}
    
  58. {% translate "Translatable literal #7b" as var context "Special trans context #2" %}
    
  59. {% translate "Translatable literal #7c" context "Special trans context #3" as var %}
    
  60. 
    
  61. {% translate "Translatable literal #7.1a" | upper context "context #7.1a" %}
    
  62. {% translate "Translatable literal #7.1b" |upper as var context "context #7.1b" %}
    
  63. {% translate "Translatable literal #7.1c"| upper context "context #7.1c" as var %}
    
  64. 
    
  65. {% translate "Translatable literal #7.1d"|add:" foo" context "context #7.1d" %}
    
  66. {% translate "Translatable literal #7.1e"|add:' ûè本' as var context "context #7.1e" %}
    
  67. {% with foo=" foo" %}
    
  68.     {% translate "Translatable literal #7.1f"|add:foo context "context #7.1f" as var %}
    
  69. {% endwith %}
    
  70. {% translate "Translatable literal #7.1g"|add:2 context "context #7.1g" as var %}
    
  71. {% translate "Translatable literal #7.1h" | add:"foo" | add:2 context "context #7.1h" as var %}
    
  72. 
    
  73. <!-- Source file inside a msgid, should be left as-is. -->
    
  74. {% translate "#: templates/test.html.py" %}
    
  75. <!-- Deliberate duplicated string. -->
    
  76. {% translate "This literal should be included." %}
    
  77. 
    
  78. {% blocktranslate context "Special blocktranslate context #1" %}Translatable literal #8a{% endblocktranslate %}
    
  79. {% blocktranslate count 2 context "Special blocktranslate context #2" %}Translatable literal #8b-singular{% plural %}Translatable literal #8b-plural{% endblocktranslate %}
    
  80. {% blocktranslate context "Special blocktranslate context #3" count 2 %}Translatable literal #8c-singular{% plural %}Translatable literal #8c-plural{% endblocktranslate %}
    
  81. {% blocktranslate with a=1 context "Special blocktranslate context #4" %}Translatable literal #8d {{ a }}{% endblocktranslate %}
    
  82. 
    
  83. {% translate "Translatable literal with context wrapped in single quotes" context 'Context wrapped in single quotes' as var %}
    
  84. {% translate "Translatable literal with context wrapped in double quotes" context "Context wrapped in double quotes" as var %}
    
  85. {% blocktranslate context 'Special blocktranslate context wrapped in single quotes' %}Translatable literal with context wrapped in single quotes{% endblocktranslate %}
    
  86. {% blocktranslate context "Special blocktranslate context wrapped in double quotes" %}Translatable literal with context wrapped in double quotes{% endblocktranslate %}
    
  87. 
    
  88. {# Backwards compatibility tests #}
    
  89. {% blocktrans %}blocktrans text{% endblocktrans %}
    
  90. {% trans "trans text" %}
    
  91. 
    
  92. {# BasicExtractorTests.test_blocktranslate_trimmed #}
    
  93. {% blocktranslate %}
    
  94.   Text with a few
    
  95.   line breaks.
    
  96. {% endblocktranslate %}
    
  97. {% blocktranslate trimmed %}
    
  98.   Again some text with a few
    
  99.   line breaks, this time
    
  100.   should be trimmed.
    
  101. {% endblocktranslate %}
    
  102. {% translate "Get my line number" %}
    
  103. 
    
  104. {% blocktranslate trimmed count counter=mylist|length %}
    
  105. First `translate`, then `blocktranslate` with a plural
    
  106. {% plural %}
    
  107. Plural for a `translate` and `blocktranslate` collision case
    
  108. {% endblocktranslate %}
    
  109. 
    
  110. {% translate "Non-breaking space :" %}