feat: AfterInstall creates custom i18n directories for all locales
Ensures custom/Espo/Custom/Resources/i18n/{locale}/ exists for
en_US, fa_IR, he_IL, and the system language. Without this, Label
Manager fails with 500 on fresh installs using fa_IR (Hebrew RTL
wrapper) because the directory doesn't exist and EspoCRM doesn't
create it automatically.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Binary file not shown.
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "LegalAssistance",
|
||||
"version": "1.2.3",
|
||||
"version": "1.3.0",
|
||||
"acceptableVersions": [">=8.0.0"],
|
||||
"php": [">=8.1"],
|
||||
"releaseDate": "2026-04-06",
|
||||
|
||||
@@ -24,6 +24,10 @@ class AfterInstall
|
||||
|
||||
$log->info('LegalAssistance: Running AfterInstall...');
|
||||
|
||||
// 0. Ensure custom i18n directories exist for all supported locales
|
||||
$config = $container->getByClass(Config::class);
|
||||
$this->ensureI18nDirectories($config, $log);
|
||||
|
||||
// 1. Deploy ai-gateway plugin files
|
||||
$this->deployPluginFiles($log);
|
||||
|
||||
@@ -42,6 +46,27 @@ class AfterInstall
|
||||
$log->info('LegalAssistance: AfterInstall completed.');
|
||||
}
|
||||
|
||||
private function ensureI18nDirectories(Config $config, Log $log): void
|
||||
{
|
||||
$basePath = 'custom/Espo/Custom/Resources/i18n';
|
||||
|
||||
$language = $config->get('language', 'en_US');
|
||||
|
||||
$locales = array_unique(['en_US', 'fa_IR', 'he_IL', $language]);
|
||||
|
||||
foreach ($locales as $locale) {
|
||||
$dir = $basePath . '/' . $locale;
|
||||
|
||||
if (!is_dir($dir)) {
|
||||
if (mkdir($dir, 0775, true)) {
|
||||
$log->info("LegalAssistance: Created i18n directory: {$dir}");
|
||||
} else {
|
||||
$log->warning("LegalAssistance: Failed to create i18n directory: {$dir}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function deployPluginFiles(Log $log): void
|
||||
{
|
||||
// Source: extension's plugins/ directory (relative to EspoCRM root after install)
|
||||
|
||||
Reference in New Issue
Block a user