From 93d8157a552d27e64a4c5603e46ca8feab6cd14e Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Tue, 20 Jun 2023 17:29:05 +0530 Subject: [PATCH] feat: Adds Lithuanian language selectable as site language (#7354) --- app/javascript/dashboard/i18n/index.js | 2 + .../dashboard/i18n/locale/lt/index.js | 65 +++++++++++++++++++ app/javascript/survey/i18n/index.js | 2 + app/javascript/widget/i18n/index.js | 2 + config/initializers/languages.rb | 3 +- spec/jobs/account/contacts_export_job_spec.rb | 4 +- 6 files changed, 75 insertions(+), 3 deletions(-) create mode 100644 app/javascript/dashboard/i18n/locale/lt/index.js diff --git a/app/javascript/dashboard/i18n/index.js b/app/javascript/dashboard/i18n/index.js index a00dd2517..919fcef11 100644 --- a/app/javascript/dashboard/i18n/index.js +++ b/app/javascript/dashboard/i18n/index.js @@ -35,6 +35,7 @@ import vi from './locale/vi'; import zh_CN from './locale/zh_CN'; import zh_TW from './locale/zh_TW'; import is from './locale/is'; +import lt from './locale/lt'; export default { ar, @@ -74,4 +75,5 @@ export default { zh_CN, zh_TW, is, + lt, }; diff --git a/app/javascript/dashboard/i18n/locale/lt/index.js b/app/javascript/dashboard/i18n/locale/lt/index.js new file mode 100644 index 000000000..434e50e1d --- /dev/null +++ b/app/javascript/dashboard/i18n/locale/lt/index.js @@ -0,0 +1,65 @@ +import advancedFilters from './advancedFilters.json'; +import agentBots from './agentBots.json'; +import agentMgmt from './agentMgmt.json'; +import attributesMgmt from './attributesMgmt.json'; +import auditLogs from './auditLogs.json'; +import automation from './automation.json'; +import bulkActions from './bulkActions.json'; +import campaign from './campaign.json'; +import cannedMgmt from './cannedMgmt.json'; +import chatlist from './chatlist.json'; +import contact from './contact.json'; +import contactFilters from './contactFilters.json'; +import conversation from './conversation.json'; +import csatMgmt from './csatMgmt.json'; +import emoji from './emoji.json'; +import generalSettings from './generalSettings.json'; +import helpCenter from './helpCenter.json'; +import inboxMgmt from './inboxMgmt.json'; +import integrationApps from './integrationApps.json'; +import integrations from './integrations.json'; +import labelsMgmt from './labelsMgmt.json'; +import login from './login.json'; +import macros from './macros.json'; +import report from './report.json'; +import resetPassword from './resetPassword.json'; +import search from './search.json'; +import setNewPassword from './setNewPassword.json'; +import settings from './settings.json'; +import signup from './signup.json'; +import teamsSettings from './teamsSettings.json'; +import whatsappTemplates from './whatsappTemplates.json'; + +export default { + ...advancedFilters, + ...agentBots, + ...agentMgmt, + ...attributesMgmt, + ...auditLogs, + ...automation, + ...bulkActions, + ...campaign, + ...cannedMgmt, + ...chatlist, + ...contact, + ...contactFilters, + ...conversation, + ...csatMgmt, + ...emoji, + ...generalSettings, + ...helpCenter, + ...inboxMgmt, + ...integrationApps, + ...integrations, + ...labelsMgmt, + ...login, + ...macros, + ...report, + ...resetPassword, + ...search, + ...setNewPassword, + ...settings, + ...signup, + ...teamsSettings, + ...whatsappTemplates, +}; diff --git a/app/javascript/survey/i18n/index.js b/app/javascript/survey/i18n/index.js index 77a8668d3..5c3659a02 100644 --- a/app/javascript/survey/i18n/index.js +++ b/app/javascript/survey/i18n/index.js @@ -17,6 +17,7 @@ import is from './locale/is.json'; import it from './locale/it.json'; import ja from './locale/ja.json'; import ko from './locale/ko.json'; +import lt from './locale/lt.json'; import lv from './locale/lv.json'; import ml from './locale/ml.json'; import nl from './locale/nl.json'; @@ -56,6 +57,7 @@ export default { it, ja, ko, + lt, lv, ml, nl, diff --git a/app/javascript/widget/i18n/index.js b/app/javascript/widget/i18n/index.js index c5b2c935f..a76585069 100644 --- a/app/javascript/widget/i18n/index.js +++ b/app/javascript/widget/i18n/index.js @@ -17,6 +17,7 @@ import is from './locale/is.json'; import it from './locale/it.json'; import ja from './locale/ja.json'; import ko from './locale/ko.json'; +import lt from './locale/lt.json'; import lv from './locale/lv.json'; import ml from './locale/ml.json'; import nl from './locale/nl.json'; @@ -56,6 +57,7 @@ export default { it, ja, ko, + lt, lv, ml, nl, diff --git a/config/initializers/languages.rb b/config/initializers/languages.rb index 44ce2df2a..3f8a9f1b4 100644 --- a/config/initializers/languages.rb +++ b/config/initializers/languages.rb @@ -39,7 +39,8 @@ LANGUAGES_CONFIG = { 34 => { name: 'ภาษาไทย (th)', iso_639_3_code: 'tha', iso_639_1_code: 'th', enabled: true }, 35 => { name: 'latviešu valoda (lv)', iso_639_3_code: 'lav', iso_639_1_code: 'lv', enabled: true }, 36 => { name: 'íslenska (is)', iso_639_3_code: 'isl', iso_639_1_code: 'is', enabled: true }, - 37 => { name: 'עִברִית (he)', iso_639_3_code: 'heb', iso_639_1_code: 'he', enabled: true } + 37 => { name: 'עִברִית (he)', iso_639_3_code: 'heb', iso_639_1_code: 'he', enabled: true }, + 38 => { name: 'lietuvių (lt)', iso_639_3_code: 'lit', iso_639_1_code: 'lt', 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/spec/jobs/account/contacts_export_job_spec.rb b/spec/jobs/account/contacts_export_job_spec.rb index 48d2f6e6e..cdab668a8 100644 --- a/spec/jobs/account/contacts_export_job_spec.rb +++ b/spec/jobs/account/contacts_export_job_spec.rb @@ -39,8 +39,8 @@ RSpec.describe Account::ContactsExportJob do csv_data = CSV.parse(account.contacts_export.download, headers: true) first_row = csv_data[0] last_row = csv_data[csv_data.length - 1] - first_contact = account.contacts.first - last_contact = account.contacts.last + first_contact = account.contacts.find_by(email: 'test1@text.example') + last_contact = account.contacts.find_by(email: 'test2@text.example') expect(csv_data.length).to eq(account.contacts.count)