summaryrefslogtreecommitdiffstats
path: root/ui/src/i18n.ts
diff options
context:
space:
mode:
Diffstat (limited to 'ui/src/i18n.ts')
-rw-r--r--ui/src/i18n.ts32
1 files changed, 32 insertions, 0 deletions
diff --git a/ui/src/i18n.ts b/ui/src/i18n.ts
new file mode 100644
index 00000000..46604e91
--- /dev/null
+++ b/ui/src/i18n.ts
@@ -0,0 +1,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;