summaryrefslogtreecommitdiff
path: root/app/i18n/translate.ts
blob: ef1a019db514dfb8e29d9757ea10f99aa5ca0b67 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
import i18n from "i18n-js"
import { TxKeyPath } from "./i18n"

/**
 * Translates text.
 *
 * @param key The i18n key.
 */
export function translate(key: TxKeyPath, options?: i18n.TranslateOptions) {
  return key ? i18n.t(key, options) : null
}