{"record":{"id":"e135df812fbd2594","repo":"abpframework/abp","slug":"referencefile-file-does-not-exist","errorCode":null,"errorMessage":"{referenceFile} 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":184,"sourceCode":"                : new AbpLocalizationInfo()\n                {\n                    Culture = translateInfo.TargetCulture,\n                    Texts = new List<NameValue>()\n                };\n\n            if (targetLocalizationInfo == null)\n            {\n                throw new CliUsageException(\n                    $\"Failed to get localization information from {targetFile} file.\" +\n                    Environment.NewLine + Environment.NewLine +\n                    GetUsageInfo()\n                );\n            }\n\n            var referenceFile = Path.Combine(resource.ResourcePath, translateInfo.ReferenceCulture + \".json\");\n            if (!File.Exists(referenceFile))\n            {\n                throw new CliUsageException(\n                    $\"{referenceFile} file does not exist..\" +\n                    Environment.NewLine + Environment.NewLine +\n                    GetUsageInfo()\n                );\n            }\n            var referenceLocalizationInfo = GetAbpLocalizationInfoOrNull(referenceFile);\n            if (referenceLocalizationInfo == null)\n            {\n                throw new CliUsageException(\n                    $\"Failed to get localization information from {referenceFile} file.\" +\n                    Environment.NewLine + Environment.NewLine +\n                    GetUsageInfo()\n                );\n            }\n\n            var translator = new Translator(authKey);\n\n            var texts = resource.Texts.Select(x => x.Reference);","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/abpframework/abp/blob/7ed43b1931b9df46a50c0c59148a18645641d0df/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/TranslateCommand.cs#L166-L202","documentation":"Thrown during online translation (TranslateAbpTranslateInfoAsync) when the reference culture JSON file does not exist on disk. The reference file path is constructed as Path.Combine(resource.ResourcePath, translateInfo.ReferenceCulture + '.json'). The reference culture defaults to 'en' unless overridden with -r/--reference-culture. Note: the error message has a double-period typo ('exist..').","triggerScenarios":"Running 'abp translate -c <culture> --online --deepl-auth-key <key>' when the reference culture JSON file (default: en.json) is missing from one or more resource directories discovered during the scan.","commonSituations":"Reference culture files not committed to the repo, renamed or moved, reference culture misspelled with -r (e.g., '-r english' instead of '-r en'), project structure doesn't include the default 'en' localization files.","solutions":["Verify the reference culture file (e.g., en.json) exists in the localization directory","Specify the correct reference culture with -r/--reference-culture (use .NET culture names like 'en', 'de', 'tr')","Ensure all reference culture JSON files are committed to version control","Run 'abp translate --verify' to check all localization files for issues"],"exampleFix":"// before\nabp translate -c zh-Hans -r english --online --deepl-auth-key KEY\n\n// after (use valid .NET culture name)\nabp translate -c zh-Hans -r en --online --deepl-auth-key KEY","handlingStrategy":"validation","validationCode":"// Pre-check that reference culture file exists\nvar referenceFile = Path.Combine(resourcePath, referenceCulture + \".json\");\nif (!File.Exists(referenceFile))\n{\n    Console.Error.WriteLine($\"Error: Reference file not found: {referenceFile}\");\n    return;\n}","typeGuard":null,"tryCatchPattern":"try\n{\n    await TranslateAbpTranslateInfoAsync(directory, targetCulture, referenceCulture, allValues, authKey);\n}\ncatch (CliUsageException ex) when (ex.Message.Contains(\"file does not exist\"))\n{\n    Console.Error.WriteLine($\"Reference culture file missing. Ensure {referenceCulture}.json exists in all localization directories.\");\n}","preventionTips":["Ensure reference culture files (default: en.json) exist in every localization directory","Use valid .NET culture names for -r/--reference-culture","Commit all localization files to version control","Run 'abp translate --verify' to detect missing files"],"tags":["translate","localization","file-not-found","reference-culture","online"],"backgroundTag":null,"analyzedSha":"7ed43b1931b9df46a50c0c59148a18645641d0df","analyzedAt":"2026-08-13T16:26:11.351Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}