Document `{jslang}` (#347)
authorTim Düsterhus <duesterhus@woltlab.com>
Fri, 13 Jan 2023 08:11:21 +0000 (09:11 +0100)
committerGitHub <noreply@github.com>
Fri, 13 Jan 2023 08:11:21 +0000 (09:11 +0100)
see #340

Co-authored-by: Alexander Ebert <ebert@woltlab.com>
docs/view/template-plugins.md

index a89470598c009f0acba2270936172a6dfec88975..692fed5c80269d2e3d1ee2d0a67f231411ac3436 100644 (file)
@@ -452,6 +452,21 @@ let data = { "title": {@$foo->getTitle()|json} };
 ```
 
 
+## <span class="label label-info">6.0+</span> `{jsphrase}`
+
+`jsphrase` generates the necessary JavaScript code to register a phrase in the JavaScript language store.
+This plugin only supports static phrase names.
+If a dynamic phrase should be registered, the [`jslang`](#jslang) plugin needs to be used.
+
+```smarty
+<script data-relocate="true">
+{jsphrase name='app.foo.bar'}
+
+// …
+</script>
+```
+
+
 ## `{lang}`
 
 `lang` replaces a language items with its value.