{"record":{"id":"8da075b0a81ca465","repo":"abpframework/abp","slug":"deepl-does-not-support-abpculture-culture","errorCode":null,"errorMessage":"DeepL does not support {abpCulture} culture.","messagePattern":"DeepL does not support (.+?) culture\\.","errorType":"exception","errorClass":"CliUsageException","httpStatus":null,"severity":"error","filePath":"framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/TranslateCommand.cs","lineNumber":283,"sourceCode":"            LanguageCode.Romanian ,\n            LanguageCode.Russian ,\n            LanguageCode.Slovak ,\n            LanguageCode.Slovenian ,\n            LanguageCode.Swedish ,\n            LanguageCode.Turkish ,\n            LanguageCode.Ukrainian,\n            LanguageCode.Chinese\n        };\n\n        if (abpCulture == \"zh-Hans\")\n        {\n            return Task.FromResult(LanguageCode.Chinese);\n        }\n\n        var deeplCulture = deeplLanguages.FirstOrDefault(x => x.Equals(abpCulture, StringComparison.OrdinalIgnoreCase));\n        if (deeplCulture == null)\n        {\n            throw new CliUsageException(\n                $\"DeepL does not support {abpCulture} culture.\" +\n                Environment.NewLine + Environment.NewLine +\n                GetUsageInfo()\n            );\n        }\n\n        return Task.FromResult(deeplCulture);\n    }\n\n    private Task ApplyAbpTranslateInfoAsync(string directory, string filename)\n    {\n        Logger.LogInformation(\"Abp translate apply...\");\n        Logger.LogInformation(\"Input file: \" + filename);\n\n        var translateJsonPath = Path.Combine(directory, filename);\n        if (!File.Exists(translateJsonPath))\n        {\n            throw new CliUsageException(","sourceCodeStart":265,"sourceCodeEnd":301,"githubUrl":"https://github.com/abpframework/abp/blob/7ed43b1931b9df46a50c0c59148a18645641d0df/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/TranslateCommand.cs#L265-L301","documentation":"Thrown by GetDeeplLanguageCode when the ABP culture name does not match any DeepL-supported language code (case-insensitive OrdinalIgnoreCase comparison). Special handling: 'zh-Hans' is explicitly mapped to LanguageCode.Chinese. DeepL supports approximately 30+ languages including Bulgarian, Czech, Danish, German, Greek, English, Spanish, Estonian, Finnish, French, Hungarian, Indonesian, Italian, Japanese, Korean, Lithuanian, Latvian, Norwegian, Dutch, Polish, Portuguese, Romanian, Russian, Slovak, Slovenian, Swedish, Turkish, Ukrainian, and Chinese.","triggerScenarios":"Using --culture <unsupported> with --online. For example: 'abp translate -c ar --online' where 'ar' (Arabic) is not in the deeplLanguages list. Any ABP culture that doesn't match a DeepL language code after the zh-Hans special case triggers this.","commonSituations":"Targeting a language DeepL doesn't support (Arabic, Hindi, Thai, Vietnamese, Hebrew, Persian, etc.), using a culture variant not in DeepL's list (e.g., 'en-US' vs 'en' — though English variants exist), regional culture codes that don't map directly.","solutions":["Check DeepL's supported languages at https://www.deepl.com/docs-api/translating-text/","Use a supported culture code (e.g., 'de' instead of 'de-AT' if the variant isn't supported)","For Chinese, use 'zh-Hans' which is specially handled","For unsupported languages, omit --online and generate the translation file for manual translation instead"],"exampleFix":"// before (Arabic not supported by DeepL)\nabp translate -c ar --online --deepl-auth-key KEY\n\n// after (use a supported language)\nabp translate -c de --online --deepl-auth-key KEY","handlingStrategy":"validation","validationCode":"// Pre-validate culture against DeepL supported languages\nvar deeplSupported = new HashSet<string>(StringComparer.OrdinalIgnoreCase)\n{\n    \"bg\",\"cs\",\"da\",\"de\",\"el\",\"en\",\"en-gb\",\"en-us\",\"es\",\"et\",\"fi\",\"fr\",\"hu\",\"id\",\n    \"it\",\"ja\",\"ko\",\"lt\",\"lv\",\"nb\",\"nl\",\"pl\",\"pt\",\"pt-br\",\"pt-pt\",\"ro\",\"ru\",\n    \"sk\",\"sl\",\"sv\",\"tr\",\"uk\",\"zh\"\n};\nif (abpCulture != \"zh-Hans\" && !deeplSupported.Contains(abpCulture))\n{\n    Console.Error.WriteLine($\"Error: DeepL does not support culture '{abpCulture}'. Use offline mode instead.\");\n    return;\n}","typeGuard":"// Check if a culture is supported by DeepL\npublic static bool IsDeepLSupportedCulture(string abpCulture)\n{\n    if (abpCulture == \"zh-Hans\") return true;\n    var supported = new[] { \"bg\",\"cs\",\"da\",\"de\",\"el\",\"en\",\"es\",\"et\",\"fi\",\"fr\",\n        \"hu\",\"id\",\"it\",\"ja\",\"ko\",\"lt\",\"lv\",\"nb\",\"nl\",\"pl\",\"pt\",\"pt-br\",\n        \"pt-pt\",\"ro\",\"ru\",\"sk\",\"sl\",\"sv\",\"tr\",\"uk\",\"zh\" };\n    return supported.Contains(abpCulture, StringComparer.OrdinalIgnoreCase);\n}","tryCatchPattern":"try\n{\n    await TranslateAbpTranslateInfoAsync(directory, targetCulture, referenceCulture, allValues, authKey);\n}\ncatch (CliUsageException ex) when (ex.Message.Contains(\"DeepL does not support\"))\n{\n    Console.Error.WriteLine($\"Culture not supported by DeepL. Use offline mode: abp translate -c {targetCulture}\");\n}","preventionTips":["Check DeepL's supported languages list before attempting online translation","For unsupported languages (Arabic, Hindi, Thai, etc.), use offline mode without --online","For Chinese, always use 'zh-Hans' which is specially mapped","Use base culture names (e.g., 'de' not 'de-DE') for best DeepL compatibility"],"tags":["translate","deepl","localization","unsupported-culture","online"],"backgroundTag":null,"analyzedSha":"7ed43b1931b9df46a50c0c59148a18645641d0df","analyzedAt":"2026-08-13T16:26:11.351Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}