From 4bbe85dfa15fbdf38084414b46e9bf6cfca8e00a Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Thu, 29 Nov 2018 17:32:43 +0100 Subject: [PATCH] Document how to use variables in translations in javascript --- developer_manual/core/translation.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/developer_manual/core/translation.rst b/developer_manual/core/translation.rst index ee83e7df4..7fafa9e79 100644 --- a/developer_manual/core/translation.rst +++ b/developer_manual/core/translation.rst @@ -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 more information', array($data['versionstring'], $data['web'])); +JavaScript: + +.. code-block:: javascript + + t(appName, '{name} is available. Get more information', {name: 'Nextcloud 16', link: '...'}); + Automated synchronization of translations -----------------------------------------