test.html 4.4 KB

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