JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3607
  • Score
    100M100P100Q113733F
  • License MIT

grammY i18n engine

Package Exports

  • @grammyjs/i18n

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@grammyjs/i18n) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

i18n for grammY

Internationalization middleware for grammY.

Installation

$ npm install @grammyjs/i18n

Documentation to be done

See full example at https://replit.com/@MikeLeitner/TgGruppenBot

To use it you need to define BOT_TOKEN as Secrets or Environment Variable

User context

grammY user context props and functions:

bot.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