{"record":{"id":"b340bdef1378d32b","repo":"abpframework/abp","slug":"translatejsonpath-file-does-not-exist","errorCode":null,"errorMessage":"{translateJsonPath} file does not exist..","messagePattern":"(.+?) file does not exist\\.\\.","errorType":"exception","errorClass":"CliUsageException","httpStatus":null,"severity":"error","filePath":"framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/TranslateCommand.cs","lineNumber":301,"sourceCode":"            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(\n                $\"{translateJsonPath} file does not exist..\" +\n                Environment.NewLine + Environment.NewLine +\n                GetUsageInfo()\n            );\n        }\n\n        var translateInfo = GetAbpTranslateInfo(translateJsonPath);\n        foreach (var resource in translateInfo.Resources)\n        {\n            var targetFile = Path.Combine(resource.ResourcePath, translateInfo.TargetCulture + \".json\");\n            var targetLocalizationInfo = File.Exists(targetFile)\n                ? GetAbpLocalizationInfoOrNull(targetFile)\n                : new AbpLocalizationInfo()\n                {\n                    Culture = translateInfo.TargetCulture,\n                    Texts = new List<NameValue>()\n                };\n","sourceCodeStart":283,"sourceCodeEnd":319,"githubUrl":"https://github.com/abpframework/abp/blob/7ed43b1931b9df46a50c0c59148a18645641d0df/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/TranslateCommand.cs#L283-L319","documentation":"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..').","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before (no translation file exists yet)\nabp translate --apply\n\n// after (generate first, then apply)\nabp translate -c zh-Hans\nabp translate --apply","handlingStrategy":"validation","validationCode":"// Pre-check that translation file exists before applying\nvar translateFile = Path.Combine(currentDirectory, \n    commandLineArgs.Options.GetOrNull(\"f\", \"file\") ?? \"abp-translation.json\");\nif (!File.Exists(translateFile))\n{\n    Console.Error.WriteLine($\"Error: Translation file not found: {translateFile}\");\n    Console.Error.WriteLine(\"Generate it first with: abp translate -c <culture>\");\n    return;\n}","typeGuard":null,"tryCatchPattern":"try\n{\n    await ApplyAbpTranslateInfoAsync(directory, filename);\n}\ncatch (CliUsageException ex) when (ex.Message.Contains(\"file does not exist\"))\n{\n    Console.Error.WriteLine($\"Translation file missing. Run 'abp translate -c <culture>' first to generate it.\");\n}","preventionTips":["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"],"tags":["translate","localization","file-not-found","apply","workflow"],"backgroundTag":null,"analyzedSha":"7ed43b1931b9df46a50c0c59148a18645641d0df","analyzedAt":"2026-08-13T16:26:11.351Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}