1.0.4 • Published 6 years ago

lxn v1.0.4

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

lxn-js

lxn-go is an lxn client library for the Javascript programming language.

Translating Text

To translate text, a catalog has to be loaded:

function readCatalog(buf: BufferSource): Translator

This function reads a binary catalog from buf, which could either be an ArrayBuffer or an ArrayBufferView, and returns its translator function. Once a translator function of type

type Translator = (key: string, ctx: Context) => string;

is obtained, it can be used to convert a key and a context into a message. The key specifies the message key within the catalog preceded by its section, i.e. section.message-key (or simply message-key if the message has no section). The context contains all the necessary variables to render this message correctly. For each variable in the catalog there has to be a value of the corresponding type.

1.0.4

6 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.0.2

7 years ago

0.0.1

8 years ago