{"record":{"id":"86215e0ca73dcb90","repo":"RocketChat/Rocket.Chat","slug":"error-autotranslate-disabled","errorCode":"error-autotranslate-disabled","errorMessage":"Auto-Translate is disabled","messagePattern":"Auto-Translate is disabled","errorType":"exception","errorClass":"Meteor.Error","httpStatus":null,"severity":"warning","filePath":"apps/meteor/server/lib/autotranslate/functions/getSupportedLanguages.ts","lineNumber":9,"sourceCode":"import { Meteor } from 'meteor/meteor';\n\nimport { settings } from '../../../settings';\nimport { hasPermissionAsync } from '../../authorization/hasPermission';\nimport { TranslationProviderRegistry } from '../index';\n\nexport const getSupportedLanguages = async (userId: string, targetLanguage: string) => {\n\tif (!settings.get('AutoTranslate_Enabled')) {\n\t\tthrow new Meteor.Error('error-autotranslate-disabled', 'Auto-Translate is disabled');\n\t}\n\n\tif (!(await hasPermissionAsync(userId, 'auto-translate'))) {\n\t\tthrow new Meteor.Error('error-action-not-allowed', 'Auto-Translate is not allowed', {\n\t\t\tmethod: 'autoTranslate.getSupportedLanguages',\n\t\t});\n\t}\n\n\treturn TranslationProviderRegistry.getSupportedLanguages(targetLanguage);\n};\n","sourceCodeStart":1,"sourceCodeEnd":20,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/lib/autotranslate/functions/getSupportedLanguages.ts#L1-L20","documentation":"Returned by the auto-translate API when the workspace setting AutoTranslate_Enabled is false. getSupportedLanguages backs DDP method 'autoTranslate.getSupportedLanguages' (rate-limited to 5 calls per 60s) and 'GET /api/v1/autotranslate.getSupportedLanguages'; the REST wrapper pre-checks the setting and returns a plain failure payload instead of throwing. Nothing in auto-translate works until the setting is on and a provider is configured.","triggerScenarios":"A client with a stale settings cache still invokes the translate UI after an admin disabled Auto-Translate; calling the endpoint on a fresh install before enabling Administration > Message > Auto-Translate; invoking the DDP method directly.","commonSituations":"Trial workspaces where the setting was never enabled; the feature toggled off during an incident while clients keep polling supported languages; forgetting that AutoTranslate_Enabled and the translation provider (DeepL/Google/Microsoft/LibreTranslate plus API key) are configured separately.","solutions":["Enable Auto-Translate: Administration > Message > Auto-Translate, or POST /api/v1/settings/AutoTranslate_Enabled with { value: true }","Configure a translation provider and its API key under the same section","Gate all translate UI/API calls on the AutoTranslate_Enabled public setting before invoking","If it was just enabled, reload settings/reconnect so the server and clients pick up the change"],"exampleFix":"// before\nconst langs = await call('autoTranslate.getSupportedLanguages', 'en');\n\n// after\nif (!settingsCache.get('AutoTranslate_Enabled')) {\n  throw new Error('Auto-Translate is disabled');\n}\nconst langs = await call('autoTranslate.getSupportedLanguages', 'en');","handlingStrategy":"validation","validationCode":"// client: public settings are pushed on login\nif (!settingsCollection.get('AutoTranslate_Enabled')) {\n  // hide translate UI; do not call autoTranslate.getSupportedLanguages\n}","typeGuard":null,"tryCatchPattern":"try {\n  const langs = await call('autoTranslate.getSupportedLanguages', 'en');\n} catch (e) {\n  if (e instanceof Meteor.Error && e.error === 'error-autotranslate-disabled') {\n    // disable translate UI for this session\n  } else {\n    throw e;\n  }\n}","preventionTips":["Gate all auto-translate UI and API calls on the AutoTranslate_Enabled public setting","When enabling the setting, also configure and health-check a provider","Remember the DDP method is rate-limited (5 calls / 60s) - do not poll it"],"tags":["rocket-chat","autotranslate","settings","feature-flag"],"backgroundTag":"feature-disabled-by-setting","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}