summaryrefslogtreecommitdiffstats
path: root/ui/src/i18n.ts
blob: 46604e9157d7cecad42ff67309505227de9bd34c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import i18n from "i18next";
import { initReactI18next } from "inferno-i18next";

// the translations
// (tip move them in a JSON file and import them)
const resources = {
  en: {
    translation: {
      trending: "Trending",
    }
  },
  es: {
    translation: {
      trending: "Trending, but in spanish",
    }
  }
};

i18n
  .use(initReactI18next) // passes i18n down to react-i18next
  .init({
    resources,
    lng: "en",

    keySeparator: false, // we do not use keys in form messages.welcome

    interpolation: {
      escapeValue: false // react already safes from xss
    }
  });

export default i18n;