Open-source live-chat, email support, omni-channel desk. An alternative to Intercom, Zendesk, Salesforce Service Cloud etc. 🔥💬
Ruby actioncablechat-widgetconversationcustomer-supportdashboarddesigndockerdocker-imageherokuintercomjavascriptlivechatopensourcerailsrubysassvuejswhatsappzendesk
feat: add auto translate feature flag and account setting [1] (#16279)
Sivin Varghese4e6a4d3ad446
diff --git a/app/controllers/api/v1/accounts_controller.rb b/app/controllers/api/v1/accounts_controller.rbindex 5c049d1d7e5..4658088c57b 100644--- a/app/controllers/api/v1/accounts_controller.rb+++ b/app/controllers/api/v1/accounts_controller.rb@@ -147,7 +147,8 @@ class Api::V1::AccountsController < Api::BaseControllerenddef permitted_settings_attributes- attributes = [:auto_resolve_after, :auto_resolve_message, :auto_resolve_ignore_waiting, :audio_transcriptions, :auto_resolve_label]+ attributes = [:auto_resolve_after, :auto_resolve_message, :auto_resolve_ignore_waiting, :audio_transcriptions, :auto_resolve_label,+ :auto_translate]attributes << :enforce_mfa if Chatwoot.mfa_enabled?attributesenddiff --git a/app/javascript/dashboard/featureFlags.js b/app/javascript/dashboard/featureFlags.jsindex 6d9422e7866..cb8491d0ad6 100644--- a/app/javascript/dashboard/featureFlags.js+++ b/app/javascript/dashboard/featureFlags.js@@ -4,6 +4,7 @@ export const FEATURE_FLAGS = {ASSIGNMENT_V2: 'assignment_v2',ADVANCED_ASSIGNMENT: 'advanced_assignment',AUTO_RESOLVE_CONVERSATIONS: 'auto_resolve_conversations',+ AUTO_TRANSLATE: 'auto_translate',AUTOMATIONS: 'automations',CAMPAIGNS: 'campaigns',CAMPAIGN_ANALYTICS: 'campaign_analytics',diff --git a/app/javascript/dashboard/i18n/locale/en/generalSettings.json b/app/javascript/dashboard/i18n/locale/en/generalSettings.jsonindex cfad20e8e33..d2c20290a1b 100644--- a/app/javascript/dashboard/i18n/locale/en/generalSettings.json+++ b/app/javascript/dashboard/i18n/locale/en/generalSettings.json@@ -44,6 +44,14 @@"TITLE": "Account ID","NOTE": "This ID is required if you are building an API based integration"},+ "AUTO_TRANSLATE": {+ "TITLE": "Auto translate conversations",+ "NOTE": "Show incoming messages in each agent's language and send replies in the contact's language, using Captain.",+ "API": {+ "SUCCESS": "Auto translate setting updated successfully",+ "ERROR": "Failed to update auto translate setting"+ }+ },"AUTO_RESOLVE": {"TITLE": "Auto-resolve conversations","NOTE": "This configuration would allow you to automatically resolve the conversation after a certain period of inactivity.",diff --git a/app/javascript/dashboard/routes/dashboard/settings/account/components/AutoTranslate.vue b/app/javascript/dashboard/routes/dashboard/settings/account/components/AutoTranslate.vuenew file mode 100644index 00000000000..1bdc1c41920--- /dev/null+++ b/app/javascript/dashboard/routes/dashboard/settings/account/components/AutoTranslate.vue@@ -0,0 +1,44 @@+<script setup>+import { ref, watch } from 'vue';+import { useI18n } from 'vue-i18n';+import { useAccount } from 'dashboard/composables/useAccount';+import { useAlert } from 'dashboard/composables';+import Switch from 'next/switch/Switch.vue';++const { t } = useI18n();+const { currentAccount, updateAccount } = useAccount();+const isEnabled = ref(false);++watch(+ currentAccount,+ account => {+ isEnabled.value = account?.settings?.auto_translate === true;+ },+ { immediate: true, deep: true }+);++const toggleAutoTranslate = async () => {+ try {+ await updateAccount({ auto_translate: isEnabled.value }, { silent: true });+ useAlert(t('GENERAL_SETTINGS.FORM.AUTO_TRANSLATE.API.SUCCESS'));+ } catch {+ useAlert(t('GENERAL_SETTINGS.FORM.AUTO_TRANSLATE.API.ERROR'));+ }+};+</script>++<template>+ <div+ class="flex flex-col gap-2 items-start px-5 py-4 w-full outline-1 outline outline-n-container rounded-xl bg-n-solid-2"+ >+ <div class="flex justify-between items-center w-full">+ <h3 class="text-heading-2 text-n-slate-12">+ {{ t('GENERAL_SETTINGS.FORM.AUTO_TRANSLATE.TITLE') }}+ </h3>+ <Switch v-model="isEnabled" @change="toggleAutoTranslate" />+ </div>+ <p class="mb-0 text-body-para text-n-slate-11">+ {{ t('GENERAL_SETTINGS.FORM.AUTO_TRANSLATE.NOTE') }}+ </p>+ </div>+</template>diff --git a/app/javascript/dashboard/routes/dashboard/settings/conversationWorkflow/index.vue b/app/javascript/dashboard/routes/dashboard/settings/conversationWorkflow/index.vueindex f862d27809f..7c4beaeaf82 100644--- a/app/javascript/dashboard/routes/dashboard/settings/conversationWorkflow/index.vue+++ b/app/javascript/dashboard/routes/dashboard/settings/conversationWorkflow/index.vue@@ -7,6 +7,7 @@ import BaseSettingsHeader from '../components/BaseSettingsHeader.vue';import SettingsLayout from '../SettingsLayout.vue';import ConversationRequiredAttributes from 'dashboard/components-next/ConversationWorkflow/ConversationRequiredAttributes.vue';import AutoResolve from 'dashboard/routes/dashboard/settings/account/components/AutoResolve.vue';+import AutoTranslate from 'dashboard/routes/dashboard/settings/account/components/AutoTranslate.vue';const { accountId } = useAccount();const isFeatureEnabledonAccount = useMapGetter(@@ -20,6 +21,13 @@ const showAutoResolutionConfig = computed(() => {);});+const showAutoTranslate = computed(() => {+ return isFeatureEnabledonAccount.value(+ accountId.value,+ FEATURE_FLAGS.AUTO_TRANSLATE+ );+});+const showRequiredAttributes = computed(() => {return isFeatureEnabledonAccount.value(accountId.value,@@ -41,6 +49,7 @@ const showRequiredAttributes = computed(() => {<template #body><div class="flex flex-col gap-6 mt-4"><AutoResolve v-if="showAutoResolutionConfig" />+ <AutoTranslate v-if="showAutoTranslate" /><ConversationRequiredAttributes :is-enabled="showRequiredAttributes" /></div></template>diff --git a/app/models/account.rb b/app/models/account.rbindex 3baa916f67e..98eb06348fa 100644--- a/app/models/account.rb+++ b/app/models/account.rb@@ -54,7 +54,7 @@ class Account < ApplicationRecordstore_accessor :settings, :auto_resolve_after, :auto_resolve_message, :auto_resolve_ignore_waiting- store_accessor :settings, :audio_transcriptions, :auto_resolve_label+ store_accessor :settings, :audio_transcriptions, :auto_resolve_label, :auto_translatestore_accessor :settings, :captain_models, :captain_featuresstore_accessor :settings, :reporting_timezonestore_accessor :settings, :keep_pending_on_bot_failurediff --git a/app/models/concerns/account_settings_schema.rb b/app/models/concerns/account_settings_schema.rbindex fe10ac3df34..0738386d334 100644--- a/app/models/concerns/account_settings_schema.rb+++ b/app/models/concerns/account_settings_schema.rb@@ -12,6 +12,7 @@ module AccountSettingsSchema'auto_resolve_message': { 'type': %w[string null] },'auto_resolve_ignore_waiting': { 'type': %w[boolean null] },'audio_transcriptions': { 'type': %w[boolean null] },+ 'auto_translate': { 'type': %w[boolean null] },'auto_resolve_label': { 'type': %w[string null] },'enforce_mfa': { 'type': %w[boolean null] },'keep_pending_on_bot_failure': { 'type': %w[boolean null] },diff --git a/config/features.yml b/config/features.ymlindex e8fc25c4d2c..1becedf7242 100644--- a/config/features.yml+++ b/config/features.yml@@ -309,3 +309,8 @@enabled: truehidden: truecolumn: feature_flags_ext_1+- name: auto_translate+ display_name: Auto Translate+ enabled: false+ premium: true+ column: feature_flags_ext_1diff --git a/config/llm.yml b/config/llm.ymlindex 4457a6ced45..544048d40ac 100644--- a/config/llm.yml+++ b/config/llm.yml@@ -35,6 +35,14 @@ models:provider: openaidisplay_name: 'GPT-5.2'credit_multiplier: 3+ gpt-6-luna:+ provider: openai+ display_name: 'GPT-6 Luna'+ credit_multiplier: 1+ gpt-6.1-sol:+ provider: openai+ display_name: 'GPT-6.1 Sol'+ credit_multiplier: 2claude-haiku-4.5:provider: anthropicdisplay_name: 'Claude Haiku 4.5'@@ -190,6 +198,12 @@ features:help_center_query_translation:models: [gpt-4.1-nano, gpt-4.1-mini, gpt-5-mini]default: gpt-4.1-nano+ message_translation:+ models: [gpt-6-luna, gpt-6.1-sol, gpt-5.2, gpt-5-mini, gpt-4.1-mini]+ default: gpt-6-luna+ language_detection:+ models: [gpt-5-mini, gpt-5-nano]+ default: gpt-5-miniaudio_transcription:models: [gpt-4o-mini-transcribe, whisper-1]default: gpt-4o-mini-transcribediff --git a/config/llm_models.json b/config/llm_models.jsonindex c307d568de2..e2ad63e9494 100644--- a/config/llm_models.json+++ b/config/llm_models.json@@ -28004,6 +28004,207 @@"owned_by": "system"}},+ {+ "id": "gpt-6-luna",+ "name": "GPT-6 Luna",+ "provider": "openai",+ "family": "gpt-luna",+ "created_at": "2026-09-22 00:00:00 UTC",+ "context_window": 1050000,+ "max_output_tokens": 128000,+ "knowledge_cutoff": "2026-05-18",+ "modalities": {+ "input": [+ "text",+ "image",+ "pdf"+ ],+ "output": [+ "text"+ ]+ },+ "capabilities": [+ "function_calling",+ "structured_output",+ "reasoning",+ "vision",+ "tool_choice",+ "parallel_tool_calls"+ ],+ "pricing": {+ "text_tokens": {+ "standard": {+ "input_per_million": 0.1,+ "output_per_million": 0.5,+ "cache_read_input_per_million": 0.01,+ "cache_write_input_per_million": 0.125+ },+ "long_context": {+ "input_per_million": 0.2,+ "output_per_million": 0.75,+ "cache_read_input_per_million": 0.02,+ "cache_write_input_per_million": 0.25+ },+ "long_context_threshold": 272000+ }+ },+ "metadata": {+ "object": "model",+ "owned_by": "system",+ "source": "models.dev",+ "provider_id": "openai",+ "open_weights": false,+ "attachment": true,+ "temperature": false,+ "last_updated": "2026-09-22",+ "tool_call": true,+ "structured_output": true,+ "reasoning": true,+ "reasoning_options": [+ {+ "type": "effort",+ "values": [+ "none",+ "low",+ "medium",+ "high",+ "xhigh",+ "max"+ ]+ }+ ],+ "cost": {+ "input": 0.1,+ "output": 0.5,+ "cache_read": 0.01,+ "cache_write": 0.125,+ "tiers": [+ {+ "input": 0.2,+ "output": 0.75,+ "cache_read": 0.02,+ "cache_write": 0.25,+ "tier": {+ "type": "context",+ "size": 272000+ }+ }+ ],+ "context_over_200k": {+ "input": 0.2,+ "output": 0.75,+ "cache_read": 0.02,+ "cache_write": 0.25+ }+ },+ "limit": {+ "context": 1050000,+ "input": 922000,+ "output": 128000+ },+ "knowledge": "2026-05-18"+ }+ },+ {+ "id": "gpt-6.1-sol",+ "name": "GPT-6.1 Sol",+ "provider": "openai",+ "family": "gpt-sol",+ "created_at": "2026-09-29 00:00:00 UTC",+ "context_window": 1050000,+ "max_output_tokens": 128000,+ "knowledge_cutoff": "2026-04-30",+ "modalities": {+ "input": [+ "text",+ "image",+ "pdf"+ ],+ "output": [+ "text"+ ]+ },+ "capabilities": [+ "function_calling",+ "structured_output",+ "reasoning",+ "vision",+ "tool_choice",+ "parallel_tool_calls"+ ],+ "pricing": {+ "text_tokens": {+ "standard": {+ "input_per_million": 2,+ "output_per_million": 10,+ "cache_read_input_per_million": 0.1,+ "cache_write_input_per_million": 2.5+ },+ "long_context": {+ "input_per_million": 4,+ "output_per_million": 15,+ "cache_read_input_per_million": 0.2,+ "cache_write_input_per_million": 5+ },+ "long_context_threshold": 272000+ }+ },+ "metadata": {+ "object": "model",+ "owned_by": "system",+ "source": "models.dev",+ "provider_id": "openai",+ "open_weights": false,+ "attachment": true,+ "temperature": false,+ "last_updated": "2026-09-29",+ "tool_call": true,+ "structured_output": true,+ "reasoning": true,+ "reasoning_options": [+ {+ "type": "effort",+ "values": [+ "low",+ "medium",+ "high",+ "xhigh",+ "max"+ ]+ }+ ],+ "cost": {+ "input": 2,+ "output": 10,+ "cache_read": 0.1,+ "cache_write": 2.5,+ "tiers": [+ {+ "input": 4,+ "output": 15,+ "cache_read": 0.2,+ "cache_write": 5,+ "tier": {+ "type": "context",+ "size": 272000+ }+ }+ ],+ "context_over_200k": {+ "input": 4,+ "output": 15,+ "cache_read": 0.2,+ "cache_write": 5+ }+ },+ "limit": {+ "context": 1050000,+ "input": 922000,+ "output": 128000+ },+ "knowledge": "2026-04-30"+ }+ },{"id": "gpt-audio","name": "gpt-audio",diff --git a/config/locales/en.yml b/config/locales/en.ymlindex 0fa39e91016..f871c2036ee 100644--- a/config/locales/en.yml+++ b/config/locales/en.yml@@ -782,6 +782,8 @@ en:help_center_article_generation: 'Help center article generation'onboarding_content_generation: 'Onboarding content generation'help_center_query_translation: 'Help center query translation'+ message_translation: 'Message translation'+ language_detection: 'Language detection'audio_transcription: 'Audio transcription'help_center_search: 'Help center search'collection:diff --git a/enterprise/app/models/enterprise/account.rb b/enterprise/app/models/enterprise/account.rbindex 62be2ab9938..7dbe1ba1435 100644--- a/enterprise/app/models/enterprise/account.rb+++ b/enterprise/app/models/enterprise/account.rb@@ -64,6 +64,10 @@ module Enterprise::Accountinterval_hours.hoursend+ def auto_translate_enabled?+ feature_enabled?('auto_translate') && feature_enabled?('captain_tasks') && auto_translate == true+ end+def saml_enabled?saml_settings&.saml_enabled? || falseenddiff --git a/spec/enterprise/models/account_spec.rb b/spec/enterprise/models/account_spec.rbindex 45e93945eac..9f27d328b99 100644--- a/spec/enterprise/models/account_spec.rb+++ b/spec/enterprise/models/account_spec.rb@@ -58,6 +58,25 @@ RSpec.describe Account, type: :model doendend+ describe '#auto_translate_enabled?' do+ it 'needs both the auto translate flag and Captain tasks' do+ account = create(:account, settings: { auto_translate: true })+ account.enable_features('auto_translate')+ account.disable_features('captain_tasks')++ expect(account).not_to be_auto_translate_enabled+ account.enable_features('captain_tasks')+ expect(account).to be_auto_translate_enabled+ end++ it 'stays off until the account switches it on' do+ account = create(:account)+ account.enable_features('auto_translate', 'captain_tasks')++ expect(account).not_to be_auto_translate_enabled+ end+ end+describe '#api_and_webhooks_enabled?' dolet(:account) { create(:account) }diff --git a/spec/models/account_spec.rb b/spec/models/account_spec.rbindex fa24c4d31bb..dc9a3472cae 100644--- a/spec/models/account_spec.rb+++ b/spec/models/account_spec.rb@@ -184,7 +184,8 @@ RSpec.describe Account dofeature_campaign_analytics: 1 << 9,feature_company_enrichment: 1 << 10,feature_stripe_integration: 1 << 11,- feature_mobile_voice_push: 1 << 12+ feature_mobile_voice_push: 1 << 12,+ feature_auto_translate: 1 << 13)expect(described_class.flag_mapping['feature_flags_ext_1'][:feature_whatsapp_manual_transfer]).to eq(1)expect(described_class.flag_mapping['feature_flags_ext_1'][:feature_data_import]).to eq(2)