Document how to use variables in translations in javascript

This commit is contained in:
Georg Ehrke
2018-11-29 17:32:43 +01:00
committed by GitHub
parent 98baee3f2f
commit 4bbe85dfa1

View File

@@ -48,10 +48,18 @@ What about variable in the strings?
If you need to add variables to the translation strings do it like this:
PHP:
.. code-block:: php
$l->t('%s is available. Get <a href="%s">more information</a>', array($data['versionstring'], $data['web']));
JavaScript:
.. code-block:: javascript
t(appName, '{name} is available. Get <a href="{link}">more information</a>', {name: 'Nextcloud 16', link: '...'});
Automated synchronization of translations
-----------------------------------------