19declare(strict_types=1);
55 return $this->data->text()->markdown()->simpleDocument(
57Refreshes one or
more already installed languages, re-seeding their
base
58data (plus a customizing/local file
if one exists)
from the current
60A
language that is not installed is left completely untouched - use
68 return 'Update languages';
73 $text = $this->data->text()->markdown();
76 $text->simpleDocument(
'Result of the language update.'),
78 'updated_language_keys' =>
$f->list(
79 $text->simpleDocument(
80 'Already installed languages that were refreshed from the current ' .
81 'language files (base data, plus a customizing/local file if one exists).'
83 $f->string(
$text->simpleDocument(
'Language key of a refreshed language.'))
85 'not_installed_language_keys' =>
$f->list(
86 $text->simpleDocument(
87 'Requested languages that are not installed - skipped entirely, since ' .
88 'there is nothing installed yet to refresh. Use InstallLanguage to ' .
91 $f->string(
$text->simpleDocument(
'Language key of a not-yet-installed language.'))
93 'overlay_write_failed_language_keys' => $this->overlayWriteFailedOutputField(
$f),
94 'invalid_markup_customizing_entries' => $this->invalidMarkupCustomizingOutputField(
$f),
95 'duplicate_customizing_entries' => $this->duplicateCustomizingOutputField(
$f),
108 $currently_installed_language_keys = $this->setup_language->getInstalledLanguages();
111 $not_installed_no_op = [];
113 foreach ($language_keys as $language_key) {
114 if (in_array($language_key, $currently_installed_language_keys,
true)) {
115 $to_update[] = $language_key;
117 $not_installed_no_op[] = $language_key;
121 $error_language_keys = [];
122 foreach ($to_update as $language_key) {
123 if (!$this->setup_language->checkLanguageForInstallation($language_key)) {
124 $error_language_keys[] = $language_key;
128 if ($error_language_keys !== []) {
132 $overlay_write_failed_language_keys = [];
133 if ($to_update !== []) {
134 $db_languages = $this->setup_language->getAvailableLanguagesForInstallation();
135 $local_language_keys = $this->setup_language->getLocalLanguages();
137 foreach ($to_update as $language_key) {
138 $this->setup_language->flushLanguageForInstallation($language_key);
139 if ($this->setup_language->insertLanguageForInstallation($language_key) !== []) {
140 $overlay_write_failed_language_keys[] = $language_key;
142 $this->setup_language->registerInstalledLanguage($language_key, $db_languages, $local_language_keys);
146 $this->
repository?->refreshPlugins($to_update);
150 'updated_language_keys' => $to_update,
151 'not_installed_language_keys' => $not_installed_no_op,
152 'overlay_write_failed_language_keys' => $overlay_write_failed_language_keys,
154 $this->setup_language->getSkippedInvalidMarkupEntries(),
158 $this->setup_language->getSkippedDuplicateEntries(),
This describes some datastructure in terms of standard data structures such as primitives,...
A state of the server, not of the call: 409, so Failure::of() passes it on and the GUI can name the l...
duplicateCustomizingEntries(array $skipped, array $language_keys)
invalidMarkupCustomizingEntries(array $skipped, array $language_keys)
Every legacy and repository access of the runtime language activities.
__construct(?RBAC $rbac, private readonly \ilSetupLanguage $setup_language, LanguageFolder $language_folder, private readonly ?RepositoryProvider $repository=null,)
static forSetup(\ilSetupLanguage $setup_language)
getOutputDescription(Description\Factory $f)
perform(mixed $parameters)
This shall perform the activity.
Looks the ref_id up on every call, so it can be built at build time without database access.
language handling for setup
Public RBAC service of the AccessControl component.
The language folder in the administration, whose "write" permission guards the language Activities.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
toLanguageKeyList(mixed $value)
trait DeclaresLanguageKeysOnlyInput
to(\GdImage $image, ?int $quality=null)
Currently this is the only way to make a FileStream from a GD image resource.