grammy-i18n

Grammy i18n engine

Usage no npm install needed!

<script type="module">
  import grammyI18n from 'https://cdn.skypack.dev/grammy-i18n';
</script>

README

i18n for grammY

Internationalization middleware for grammY.

Installation

$ npm install grammy-i18n

Documentation to be done

See full example.

User context

grammY user context props and functions:

app.use((ctx) => {
  ctx.i18n.locale()                    // Get current locale
  ctx.i18n.locale(code)                // Set current locale
  ctx.i18n.t(resourceKey, [data])      // Get resource value (data will be used by template engine)
});

Helpers

Aren't included yet