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 Backportbot
parent 4b52089ca5
commit 1281efc8fd

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
-----------------------------------------