Skip to content

Language: Maintain the language modules of wave 1 in PO files - #12262

Merged
c-knof merged 162 commits into
ILIAS-eLearning:trunkfrom
kroepelin-projekte:feature/trunk/ck/po-migration-wave-a
Oct 28, 2026
Merged

c-knof merged 162 commits into
ILIAS-eLearning:trunkfrom
kroepelin-projekte:feature/trunk/ck/po-migration-wave-a

Conversation

@c-knof

@c-knof c-knof commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Part 1 of 4 of the migration of all language modules to PO files.
Depends on #12261

One commit per component. Each commit moves the component's modules from lang/ilias_<lang>.lang into
components/<Vendor>/<Component>/lang/<module>.pot|_<lang>.po, contributes the directory in <Component>.php
($contribute[LanguageFileDirectory::class]) and removes the lines from the global language files. The texts are unchanged, except where the agreed rules for language variables required it (English as reference, identifiers without English text removed, lower case identifiers, one module per identifier); those cases are named in the commit messages.

Maintainers: please check the commit of your component. Translations keep working through Setup as before; translators edit the .po files of the component from now on.

@c-knof c-knof changed the title Feature/trunk/ck/po migration wave a Language: Maintain the language modules of wave 1 in PO files Oct 23, 2026
@c-knof c-knof added improvement php Pull requests that update Php code labels Oct 23, 2026
@c-knof
c-knof force-pushed the feature/trunk/ck/po-migration-wave-a branch 2 times, most recently from e0f0e5b to 5b5311b Compare October 28, 2026 08:38
c-knof and others added 24 commits October 28, 2026 10:20
The seven Activities now get `ILIAS\AccessControl\PublicInterface\RBAC` via `$use` instead of
reaching into `$GLOBALS['DIC']->rbac()`, and call `system()` only in `isAllowedToPerform()`.
The Setup agent uses `InstallLanguage::forSetup()`/`UpdateLanguage::forSetup()`, since Setup
checks no permissions and needs no RBAC.
`InstalledLanguageDatabaseRepository`, `LanguageInstallationManager`, `AddLanguageEntry` and the
`ilSetupLanguage` of the web Activities now get `ILIAS\Database\Connection` via `$pull` instead of
resolving `$GLOBALS['ilDB']`. `ilSetupLanguage` takes an optional connection; Setup keeps handing
in its database via `setDbHandler()`, also for the metrics, and the file-only checks need no
database.
The Setup CLI asks `ilLanguagesInstalledAndUpdatedObjective` for its label before `achieve()`,
so `getLabel()` only worked through a leftover `$GLOBALS['ilDB']`. `isApplicable()`, which the
CLI calls first, now reads the languages from the Setup database and `getLabel()` lists them
without database access.
The repository and the installation manager in the component graph now get the root from
`ILIAS\Environment\Configuration\Installation\Directories` at resolve time instead of a path
computed in `init()`. Callers outside the graph keep passing the path themselves.
… container

`AllModernComponents` bound `$DIC[ILIAS\Language\Language::class]` to the `$use`d language,
whose legacy adapter itself delegates to `$DIC->language()`. Nothing reads the key, so the
constructor parameter and the binding are removed.
No component pulls `InstalledLanguageRepository` or `LanguageInstallationManager`, so they stay
internal services of the component; `ilSetupLanguage` remains the entry point for callers
outside it.
The Activities took the ref_id of the language folder as `int|\Closure` defaulting to 0. They
now require `ILIAS\Language\LanguageFolder`, whose `LanguageFolderLegacyProxy` looks the ref_id up
only when a permission is checked.
Keep only what the code does not say itself (the why, a constraint or a
pitfall), mostly in one line, and drop the history of how it got there.
…vities

A denied permission is now a `DomainException` with code 403 instead of a localized string, and
`Failure::of()` masks every error outside the 4xx range as a generic 500, so callers other than the
GUI no longer see internal messages. `InvalidInputException` carries 400,
`AmbiguousLanguageTitleException` 409; `RendersActivityErrors` decides by code, which replaces the
`SafeToDisplayActivityError` marker.
…the File Activities

`LanguageActivity::isAllowedToPerform()` now rejects unknown and anonymous users before asking RBAC,
as `FileUpload\Activities\AccessCheck` does for the File Activities. `maybePerformAs()` hands the
trusted user id to `perform()` directly, which replaces the `additionalPerformParameters()` hook.
…ections like the File Activities

The descriptions are built with `ILIAS\Data\Factory` instead of an own markdown helper, so the
Activities no longer need the Refinery. The input of every Activity is a titled `section` instead of
an untitled `group`, as in the File Activities.
…Provider` like the File Activities

The language objects, language entries, the module cache, the user lookup and the settings are
reached through one `RepositoryProvider` instead of optional closures with legacy defaults in every
Activity. `UninstallLanguage`, `RemoveLocalLanguageChanges`, `AddLanguageEntry` and the two settings
Activities take it as their only dependency besides language, RBAC and language folder; the tests
mock it.
A `PDOException` carries its SQLSTATE as string code, and `'42S02'` compares as a 4xx code, so
`Failure::of()` and `RendersActivityErrors` showed the database message as input error. Both now
require an integer code. The test doubles no longer call the removed `markdown()` helper.
Keeps only what the code does not say itself, as in the File component: the reasons in
`Language.php` shrink to the two real traps (no `final` Activities, the order of the contributions),
and the tests lose their history notes.
`LanguageActivity` no longer takes `Language`: only `AddLanguageEntry` needs it, for the labels of
its translation fields. The other six Activities, their `forSetup()` variants and the wiring drop
the parameter.
…st CSRF

The table actions were read from the query by `executeCommand()` without a
command, so ilCtrl never checked a token. `ilObjLanguageFolderGUI` now
implements `ilCtrlSecurityInterface`, runs the table actions only through the
unsafe command `executeTableAction` and dispatches an exact allowlist of
commands, since ilCtrl compares commands case-sensitively but PHP calls
methods case-insensitively. Takes effect after the ctrl security artifact is
rebuilt (`composer dump-autoload` or `setup build`).
c-knof added 25 commits October 28, 2026 10:20
Registration contributes its lang directory and ships the `registration`
module as .pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
RemoteCategory contributes its lang directory and ships the `rcat`
module as .pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
RemoteCourse contributes its lang directory and ships the `rcrs` module
as .pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
RemoteFile contributes its lang directory and ships the `rfil` module as
.pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
RemoteGlossary contributes its lang directory and ships the `rglo`
module as .pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
RemoteGroup contributes its lang directory and ships the `rgrp` module
as .pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
RemoteLearningModule contributes its lang directory and ships the `rlm`
module as .pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
RemoteTest contributes its lang directory and ships the `rtst` module as
.pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
RemoteWiki contributes its lang directory and ships the `rwik` module as
.pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
Skill contributes its lang directory and ships the `skll` and `skmg`
modules as .pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: they no longer exist in the global language files.
StaticURL contributes its lang directory and ships the `stus` module as
.pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
Survey contributes its lang directory and ships the `svy` module as
.pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
SystemCheck contributes its lang directory and ships the `sysc` module
as .pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
Table contributes its lang directory and ships the `tbl` module as
.pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
Tagging contributes its lang directory and ships the `tagging` module as
.pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
Tasks contributes its lang directory and ships the `task` module as
.pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
Taxonomy contributes its lang directory and ships the `tax` module as
.pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
Test contributes its lang directory and ships the `tstv` module as
.pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
TestQuestionPool contributes its lang directory and ships the `qpl`
module as .pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
UI contributes its lang directory and ships the `ui` module as .pot/.po
files, converted with convert_module_to_po.php --remove-from-lang: it no
longer exists in the global language files.
User contributes its lang directory and ships the `usr` module as
.pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
WOPI contributes its lang directory and ships the `wopi` module as
.pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
WebServices contributes its lang directory and ships the `ecs` module as
.pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
WorkspaceFolder contributes its lang directory and ships the `wfld`
module as .pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
For every literal ComponentLanguageFileDirectory contribution of a
component: its .pot and English .po are shipped, its lines are gone from
lang/ilias_*.lang and no other component contributes the same prefix;
every shipped .pot is contributed.
@c-knof
c-knof force-pushed the feature/trunk/ck/po-migration-wave-a branch from 5b5311b to 0114080 Compare October 28, 2026 09:34
@c-knof
c-knof merged commit bd597ef into ILIAS-eLearning:trunk Oct 28, 2026
5 checks passed
@c-knof
c-knof deleted the feature/trunk/ck/po-migration-wave-a branch October 28, 2026 09:43
c-knof added a commit that referenced this pull request Oct 28, 2026
Moves the modules of wave 2 from the global language files into the
.pot/.po files of their components, one commit per component.
c-knof added a commit that referenced this pull request Oct 28, 2026
Moves the modules of wave 3 from the global language files into the
.pot/.po files of their components, one commit per component.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement php Pull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants