From 98e20e8607edf5199932dcd2cb4ea6231854d100 Mon Sep 17 00:00:00 2001 From: Pranav Raj S Date: Tue, 20 Apr 2021 16:22:03 +0530 Subject: [PATCH] chore: Enable the languages no, zh-CN, hu (#2135) --- app/javascript/dashboard/i18n/index.js | 6 ++-- .../dashboard/i18n/locale/no/index.js | 33 +++++++++++++++++++ .../dashboard/i18n/locale/zh_CN/index.js | 33 +++++++++++++++++++ app/javascript/widget/i18n/index.js | 8 +++-- config/initializers/languages.rb | 6 ++-- config/locales/devise.zh_CN.yml | 2 +- config/locales/zh_CN.yml | 2 +- 7 files changed, 82 insertions(+), 8 deletions(-) create mode 100644 app/javascript/dashboard/i18n/locale/no/index.js create mode 100644 app/javascript/dashboard/i18n/locale/zh_CN/index.js diff --git a/app/javascript/dashboard/i18n/index.js b/app/javascript/dashboard/i18n/index.js index 7d185392a..940a1ae4c 100644 --- a/app/javascript/dashboard/i18n/index.js +++ b/app/javascript/dashboard/i18n/index.js @@ -17,6 +17,7 @@ import ja from './locale/ja'; import ko from './locale/ko'; import ml from './locale/ml'; import nl from './locale/nl'; +import no from './locale/no'; import pl from './locale/pl'; import pt from './locale/pt'; import pt_BR from './locale/pt_BR'; @@ -28,7 +29,7 @@ import ta from './locale/ta'; import tr from './locale/tr'; import uk from './locale/uk'; import vi from './locale/vi'; -import zh from './locale/zh'; +import zh_CN from './locale/zh_CN'; import zh_TW from './locale/zh_TW'; export default { @@ -51,6 +52,7 @@ export default { ko, ml, nl, + no, pl, pt, pt_BR, @@ -62,6 +64,6 @@ export default { tr, uk, vi, - zh, + zh_CN, zh_TW, }; diff --git a/app/javascript/dashboard/i18n/locale/no/index.js b/app/javascript/dashboard/i18n/locale/no/index.js new file mode 100644 index 000000000..5dfc44e4b --- /dev/null +++ b/app/javascript/dashboard/i18n/locale/no/index.js @@ -0,0 +1,33 @@ +import { default as _agentMgmt } from './agentMgmt.json'; +import { default as _labelsMgmt } from './labelsMgmt.json'; +import { default as _cannedMgmt } from './cannedMgmt.json'; +import { default as _chatlist } from './chatlist.json'; +import { default as _contact } from './contact.json'; +import { default as _conversation } from './conversation.json'; +import { default as _inboxMgmt } from './inboxMgmt.json'; +import { default as _login } from './login.json'; +import { default as _report } from './report.json'; +import { default as _resetPassword } from './resetPassword.json'; +import { default as _setNewPassword } from './setNewPassword.json'; +import { default as _settings } from './settings.json'; +import { default as _signup } from './signup.json'; +import { default as _integrations } from './integrations.json'; +import { default as _generalSettings } from './generalSettings.json'; + +export default { + ..._agentMgmt, + ..._cannedMgmt, + ..._chatlist, + ..._contact, + ..._conversation, + ..._inboxMgmt, + ..._login, + ..._report, + ..._labelsMgmt, + ..._resetPassword, + ..._setNewPassword, + ..._settings, + ..._signup, + ..._integrations, + ..._generalSettings, +}; diff --git a/app/javascript/dashboard/i18n/locale/zh_CN/index.js b/app/javascript/dashboard/i18n/locale/zh_CN/index.js new file mode 100644 index 000000000..5dfc44e4b --- /dev/null +++ b/app/javascript/dashboard/i18n/locale/zh_CN/index.js @@ -0,0 +1,33 @@ +import { default as _agentMgmt } from './agentMgmt.json'; +import { default as _labelsMgmt } from './labelsMgmt.json'; +import { default as _cannedMgmt } from './cannedMgmt.json'; +import { default as _chatlist } from './chatlist.json'; +import { default as _contact } from './contact.json'; +import { default as _conversation } from './conversation.json'; +import { default as _inboxMgmt } from './inboxMgmt.json'; +import { default as _login } from './login.json'; +import { default as _report } from './report.json'; +import { default as _resetPassword } from './resetPassword.json'; +import { default as _setNewPassword } from './setNewPassword.json'; +import { default as _settings } from './settings.json'; +import { default as _signup } from './signup.json'; +import { default as _integrations } from './integrations.json'; +import { default as _generalSettings } from './generalSettings.json'; + +export default { + ..._agentMgmt, + ..._cannedMgmt, + ..._chatlist, + ..._contact, + ..._conversation, + ..._inboxMgmt, + ..._login, + ..._report, + ..._labelsMgmt, + ..._resetPassword, + ..._setNewPassword, + ..._settings, + ..._signup, + ..._integrations, + ..._generalSettings, +}; diff --git a/app/javascript/widget/i18n/index.js b/app/javascript/widget/i18n/index.js index 5c1463a39..7abdefd2b 100644 --- a/app/javascript/widget/i18n/index.js +++ b/app/javascript/widget/i18n/index.js @@ -17,6 +17,7 @@ import { default as ja } from './locale/ja.json'; import { default as ko } from './locale/ko.json'; import { default as ml } from './locale/ml.json'; import { default as nl } from './locale/nl.json'; +import { default as no } from './locale/no.json'; import { default as pl } from './locale/pl.json'; import { default as pt } from './locale/pt.json'; import { default as pt_BR } from './locale/pt_BR.json'; @@ -28,7 +29,8 @@ import { default as ta } from './locale/ta.json'; import { default as tr } from './locale/tr.json'; import { default as uk } from './locale/uk.json'; import { default as vi } from './locale/vi.json'; -import { default as zh } from './locale/zh.json'; +import { default as zh_CN } from './locale/zh_CN.json'; +import { default as zh_TW } from './locale/zh_TW.json'; export default { ar, @@ -50,6 +52,7 @@ export default { ko, ml, nl, + no, pl, pt, pt_BR, @@ -61,5 +64,6 @@ export default { tr, uk, vi, - zh, + zh_CN, + zh_TW, }; diff --git a/config/initializers/languages.rb b/config/initializers/languages.rb index 3261d1218..bf4d9857d 100644 --- a/config/initializers/languages.rb +++ b/config/initializers/languages.rb @@ -29,8 +29,10 @@ LANGUAGES_CONFIG = { 24 => { name: 'čeština (cs)', iso_639_3_code: 'ces', iso_639_1_code: 'cs', enabled: true }, 25 => { name: 'suomi, suomen kieli (fi)', iso_639_3_code: 'fin', iso_639_1_code: 'fi', enabled: true }, 26 => { name: 'Bahasa Indonesia (id)', iso_639_3_code: 'ind', iso_639_1_code: 'id', enabled: true }, - 27 => { name: 'Svenska (sv)', iso_639_3_code: 'swe', iso_639_1_code: 'sv', enabled: true } - + 27 => { name: 'Svenska (sv)', iso_639_3_code: 'swe', iso_639_1_code: 'sv', enabled: true }, + 28 => { name: 'magyar nyelv (hu)', iso_639_3_code: 'hun', iso_639_1_code: 'hu', enabled: true }, + 29 => { name: 'norsk (no)', iso_639_3_code: 'nor', iso_639_1_code: 'no', enabled: true }, + 30 => { name: '中文 (zh-CN)', iso_639_3_code: 'zho', iso_639_1_code: 'zh_CN', enabled: true } }.filter { |_key, val| val[:enabled] }.freeze Rails.configuration.i18n.available_locales = LANGUAGES_CONFIG.map { |_index, lang| lang[:iso_639_1_code].to_sym } diff --git a/config/locales/devise.zh_CN.yml b/config/locales/devise.zh_CN.yml index f8613c84c..2bf2831a8 100644 --- a/config/locales/devise.zh_CN.yml +++ b/config/locales/devise.zh_CN.yml @@ -1,5 +1,5 @@ #Additional translations at https://github.com/plataformatec/devise/wiki/I18n -zh-CN: +zh_CN: devise: confirmations: confirmed: "您的电子邮件地址已成功确认。" diff --git a/config/locales/zh_CN.yml b/config/locales/zh_CN.yml index 90c73b4df..acd97eb73 100644 --- a/config/locales/zh_CN.yml +++ b/config/locales/zh_CN.yml @@ -16,7 +16,7 @@ #'true': 'foo' #To learn more, please read the Rails Internationalization guide #available at https://guides.rubyonrails.org/i18n.html. -zh-CN: +zh_CN: hello: "您好世界" messages: reset_password_success: 哇!密码重置请求成功。请检查您的邮件获取说明。