{"record":{"id":"e6ee41d4d4cbcc5d","repo":"symfony/translation","slug":"you-must-define-framework-enabled-locales-or-framework","errorCode":null,"errorMessage":"You must define \"framework.enabled_locales\" or \"framework.translator.providers.%s.locales\" config key in order to work with translation providers.","messagePattern":"You must define \"framework\\.enabled_locales\" or \"framework\\.translator\\.providers\\.(.+?)\\.locales\" config key in order to work with translation providers\\.","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"Command/TranslationPushCommand.php","lineNumber":114,"sourceCode":"                Full example:\n\n                  <info>php %command.full_name% provider --force --delete-missing --domains=messages --domains=validators --locales=en</>\n\n                This command pushes all translations associated with the <info>messages</> and <info>validators</> domains for the <info>en</> locale.\n                Provider translations for the specified domains and locale are deleted if they're not present locally and overwritten if it's the case.\n                Provider translations for others domains and locales are ignored.\n\n                EOF\n            )\n        ;\n    }\n\n    protected function execute(InputInterface $input, OutputInterface $output): int\n    {\n        $provider = $this->providers->get($input->getArgument('provider'));\n\n        if (!$this->enabledLocales) {\n            throw new InvalidArgumentException(\\sprintf('You must define \"framework.enabled_locales\" or \"framework.translator.providers.%s.locales\" config key in order to work with translation providers.', parse_url($provider, \\PHP_URL_SCHEME)));\n        }\n\n        $io = new SymfonyStyle($input, $output);\n        $domains = $input->getOption('domains');\n        $locales = $input->getOption('locales');\n        $force = $input->getOption('force');\n        $deleteMissing = $input->getOption('delete-missing');\n\n        if (!$domains && $provider instanceof FilteringProvider) {\n            $domains = $provider->getDomains();\n        }\n\n        // Reading local translations must be done after retrieving the domains from the provider\n        // in order to manage only translations from configured domains\n        $localTranslations = $this->readLocalTranslations($locales, $domains, $this->transPaths);\n\n        if (!$domains) {\n            $domains = $this->getDomainsFromTranslatorBag($localTranslations);","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/symfony/translation/blob/ae9e8a51bc29780d63c7f9efd6005d7c875e100b/Command/TranslationPushCommand.php#L96-L132","documentation":"Configuration guard in TranslationPushCommand::execute(): to push translations to a provider named %s the application must know which locales to push, but neither framework.enabled_locales nor framework.translator.providers.<name>.locales is defined in the configuration. The command cannot determine the locale set to synchronize, so it aborts.","triggerScenarios":"Thrown at Command/TranslationPushCommand.php:114 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add `framework: enabled_locales: [en, fr]` (or the Symfony 4-era `translator.enabled_locales`) to config/packages/framework.yaml.","Configure per-provider locales under `framework.translator.providers.<provider>.locales` in the translator provider config.","Re-run with `--locales=en` on the command line, which overrides the missing config for this run."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ae9e8a51bc29780d63c7f9efd6005d7c875e100b","analyzedAt":"2026-09-15T22:29:15.305Z","contentChangedAt":"2026-09-15T22:29:15.305Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}