summaryrefslogtreecommitdiff
path: root/dev-wallet-wx.rst
diff options
context:
space:
mode:
authortg(x) <*@tg-x.net>2016-03-01 15:23:36 +0100
committertg(x) <*@tg-x.net>2016-03-01 15:23:36 +0100
commit0c09f817c1eeadc2640782b422c00a1e7c4438a3 (patch)
treea26d5dc178f8a911be35e91108cae58f9589dc0f /dev-wallet-wx.rst
parentae743856b23ccd1a6e02cde789d2aba8e734070f (diff)
downloaddocs-0c09f817c1eeadc2640782b422c00a1e7c4438a3.tar.gz
docs-0c09f817c1eeadc2640782b422c00a1e7c4438a3.tar.bz2
docs-0c09f817c1eeadc2640782b422c00a1e7c4438a3.zip
walle-wx-i18n
Diffstat (limited to 'dev-wallet-wx.rst')
-rw-r--r--dev-wallet-wx.rst10
1 files changed, 7 insertions, 3 deletions
diff --git a/dev-wallet-wx.rst b/dev-wallet-wx.rst
index 5f21ace..255a873 100644
--- a/dev-wallet-wx.rst
+++ b/dev-wallet-wx.rst
@@ -157,18 +157,21 @@ Strings in the JavaScript code are internationalised using the following functio
- *i18n*: translate string with arbitrary arguments, the result is returned as string.
.. code-block:: js
+
``i18n`You have ${n} coins.``
- *i18n.parts*: Interpolate i18nized values with arbitrary objects. Useful for example to include HTML elements.
.. code-block:: js
+
``i18n.parts`Visit ${link} to get more coins.```
- *i18n.pluralize*: translate with plural form
.. code-block:: js
-i18n.pluralize(
- i18n`${i}: you have ${i18n.number(n)} coin.`,
- `${i}: you have ${i18n.number(n)} coins.`);
+
+ i18n.pluralize(
+ i18n`${i}: you have ${i18n.number(n)} coin.`,
+ `${i}: you have ${i18n.number(n)} coins.`);
These functions are defined in ``lib/i18n.ts``.
Include ``lib/vendor/jed.js``, ``lib/i18n.js``, ``lib/i18n-strings.js`` to use them.
@@ -176,6 +179,7 @@ Include ``lib/vendor/jed.js``, ``lib/i18n.js``, ``lib/i18n-strings.js`` to use t
To extract strings from sources and update the .po files, run:
.. code-block:: sh
+
$ make i18n
In static HTML files the ``lang`` attribute is used for language-specific strings.