Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: tests/test_site/templates/translatable-template.tmpl

Issue 29659605: Issue 6231 - Add tests for translation string substitution (Closed)
Patch Set: Add tests for partial translation and for get_string Created Jan. 19, 2018, 3:26 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tests/test_site/templates/translatable-template.tmpl
===================================================================
new file mode 100644
--- /dev/null
+++ b/tests/test_site/templates/translatable-template.tmpl
@@ -0,0 +1,15 @@
+{{ body|safe }}
+
+Simple TS with default: {{ 'Translate' | translate('simple') }}.
+
+Same TS with no default: doesn't work in templates.
+
+TS with fixed text: {{ 'Fixed <fix>text</fix>' | translate('fix-ts') }}.
+
+Nested translation: {{ '<a href="{{nested-link http://foo.com/}}">Foo</a> and <a href="{{nested-link2 http://baz.com/}}">Baz</a>' | translate('nested-ts') }}.
+
+Link resolving: {{ '<a href="translate">This page</a>' | translate('linked-ts') }}.
+
+Entity escaping: {{ 'Drag&drop' | translate('entity-ts') }}.
+
+Entity escaping in links: {{ '<a href="http://foo.com/?a&b">Foo</a>' | translate('entity-lnk') }}.

Powered by Google App Engine
This is Rietveld