Merge pull request #974 from nextcloud/backport/972/stable14

[stable14] Document how to use variables in translations in javascript
This commit is contained in:
Morris Jobke 2018-11-29 22:09:38 +01:00 committed by GitHub
commit cd5332e3fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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