abpframework/abp · error · CliUsageException
DeepL does not support {abpCulture} culture.
Error message
DeepL does not support {abpCulture} culture. What it means
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.
Source
Thrown at framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/TranslateCommand.cs:283
LanguageCode.Romanian ,
LanguageCode.Russian ,
LanguageCode.Slovak ,
LanguageCode.Slovenian ,
LanguageCode.Swedish ,
LanguageCode.Turkish ,
LanguageCode.Ukrainian,
LanguageCode.Chinese
};
if (abpCulture == "zh-Hans")
{
return Task.FromResult(LanguageCode.Chinese);
}
var deeplCulture = deeplLanguages.FirstOrDefault(x => x.Equals(abpCulture, StringComparison.OrdinalIgnoreCase));
if (deeplCulture == null)
{
throw new CliUsageException(
$"DeepL does not support {abpCulture} culture." +
Environment.NewLine + Environment.NewLine +
GetUsageInfo()
);
}
return Task.FromResult(deeplCulture);
}
private Task ApplyAbpTranslateInfoAsync(string directory, string filename)
{
Logger.LogInformation("Abp translate apply...");
Logger.LogInformation("Input file: " + filename);
var translateJsonPath = Path.Combine(directory, filename);
if (!File.Exists(translateJsonPath))
{
throw new CliUsageException(View on GitHub (pinned to 7ed43b1931)
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
Example fix
// before (Arabic not supported by DeepL) abp translate -c ar --online --deepl-auth-key KEY // after (use a supported language) abp translate -c de --online --deepl-auth-key KEY
Defensive patterns
Strategy: validation
Validate before calling
// Pre-validate culture against DeepL supported languages
var deeplSupported = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
{
"bg","cs","da","de","el","en","en-gb","en-us","es","et","fi","fr","hu","id",
"it","ja","ko","lt","lv","nb","nl","pl","pt","pt-br","pt-pt","ro","ru",
"sk","sl","sv","tr","uk","zh"
};
if (abpCulture != "zh-Hans" && !deeplSupported.Contains(abpCulture))
{
Console.Error.WriteLine($"Error: DeepL does not support culture '{abpCulture}'. Use offline mode instead.");
return;
} Type guard
// Check if a culture is supported by DeepL
public static bool IsDeepLSupportedCulture(string abpCulture)
{
if (abpCulture == "zh-Hans") return true;
var supported = new[] { "bg","cs","da","de","el","en","es","et","fi","fr",
"hu","id","it","ja","ko","lt","lv","nb","nl","pl","pt","pt-br",
"pt-pt","ro","ru","sk","sl","sv","tr","uk","zh" };
return supported.Contains(abpCulture, StringComparer.OrdinalIgnoreCase);
} Try / catch
try
{
await TranslateAbpTranslateInfoAsync(directory, targetCulture, referenceCulture, allValues, authKey);
}
catch (CliUsageException ex) when (ex.Message.Contains("DeepL does not support"))
{
Console.Error.WriteLine($"Culture not supported by DeepL. Use offline mode: abp translate -c {targetCulture}");
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Failed to get localization information from {targetFile} fil
- {referenceFile} file does not exist..
- Failed to get localization information from {referenceFile}
- Target culture is missing!
- DeepL auth key is missing!
AI-assisted analysis of abpframework/abp@7ed43b1931 (2026-08-13).
Data as JSON: /api/errors/8da075b0a81ca465.
Report an issue: GitHub.