{"record":{"id":"b3bedd9ef3d892b2","repo":"yiisoft/yii2","slug":"languages-cannot-be-empty","errorCode":null,"errorMessage":"Languages cannot be empty.","messagePattern":"Languages cannot be empty\\.","errorType":"console","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"framework/console/controllers/MessageController.php","lineNumber":1002,"sourceCode":"        if (!isset($this->config['sourcePath'], $this->config['languages'])) {\n            throw new Exception('The configuration file must specify \"sourcePath\" and \"languages\".');\n        }\n        if (!is_dir($this->config['sourcePath'])) {\n            throw new Exception(\"The source path {$this->config['sourcePath']} is not a valid directory.\");\n        }\n        if (empty($this->config['format']) || !in_array($this->config['format'], ['php', 'po', 'pot', 'db'])) {\n            throw new Exception('Format should be either \"php\", \"po\", \"pot\" or \"db\".');\n        }\n        if (in_array($this->config['format'], ['php', 'po', 'pot'])) {\n            if (!isset($this->config['messagePath'])) {\n                throw new Exception('The configuration file must specify \"messagePath\".');\n            }\n            if (!is_dir($this->config['messagePath'])) {\n                throw new Exception(\"The message path {$this->config['messagePath']} is not a valid directory.\");\n            }\n        }\n        if (empty($this->config['languages'])) {\n            throw new Exception('Languages cannot be empty.');\n        }\n\n        if ($this->config['format'] === 'php' && $this->config['phpDocBlock'] === null) {\n            $this->config['phpDocBlock'] = <<<DOCBLOCK\n/**\n * Message translations.\n *\n * This file is automatically generated by 'yii {$this->id}/{$this->action->id}' command.\n * It contains the localizable messages extracted from source code.\n * You may modify this file by translating the extracted messages.\n *\n * Each array element represents the translation (value) of a message (key).\n * If the value is empty, the message is considered as not translated.\n * Messages that no longer need translation will have their translations\n * enclosed between a pair of '@@' marks.\n *\n * Message string can be used with plural forms format. Check i18n section\n * of the guide for details.","sourceCodeStart":984,"sourceCodeEnd":1020,"githubUrl":"https://github.com/yiisoft/yii2/blob/66f00d18a29b520f85e8e8f1e32d1e7e7b556cac/framework/console/controllers/MessageController.php#L984-L1020","documentation":"Error \"Languages cannot be empty.\" thrown in yiisoft/yii2.","triggerScenarios":"Thrown at framework/console/controllers/MessageController.php:1002 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"66f00d18a29b520f85e8e8f1e32d1e7e7b556cac","analyzedAt":"2026-08-17T05:17:23.470Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}