abpframework/abp · error · CliUsageException
{translateJsonPath} file does not exist..
Error message
{translateJsonPath} file does not exist.. What it means
Thrown by ApplyAbpTranslateInfoAsync when the translation JSON file (default: abp-translation.json, or a custom file specified with -f/--file) does not exist on disk. The --apply mode reads this file and applies translations to the target culture files. The file must first be generated using 'abp translate -c <culture>' (without --apply). Note: double-period typo in message ('exist..').
Source
Thrown at framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/TranslateCommand.cs:301
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(
$"{translateJsonPath} file does not exist.." +
Environment.NewLine + Environment.NewLine +
GetUsageInfo()
);
}
var translateInfo = GetAbpTranslateInfo(translateJsonPath);
foreach (var resource in translateInfo.Resources)
{
var targetFile = Path.Combine(resource.ResourcePath, translateInfo.TargetCulture + ".json");
var targetLocalizationInfo = File.Exists(targetFile)
? GetAbpLocalizationInfoOrNull(targetFile)
: new AbpLocalizationInfo()
{
Culture = translateInfo.TargetCulture,
Texts = new List<NameValue>()
};
View on GitHub (pinned to 7ed43b1931)
Solutions
- First generate the translation file: 'abp translate -c <culture>' (without --apply)
- Then apply it: 'abp translate --apply'
- If using a custom file name, pass it: 'abp translate --apply -f my-translation.json'
- Ensure you're in the same working directory where the file was generated
Example fix
// before (no translation file exists yet) abp translate --apply // after (generate first, then apply) abp translate -c zh-Hans abp translate --apply
Defensive patterns
Strategy: validation
Validate before calling
// Pre-check that translation file exists before applying
var translateFile = Path.Combine(currentDirectory,
commandLineArgs.Options.GetOrNull("f", "file") ?? "abp-translation.json");
if (!File.Exists(translateFile))
{
Console.Error.WriteLine($"Error: Translation file not found: {translateFile}");
Console.Error.WriteLine("Generate it first with: abp translate -c <culture>");
return;
} Try / catch
try
{
await ApplyAbpTranslateInfoAsync(directory, filename);
}
catch (CliUsageException ex) when (ex.Message.Contains("file does not exist"))
{
Console.Error.WriteLine($"Translation file missing. Run 'abp translate -c <culture>' first to generate it.");
} Prevention
- Always generate the translation file before applying: 'abp translate -c <culture>' then 'abp translate --apply'
- Run --apply from the same directory where the file was generated
- If using -f for a custom file name, use the same name for both generate and apply
When it happens
Trigger: Running 'abp translate --apply' when abp-translation.json doesn't exist in the current directory. Or running 'abp translate --apply -f custom.json' when custom.json doesn't exist.
Common situations: Running --apply before generating the translation file, file was deleted, wrong working directory, custom file name specified incorrectly, translation was generated in a different directory.
Related errors
- {referenceFile} file does not exist..
- File {path} does not exist!
- Target culture is missing!
- Failed to get localization information from {targetFile} fil
- Failed to get localization information from {referenceFile}
AI-assisted analysis of abpframework/abp@7ed43b1931 (2026-08-13).
Data as JSON: /api/errors/b340bdef1378d32b.
Report an issue: GitHub.