mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-06 21:35:49 +01:00
force translations to be on while processing admin translations #299
This commit is contained in:
@@ -399,6 +399,10 @@ class AdminPlugin extends Plugin
|
|||||||
$assets = $this->grav['assets'];
|
$assets = $this->grav['assets'];
|
||||||
$translations = 'if (!window.translations) window.translations = {}; ' . PHP_EOL . 'window.translations.PLUGIN_ADMIN = {};' . PHP_EOL;
|
$translations = 'if (!window.translations) window.translations = {}; ' . PHP_EOL . 'window.translations.PLUGIN_ADMIN = {};' . PHP_EOL;
|
||||||
|
|
||||||
|
// Enable language translations
|
||||||
|
$translations_actual_state = $this->config->get('system.languages.translations');
|
||||||
|
$this->config->set('system.languages.translations', true);
|
||||||
|
|
||||||
$strings = ['EVERYTHING_UP_TO_DATE',
|
$strings = ['EVERYTHING_UP_TO_DATE',
|
||||||
'UPDATES_ARE_AVAILABLE',
|
'UPDATES_ARE_AVAILABLE',
|
||||||
'IS_AVAILABLE_FOR_UPDATE',
|
'IS_AVAILABLE_FOR_UPDATE',
|
||||||
@@ -422,6 +426,9 @@ class AdminPlugin extends Plugin
|
|||||||
$translations .= 'translations.PLUGIN_ADMIN.' . $string .' = "' . $this->admin->translate('PLUGIN_ADMIN.' . $string) . '"; ' . PHP_EOL;;
|
$translations .= 'translations.PLUGIN_ADMIN.' . $string .' = "' . $this->admin->translate('PLUGIN_ADMIN.' . $string) . '"; ' . PHP_EOL;;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set the actual translations state back
|
||||||
|
$this->config->set('system.languages.translations', $translations_actual_state);
|
||||||
|
|
||||||
$assets->addInlineJs($translations);
|
$assets->addInlineJs($translations);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user