You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 19, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: src/guides/v2.3/frontend-dev-guide/translations/translate_theory.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -100,6 +100,24 @@ Translated strings that originate from `.xml` files will not render unless they
100
100
__($this->config->getData('label'))
101
101
```
102
102
103
+
## Strings added in Underscore templates {#add_strings_underscore_html}
104
+
105
+
To ensure that the text you add in `.html` Underscore templates is collected by the `i18n` tool and added to the dictionary, use the `_.i18n('')` Underscore function.
106
+
107
+
- When only a string is added in template use the following example:
108
+
109
+
```html
110
+
<%= _.i18n('Hello') %>
111
+
```
112
+
113
+
- When a string contains a variable, to add a placeholder for this variable to the string stored in the dictionary, use the syntax similar to the following:
0 commit comments