From 3d8a0e728d256f411f02c79ea3aa075e5e5c937f Mon Sep 17 00:00:00 2001 From: murtaza98 Date: Sun, 4 Oct 2020 20:58:35 +0530 Subject: [PATCH 1/7] Add multiple language support --- config/Settings.ts | 41 +++++++++++++++++++++++++++++++++++++++++ i18n/en.json | 3 ++- lib/Dialogflow.ts | 4 +++- 3 files changed, 46 insertions(+), 2 deletions(-) diff --git a/config/Settings.ts b/config/Settings.ts index ad361b5..f79df12 100644 --- a/config/Settings.ts +++ b/config/Settings.ts @@ -16,6 +16,7 @@ export enum AppSetting { DialogflowHandoverFailedMessage = 'dialogflow_no_agents_online_for_handover', DialogflowCloseChatMessage = 'dialogflow_close_chat_message', DialogflowHideQuickReplies = 'dialogflow_hide_quick_replies', + DialogflowLanguage = 'dialogflow_language', } export enum ServerSetting { @@ -29,6 +30,36 @@ export enum DefaultMessage { DEFAULT_DialogflowCloseChatMessage = 'Closing the chat, Goodbye', } +export const LanguageCode = [ + { key: 'zh-CN', i18nLabel: 'chinese_simplified' }, + { key: 'da', i18nLabel: 'danish' }, + { key: 'nl', i18nLabel: 'dutch' }, + { key: 'en', i18nLabel: 'english' }, + { key: 'en-AU', i18nLabel: 'english_australia' }, + { key: 'en-CA', i18nLabel: 'english_canada' }, + { key: 'en-GB', i18nLabel: 'english_great_britain' }, + { key: 'en-IN', i18nLabel: 'english_india' }, + { key: 'en-US', i18nLabel: 'english_us' }, + { key: 'fr-CA', i18nLabel: 'french_canada' }, + { key: 'fr-FR', i18nLabel: 'french_france' }, + { key: 'de', i18nLabel: 'german' }, + { key: 'hi', i18nLabel: 'hindi' }, + { key: 'id', i18nLabel: 'indonesian' }, + { key: 'it', i18nLabel: 'italian' }, + { key: 'ja', i18nLabel: 'japanese' }, + { key: 'ko', i18nLabel: 'korean' }, + { key: 'no', i18nLabel: 'norwegian' }, + { key: 'pl', i18nLabel: 'polish' }, + { key: 'pt-BR', i18nLabel: 'portuguese-brazil' }, + { key: 'pt', i18nLabel: 'portuguese-portugal' }, + { key: 'ru', i18nLabel: 'russian' }, + { key: 'es', i18nLabel: 'spanish' }, + { key: 'es-ES', i18nLabel: 'spanish-spain' }, + { key: 'sv', i18nLabel: 'swedish' }, + { key: 'tr', i18nLabel: 'turkish' }, + { key: 'uk', i18nLabel: 'ukrainian' }, +]; + export const settings: Array = [ { id: AppSetting.DialogflowBotUsername, @@ -71,6 +102,16 @@ export const settings: Array = [ i18nLabel: 'dialogflow_private_key', required: true, }, + { + id: AppSetting.DialogflowLanguage, + public: true, + type: SettingType.SELECT, + values: LanguageCode, + packageValue: 'en', + value: 'en', + i18nLabel: 'dialogflow_language', + required: false, + }, { id: AppSetting.DialogflowFallbackResponsesLimit, public: true, diff --git a/i18n/en.json b/i18n/en.json index beddb9f..00f5a03 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -18,5 +18,6 @@ "dialogflow_hide_quick_replies": "Hide Quick Replies", "dialogflow_hide_quick_replies_description": "If enabled, then all quick-replies will hide when a visitor clicks on any one of them", "dialogflow_handover_failed_message": "Handover Failed Message", - "dialogflow_handover_failed_message_description": "The Bot will send this message to Visitor if the handover failed because no agents were online" + "dialogflow_handover_failed_message_description": "The Bot will send this message to Visitor if the handover failed because no agents were online", + "dialogflow_language": "Language" } diff --git a/lib/Dialogflow.ts b/lib/Dialogflow.ts index 4dabbd2..5f76cd7 100644 --- a/lib/Dialogflow.ts +++ b/lib/Dialogflow.ts @@ -42,12 +42,14 @@ class DialogflowClass { sessionId, ); + const languageCode = await getAppSettingValue(read, AppSetting.DialogflowLanguage) || LanguageCode.EN; + const queryInput = { ...requestType === DialogflowRequestType.EVENT && { event: request, }, ...requestType === DialogflowRequestType.MESSAGE && { - text: { languageCode: LanguageCode.EN, text: request }, + text: { languageCode, text: request }, }, }; From 27cfc382cd6d0335bd9ac58021635326fba7e853 Mon Sep 17 00:00:00 2001 From: murtaza98 Date: Mon, 5 Oct 2020 09:51:12 +0530 Subject: [PATCH 2/7] Add i18n labels --- i18n/en.json | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/i18n/en.json b/i18n/en.json index 00f5a03..5201499 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -19,5 +19,32 @@ "dialogflow_hide_quick_replies_description": "If enabled, then all quick-replies will hide when a visitor clicks on any one of them", "dialogflow_handover_failed_message": "Handover Failed Message", "dialogflow_handover_failed_message_description": "The Bot will send this message to Visitor if the handover failed because no agents were online", - "dialogflow_language": "Language" + "dialogflow_language": "Language", + "chinese_simplified": "Chinese - Simplified", + "danish": "Danish", + "dutch": "Dutch", + "english": "English", + "english_australia": "English - Australia", + "english_canada": "English - Canada", + "english_great_britain": "English - Great Britain", + "english_india": "English - India", + "english_us": "English - US", + "french_canada": "French - Canada", + "french_france": "French - France", + "german": "German", + "hindi": "Hindi", + "indonesian": "Indonesian", + "italian": "Italian", + "japanese": "Japanese", + "korean": "Korean", + "norwegian": "Norwegian", + "polish": "Polish", + "portuguese-brazil": "Portuguese - Brazil", + "portuguese-portugal": "Portuguese - Portugal", + "russian": "Russian", + "spanish": "Spanish", + "spanish-spain": "Spanish - Spain", + "swedish": "Swedish", + "turkish": "Turkish", + "ukrainian": "Ukrainian" } From f0dcaa2ea4829cdffd6a564a79b6a8c6060afc72 Mon Sep 17 00:00:00 2001 From: Murtaza Patrawala <34130764+murtaza98@users.noreply.github.com> Date: Fri, 9 Oct 2020 16:48:58 +0530 Subject: [PATCH 3/7] Apply suggestions from code review Co-authored-by: Renato Becker --- config/Settings.ts | 12 ++++++------ lib/Dialogflow.ts | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/config/Settings.ts b/config/Settings.ts index f79df12..47485c9 100644 --- a/config/Settings.ts +++ b/config/Settings.ts @@ -16,7 +16,7 @@ export enum AppSetting { DialogflowHandoverFailedMessage = 'dialogflow_no_agents_online_for_handover', DialogflowCloseChatMessage = 'dialogflow_close_chat_message', DialogflowHideQuickReplies = 'dialogflow_hide_quick_replies', - DialogflowLanguage = 'dialogflow_language', + DialogflowDefaultLanguage = 'dialogflow_default_language', } export enum ServerSetting { @@ -31,11 +31,11 @@ export enum DefaultMessage { } export const LanguageCode = [ - { key: 'zh-CN', i18nLabel: 'chinese_simplified' }, + { key: 'zh-CN', i18nLabel: 'Chinese Simplified' }, { key: 'da', i18nLabel: 'danish' }, { key: 'nl', i18nLabel: 'dutch' }, { key: 'en', i18nLabel: 'english' }, - { key: 'en-AU', i18nLabel: 'english_australia' }, + { key: 'en-AU', i18nLabel: 'Australian English' }, { key: 'en-CA', i18nLabel: 'english_canada' }, { key: 'en-GB', i18nLabel: 'english_great_britain' }, { key: 'en-IN', i18nLabel: 'english_india' }, @@ -103,14 +103,14 @@ export const settings: Array = [ required: true, }, { - id: AppSetting.DialogflowLanguage, + id: AppSetting.DialogflowDefaultLanguage, public: true, type: SettingType.SELECT, values: LanguageCode, packageValue: 'en', value: 'en', - i18nLabel: 'dialogflow_language', - required: false, + i18nLabel: 'dialogflow_default_language', + required: false, }, { id: AppSetting.DialogflowFallbackResponsesLimit, diff --git a/lib/Dialogflow.ts b/lib/Dialogflow.ts index 5f76cd7..5ed89ba 100644 --- a/lib/Dialogflow.ts +++ b/lib/Dialogflow.ts @@ -42,7 +42,7 @@ class DialogflowClass { sessionId, ); - const languageCode = await getAppSettingValue(read, AppSetting.DialogflowLanguage) || LanguageCode.EN; + const languageCode = await getAppSettingValue(read, AppSetting.DialogflowDefaultLanguage) || LanguageCode.EN; const queryInput = { ...requestType === DialogflowRequestType.EVENT && { From 6a70bcaf833aeaa2acdd7633365b2e4e9b967742 Mon Sep 17 00:00:00 2001 From: Murtaza Patrawala <34130764+murtaza98@users.noreply.github.com> Date: Fri, 9 Oct 2020 17:00:10 +0530 Subject: [PATCH 4/7] Update Settings.ts --- config/Settings.ts | 50 +++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/config/Settings.ts b/config/Settings.ts index 47485c9..9ecba63 100644 --- a/config/Settings.ts +++ b/config/Settings.ts @@ -32,32 +32,32 @@ export enum DefaultMessage { export const LanguageCode = [ { key: 'zh-CN', i18nLabel: 'Chinese Simplified' }, - { key: 'da', i18nLabel: 'danish' }, - { key: 'nl', i18nLabel: 'dutch' }, - { key: 'en', i18nLabel: 'english' }, + { key: 'da', i18nLabel: 'Danish' }, + { key: 'nl', i18nLabel: 'Dutch' }, + { key: 'en', i18nLabel: 'English' }, { key: 'en-AU', i18nLabel: 'Australian English' }, - { key: 'en-CA', i18nLabel: 'english_canada' }, - { key: 'en-GB', i18nLabel: 'english_great_britain' }, - { key: 'en-IN', i18nLabel: 'english_india' }, - { key: 'en-US', i18nLabel: 'english_us' }, - { key: 'fr-CA', i18nLabel: 'french_canada' }, - { key: 'fr-FR', i18nLabel: 'french_france' }, - { key: 'de', i18nLabel: 'german' }, - { key: 'hi', i18nLabel: 'hindi' }, - { key: 'id', i18nLabel: 'indonesian' }, - { key: 'it', i18nLabel: 'italian' }, - { key: 'ja', i18nLabel: 'japanese' }, - { key: 'ko', i18nLabel: 'korean' }, - { key: 'no', i18nLabel: 'norwegian' }, - { key: 'pl', i18nLabel: 'polish' }, - { key: 'pt-BR', i18nLabel: 'portuguese-brazil' }, - { key: 'pt', i18nLabel: 'portuguese-portugal' }, - { key: 'ru', i18nLabel: 'russian' }, - { key: 'es', i18nLabel: 'spanish' }, - { key: 'es-ES', i18nLabel: 'spanish-spain' }, - { key: 'sv', i18nLabel: 'swedish' }, - { key: 'tr', i18nLabel: 'turkish' }, - { key: 'uk', i18nLabel: 'ukrainian' }, + { key: 'en-CA', i18nLabel: 'Canadian English' }, + { key: 'en-GB', i18nLabel: 'Great Britain English' }, + { key: 'en-IN', i18nLabel: 'Indian English' }, + { key: 'en-US', i18nLabel: 'US English' }, + { key: 'fr-CA', i18nLabel: 'Canadian-French' }, + { key: 'fr-FR', i18nLabel: 'France-French' }, + { key: 'de', i18nLabel: 'German' }, + { key: 'hi', i18nLabel: 'Hindi' }, + { key: 'id', i18nLabel: 'Indonesian' }, + { key: 'it', i18nLabel: 'Italian' }, + { key: 'ja', i18nLabel: 'Japanese' }, + { key: 'ko', i18nLabel: 'Korean' }, + { key: 'no', i18nLabel: 'Norwegian' }, + { key: 'pl', i18nLabel: 'Polish' }, + { key: 'pt-BR', i18nLabel: 'Portuguese-Brazil' }, + { key: 'pt', i18nLabel: 'Portuguese-Portugal' }, + { key: 'ru', i18nLabel: 'Russian' }, + { key: 'es', i18nLabel: 'Spanish' }, + { key: 'es-ES', i18nLabel: 'Ppanish-Spain' }, + { key: 'sv', i18nLabel: 'Swedish' }, + { key: 'tr', i18nLabel: 'Turkish' }, + { key: 'uk', i18nLabel: 'Ukrainian' }, ]; export const settings: Array = [ From 595e2fe337e4b3e99ce0070891b31d362b50581c Mon Sep 17 00:00:00 2001 From: murtaza98 Date: Tue, 13 Oct 2020 23:11:07 +0530 Subject: [PATCH 5/7] Update i18n file --- config/Settings.ts | 57 +++++++++++++++++++++++----------------------- i18n/en.json | 56 ++++++++++++++++++++++----------------------- 2 files changed, 57 insertions(+), 56 deletions(-) diff --git a/config/Settings.ts b/config/Settings.ts index 9ecba63..75d01ca 100644 --- a/config/Settings.ts +++ b/config/Settings.ts @@ -1,5 +1,6 @@ import { ISetting, + ISettingSelectValue, SettingType, } from '@rocket.chat/apps-engine/definition/settings'; @@ -30,34 +31,34 @@ export enum DefaultMessage { DEFAULT_DialogflowCloseChatMessage = 'Closing the chat, Goodbye', } -export const LanguageCode = [ - { key: 'zh-CN', i18nLabel: 'Chinese Simplified' }, - { key: 'da', i18nLabel: 'Danish' }, - { key: 'nl', i18nLabel: 'Dutch' }, - { key: 'en', i18nLabel: 'English' }, - { key: 'en-AU', i18nLabel: 'Australian English' }, - { key: 'en-CA', i18nLabel: 'Canadian English' }, - { key: 'en-GB', i18nLabel: 'Great Britain English' }, - { key: 'en-IN', i18nLabel: 'Indian English' }, - { key: 'en-US', i18nLabel: 'US English' }, - { key: 'fr-CA', i18nLabel: 'Canadian-French' }, - { key: 'fr-FR', i18nLabel: 'France-French' }, - { key: 'de', i18nLabel: 'German' }, - { key: 'hi', i18nLabel: 'Hindi' }, - { key: 'id', i18nLabel: 'Indonesian' }, - { key: 'it', i18nLabel: 'Italian' }, - { key: 'ja', i18nLabel: 'Japanese' }, - { key: 'ko', i18nLabel: 'Korean' }, - { key: 'no', i18nLabel: 'Norwegian' }, - { key: 'pl', i18nLabel: 'Polish' }, - { key: 'pt-BR', i18nLabel: 'Portuguese-Brazil' }, - { key: 'pt', i18nLabel: 'Portuguese-Portugal' }, - { key: 'ru', i18nLabel: 'Russian' }, - { key: 'es', i18nLabel: 'Spanish' }, - { key: 'es-ES', i18nLabel: 'Ppanish-Spain' }, - { key: 'sv', i18nLabel: 'Swedish' }, - { key: 'tr', i18nLabel: 'Turkish' }, - { key: 'uk', i18nLabel: 'Ukrainian' }, +export const LanguageCode: Array = [ + { key: 'zh-CN', i18nLabel: 'dialogflow_chinese_simplified' }, + { key: 'da', i18nLabel: 'dialogflow_danish' }, + { key: 'nl', i18nLabel: 'dialogflow_dutch' }, + { key: 'en', i18nLabel: 'dialogflow_english' }, + { key: 'en-AU', i18nLabel: 'dialogflow_english_australia' }, + { key: 'en-CA', i18nLabel: 'dialogflow_english_canada' }, + { key: 'en-GB', i18nLabel: 'dialogflow_english_great_britain' }, + { key: 'en-IN', i18nLabel: 'dialogflow_english_india' }, + { key: 'en-US', i18nLabel: 'dialogflow_english_us' }, + { key: 'fr-CA', i18nLabel: 'dialogflow_french_canada' }, + { key: 'fr-FR', i18nLabel: 'dialogflow_french_france' }, + { key: 'de', i18nLabel: 'dialogflow_german' }, + { key: 'hi', i18nLabel: 'dialogflow_hindi' }, + { key: 'id', i18nLabel: 'dialogflow_indonesian' }, + { key: 'it', i18nLabel: 'dialogflow_italian' }, + { key: 'ja', i18nLabel: 'dialogflow_japanese' }, + { key: 'ko', i18nLabel: 'dialogflow_korean' }, + { key: 'no', i18nLabel: 'dialogflow_norwegian' }, + { key: 'pl', i18nLabel: 'dialogflow_polish' }, + { key: 'pt-BR', i18nLabel: 'dialogflow_portuguese-brazil' }, + { key: 'pt', i18nLabel: 'dialogflow_portuguese-portugal' }, + { key: 'ru', i18nLabel: 'dialogflow_russian' }, + { key: 'es', i18nLabel: 'dialogflow_spanish' }, + { key: 'es-ES', i18nLabel: 'dialogflow_spanish-spain' }, + { key: 'sv', i18nLabel: 'dialogflow_swedish' }, + { key: 'tr', i18nLabel: 'dialogflow_turkish' }, + { key: 'uk', i18nLabel: 'dialogflow_ukrainian' }, ]; export const settings: Array = [ diff --git a/i18n/en.json b/i18n/en.json index 5201499..1138c56 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -19,32 +19,32 @@ "dialogflow_hide_quick_replies_description": "If enabled, then all quick-replies will hide when a visitor clicks on any one of them", "dialogflow_handover_failed_message": "Handover Failed Message", "dialogflow_handover_failed_message_description": "The Bot will send this message to Visitor if the handover failed because no agents were online", - "dialogflow_language": "Language", - "chinese_simplified": "Chinese - Simplified", - "danish": "Danish", - "dutch": "Dutch", - "english": "English", - "english_australia": "English - Australia", - "english_canada": "English - Canada", - "english_great_britain": "English - Great Britain", - "english_india": "English - India", - "english_us": "English - US", - "french_canada": "French - Canada", - "french_france": "French - France", - "german": "German", - "hindi": "Hindi", - "indonesian": "Indonesian", - "italian": "Italian", - "japanese": "Japanese", - "korean": "Korean", - "norwegian": "Norwegian", - "polish": "Polish", - "portuguese-brazil": "Portuguese - Brazil", - "portuguese-portugal": "Portuguese - Portugal", - "russian": "Russian", - "spanish": "Spanish", - "spanish-spain": "Spanish - Spain", - "swedish": "Swedish", - "turkish": "Turkish", - "ukrainian": "Ukrainian" + "dialogflow_default_language": "Language", + "dialogflow_chinese_simplified": "Chinese - Simplified", + "dialogflow_danish": "Danish", + "dialogflow_dutch": "Dutch", + "dialogflow_english": "English", + "dialogflow_english_australia": "English - Australia", + "dialogflow_english_canada": "English - Canada", + "dialogflow_english_great_britain": "English - Great Britain", + "dialogflow_english_india": "English - India", + "dialogflow_english_us": "English - US", + "dialogflow_french_canada": "French - Canada", + "dialogflow_french_france": "French - France", + "dialogflow_german": "German", + "dialogflow_hindi": "Hindi", + "dialogflow_indonesian": "Indonesian", + "dialogflow_italian": "Italian", + "dialogflow_japanese": "Japanese", + "dialogflow_korean": "Korean", + "dialogflow_norwegian": "Norwegian", + "dialogflow_polish": "Polish", + "dialogflow_portuguese-brazil": "Portuguese - Brazil", + "dialogflow_portuguese-portugal": "Portuguese - Portugal", + "dialogflow_russian": "Russian", + "dialogflow_spanish": "Spanish", + "dialogflow_spanish-spain": "Spanish - Spain", + "dialogflow_swedish": "Swedish", + "dialogflow_turkish": "Turkish", + "dialogflow_ukrainian": "Ukrainian" } From 74ee897eb026691b92c1eb2ce66dbeed246b51fa Mon Sep 17 00:00:00 2001 From: murtaza98 Date: Thu, 15 Oct 2020 15:46:15 +0530 Subject: [PATCH 6/7] Update i18nLabels for all languages --- config/Settings.ts | 54 +++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/config/Settings.ts b/config/Settings.ts index 75d01ca..73e4b8a 100644 --- a/config/Settings.ts +++ b/config/Settings.ts @@ -32,33 +32,33 @@ export enum DefaultMessage { } export const LanguageCode: Array = [ - { key: 'zh-CN', i18nLabel: 'dialogflow_chinese_simplified' }, - { key: 'da', i18nLabel: 'dialogflow_danish' }, - { key: 'nl', i18nLabel: 'dialogflow_dutch' }, - { key: 'en', i18nLabel: 'dialogflow_english' }, - { key: 'en-AU', i18nLabel: 'dialogflow_english_australia' }, - { key: 'en-CA', i18nLabel: 'dialogflow_english_canada' }, - { key: 'en-GB', i18nLabel: 'dialogflow_english_great_britain' }, - { key: 'en-IN', i18nLabel: 'dialogflow_english_india' }, - { key: 'en-US', i18nLabel: 'dialogflow_english_us' }, - { key: 'fr-CA', i18nLabel: 'dialogflow_french_canada' }, - { key: 'fr-FR', i18nLabel: 'dialogflow_french_france' }, - { key: 'de', i18nLabel: 'dialogflow_german' }, - { key: 'hi', i18nLabel: 'dialogflow_hindi' }, - { key: 'id', i18nLabel: 'dialogflow_indonesian' }, - { key: 'it', i18nLabel: 'dialogflow_italian' }, - { key: 'ja', i18nLabel: 'dialogflow_japanese' }, - { key: 'ko', i18nLabel: 'dialogflow_korean' }, - { key: 'no', i18nLabel: 'dialogflow_norwegian' }, - { key: 'pl', i18nLabel: 'dialogflow_polish' }, - { key: 'pt-BR', i18nLabel: 'dialogflow_portuguese-brazil' }, - { key: 'pt', i18nLabel: 'dialogflow_portuguese-portugal' }, - { key: 'ru', i18nLabel: 'dialogflow_russian' }, - { key: 'es', i18nLabel: 'dialogflow_spanish' }, - { key: 'es-ES', i18nLabel: 'dialogflow_spanish-spain' }, - { key: 'sv', i18nLabel: 'dialogflow_swedish' }, - { key: 'tr', i18nLabel: 'dialogflow_turkish' }, - { key: 'uk', i18nLabel: 'dialogflow_ukrainian' }, + { key: 'zh-CN', i18nLabel: 'Chinese - Simplified' }, + { key: 'da', i18nLabel: 'Danish' }, + { key: 'nl', i18nLabel: 'Dutch' }, + { key: 'en', i18nLabel: 'English' }, + { key: 'en-AU', i18nLabel: 'English - Australia' }, + { key: 'en-CA', i18nLabel: 'English - Canada' }, + { key: 'en-GB', i18nLabel: 'English - Great Britain' }, + { key: 'en-IN', i18nLabel: 'English - India' }, + { key: 'en-US', i18nLabel: 'English - US' }, + { key: 'fr-CA', i18nLabel: 'French - Canada' }, + { key: 'fr-FR', i18nLabel: 'French - France' }, + { key: 'de', i18nLabel: 'German' }, + { key: 'hi', i18nLabel: 'Hindi' }, + { key: 'id', i18nLabel: 'Indonesian' }, + { key: 'it', i18nLabel: 'Italian' }, + { key: 'ja', i18nLabel: 'Japanese' }, + { key: 'ko', i18nLabel: 'Korean' }, + { key: 'no', i18nLabel: 'Norwegian' }, + { key: 'pl', i18nLabel: 'Polish' }, + { key: 'pt-BR', i18nLabel: 'Portuguese - Brazil' }, + { key: 'pt', i18nLabel: 'Portuguese - Portugal' }, + { key: 'ru', i18nLabel: 'Russian' }, + { key: 'es', i18nLabel: 'Spanish' }, + { key: 'es-ES', i18nLabel: 'Spanish - Spain' }, + { key: 'sv', i18nLabel: 'Swedish' }, + { key: 'tr', i18nLabel: 'Turkish' }, + { key: 'uk', i18nLabel: 'Ukrainian' }, ]; export const settings: Array = [ From 74987125f9ef815610b2be320ed13d2490c48cf1 Mon Sep 17 00:00:00 2001 From: murtaza98 Date: Thu, 9 Dec 2021 17:17:56 +0530 Subject: [PATCH 7/7] Add setting description --- config/Settings.ts | 1 + i18n/en.json | 1 + 2 files changed, 2 insertions(+) diff --git a/config/Settings.ts b/config/Settings.ts index 73e4b8a..9e8fda8 100644 --- a/config/Settings.ts +++ b/config/Settings.ts @@ -111,6 +111,7 @@ export const settings: Array = [ packageValue: 'en', value: 'en', i18nLabel: 'dialogflow_default_language', + i18nDescription: 'dialogflow_default_language_description', required: false, }, { diff --git a/i18n/en.json b/i18n/en.json index 1138c56..2265646 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -20,6 +20,7 @@ "dialogflow_handover_failed_message": "Handover Failed Message", "dialogflow_handover_failed_message_description": "The Bot will send this message to Visitor if the handover failed because no agents were online", "dialogflow_default_language": "Language", + "dialogflow_default_language_description": "Define the language in which you'd be interacting with the Bot", "dialogflow_chinese_simplified": "Chinese - Simplified", "dialogflow_danish": "Danish", "dialogflow_dutch": "Dutch",