From 9885743924b185425f422750d053cd7556958928 Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Sat, 6 Jun 2020 03:35:39 +0300 Subject: [PATCH] wizard language translation --- public/locales/en/translations.json | 10 ++++++++++ public/locales/ro/translations.json | 10 ++++++++++ src/features/chatbot/components/Wizard.js | 15 ++++++++------- 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/public/locales/en/translations.json b/public/locales/en/translations.json index 30bdf0a..0ca8a92 100644 --- a/public/locales/en/translations.json +++ b/public/locales/en/translations.json @@ -82,5 +82,15 @@ }, "Notifications": { "MessageSaved": "Message saved" + }, + "Chatbot": { + "Wizard": { + "Message1": "I'm the wizard.", + "Message2": "I know everything about nothing. What do you want to ask me?", + "Message3": "Please hurry. I don't have time to waste.", + "Message5": "I don't have time for that. Ask me something serious.", + "Message7": "I don't think I understand '{previousValue}'. You mean, like, flowers?", + "Message9": "I think you're wasting my time. Farewell!" + } } } diff --git a/public/locales/ro/translations.json b/public/locales/ro/translations.json index ab5d05f..08dd3f9 100644 --- a/public/locales/ro/translations.json +++ b/public/locales/ro/translations.json @@ -73,5 +73,15 @@ }, "Notifications": { "MessageSaved": "Mesaj salvat" + }, + "Chatbot": { + "Wizard": { + "Message1": "Eu sunt vrăjitorul.", + "Message2": "Știu totul despre nimic. Ce vrei sa ma intrebi?", + "Message3": "Te rog grabeste-te. Nu am timp de pierdut.", + "Message5": "Nu am timp pentru asta. Întreabă-mă ceva serios.", + "Message7": "Nu cred că am înțeles '{previousValue}'. Vrei să spui, cum ar fi, flori?", + "Message9": "Cred că îmi irosesti timpul. Ramas bun!" + } } } diff --git a/src/features/chatbot/components/Wizard.js b/src/features/chatbot/components/Wizard.js index 333d59d..7ec2d0b 100644 --- a/src/features/chatbot/components/Wizard.js +++ b/src/features/chatbot/components/Wizard.js @@ -3,9 +3,11 @@ import PropTypes from "prop-types"; import ChatBot from "react-simple-chatbot"; import { ThemeProvider } from "styled-components"; import { useTheme } from "@material-ui/core/styles"; +import { useTranslation } from "react-i18next"; const Wizard = ({ dismissBot }) => { const theme = useTheme(); + const { t } = useTranslation(); const botTheme = { background: "#f5f8fb", @@ -22,17 +24,17 @@ const Wizard = ({ dismissBot }) => { const steps = [ { id: "1", - message: "I'm the wizard.", + message: t("Chatbot.Wizard.Message1"), trigger: "2" }, { id: "2", - message: "I know everything about nothing. What do you want to ask me?", + message: t("Chatbot.Wizard.Message2"), trigger: "3" }, { id: "3", - message: "Please hurry. I don't have time to waste.", + message: t("Chatbot.Wizard.Message3"), trigger: "4" }, { @@ -42,7 +44,7 @@ const Wizard = ({ dismissBot }) => { }, { id: "5", - message: "I don't have time for that. Ask me something serious.", + message: t("Chatbot.Wizard.Message5"), trigger: "6" }, { @@ -52,8 +54,7 @@ const Wizard = ({ dismissBot }) => { }, { id: "7", - message: - "I don't think I understand '{previousValue}'. You mean, like, flowers?", + message: t("Chatbot.Wizard.Message7"), trigger: "8" }, { @@ -63,7 +64,7 @@ const Wizard = ({ dismissBot }) => { }, { id: "9", - message: "I think you're wasting my time. Farewell!", + message: t("Chatbot.Wizard.Message9"), end: true } ];