diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-03-04 11:58:08 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-03-04 11:58:08 +0100 |
commit | 1216712fa1b3c88eb1d2ba5ff18922f20e5284a2 (patch) | |
tree | b8e79ad45af1da27a87bc8179f888dabf3720117 | |
parent | b1dd161b7de5b40aa3a28abbc96d9675b10a138e (diff) | |
parent | 9f98e7c772e7edade1ebea26f826d216223c804f (diff) | |
download | docs-1216712fa1b3c88eb1d2ba5ff18922f20e5284a2.tar.gz docs-1216712fa1b3c88eb1d2ba5ff18922f20e5284a2.tar.bz2 docs-1216712fa1b3c88eb1d2ba5ff18922f20e5284a2.zip |
Merge branch 'master' of git.taler.net:api
-rw-r--r-- | api-bank.rst | 13 | ||||
-rw-r--r-- | dev-wallet-wx.rst | 48 |
2 files changed, 55 insertions, 6 deletions
diff --git a/api-bank.rst b/api-bank.rst index d59cfd5..8d2d562 100644 --- a/api-bank.rst +++ b/api-bank.rst @@ -31,17 +31,20 @@ the recipient's account .. code-block:: tsref interface BankDepositRequest { - + // JSON 'amount' object. The amount the caller wants to transfer // to the recipient's count amount: Amount; // The id of this wire transfer - wid: base32; + wid: base32; + + // The sender's account identificator + debit_account: number; // The recipient's account identificator - account: number; - + credit_account: number; + } .. _BankIncomingError: @@ -52,5 +55,5 @@ the recipient's account // The reason which made this request fail. Typically due to malfomation // of the POST's body reason: string - + } diff --git a/dev-wallet-wx.rst b/dev-wallet-wx.rst index a458eba..d373863 100644 --- a/dev-wallet-wx.rst +++ b/dev-wallet-wx.rst @@ -34,7 +34,7 @@ Project Structure ----------------- .. parsed-literal:: - + **manifest.json** extension configuration **package.json** node.js package configuration **tsconfig.json** TypeScript compiler configuration @@ -148,3 +148,49 @@ library. Run the default test suite with ``npm run test``, which will call `mocha` with the right parameters. + +-------------------- +Internationalisation +-------------------- + +Strings in the JavaScript code are internationalised using the following functions: + +- *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. + The i18n.number() function returns a ``PluralNumber`` object + that specifies the argument that determines the plural form, + if not present the first numeric argument is used. + +.. code-block:: js + + 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. + +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: + +.. code-block:: html + + <p lang="en">Hello World!</p> + <p lang="de">Hallo Welt!</p> + +``lib/i18n.js`` and ``style/lang.css`` needs to be included for this to work. |