Skip to content

Language: Maintain the language modules of wave 2 in PO files - #12263

Open
c-knof wants to merge 198 commits into
ILIAS-eLearning:trunkfrom
kroepelin-projekte:feature/trunk/ck/po-migration-wave-b
Open

c-knof wants to merge 198 commits into
ILIAS-eLearning:trunkfrom
kroepelin-projekte:feature/trunk/ck/po-migration-wave-b

Conversation

@c-knof

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

Copy link
Copy Markdown
Contributor

Part 2 of 4 of the migration of all language modules to PO files.
Depends on #12262

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 and others added 30 commits October 23, 2026 16:49
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`).
…ObjLanguageFolderGUI`

Listing and downloading the deprecated entries failed with an error, because
`ilObjLanguageFolderGUI` still included `ilLangDeprecated` from the former
`Services/Language` directory.
…uageFolderGUI`

`confirmRefreshSelectedObject()`, `confirmUninstallObject()`,
`confirmUninstallChangesObject()` and the table action `edit` could no longer
be reached since the table actions confirm in modals, and their confirmations
failed for lack of language ids.
Named arguments are not used in the core (review criteria).
PHPUnit 14 no longer allows `with()` without `expects()`, so the mocks in
`SetLanguageTranslationEnabledTest`, `AddLanguageEntryTest` and
`LanguageInstallationManagerTest` now expect their calls once.
…es as `@internal`

`TranslationCache`, `InstallationRoot`, `LanguageSettings` and their implementations
are only wired in `$internal` and used inside the Language component, like the
language file directories that already carry the marker.
Reverts the PO pilot of the File component from the base branch: the
`file` entries move back into lang/ilias_*.lang and File no longer
contributes a LanguageFileDirectory. The PO migration is piloted with
TermsOfService and Poll instead.
c-knof added 27 commits October 23, 2026 16:54
Dashboard contributes its lang directory and ships the `dash` module as
.pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.

Left out as used nowhere and missing in en (last present in
lang/ilias_*.lang of caab027): `dash`
(dash_info_sure_remove_from_favs, dash_make_favourite).
EmployeeTalk contributes its lang directory and ships the `etal` module
as .pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
Exercise also ships the `exc` module as .pot/.po files from its lang
directory, converted with convert_module_to_po.php --remove-from-lang:
it no longer exists in the global language files.
File contributes its lang directory and ships the `file` module as
.pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
Folder contributes its lang directory and ships the `fold` module as
.pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
Form contributes its lang directory and ships the `form` module as
.pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
Glossary contributes its lang directory and ships the `glo` module as
.pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
ILIASObject contributes its lang directory and ships the `obj` module as
.pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
IndividualAssessment contributes its lang directory and ships the `iass`
module as .pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
ItemGroup contributes its lang directory and ships the `itgr` module as
.pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.

Left out as used nowhere and missing in en (last present in
lang/ilias_*.lang of caab027): `itgr` (itgr_show_title,
itgr_show_title_info).
LearningModule contributes its lang directory and ships the `lm` module
as .pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
LearningSequence contributes its lang directory and ships the `lso`
module as .pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.

Left out as used nowhere and missing in en (last present in
lang/ilias_*.lang of caab027): `lso`
(lso_settings_availability_error).
Mail contributes its lang directory and ships the `mail` module as
.pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
MediaCast contributes its lang directory and ships the `mcst` module as
.pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
Membership contributes its lang directory and ships the `mmbr` and
`membership` modules as .pot/.po files, converted with
convert_module_to_po.php --remove-from-lang: they no longer exist in the
global language files.

Left out as used nowhere and missing in en (last present in
lang/ilias_*.lang of caab027): `membership`
(mem_force_notification_mode_all, mem_force_notification_mode_custom),
`mmbr` (mmbr_info_delete_sure_unsubscribe, mmbr_selected_users).
News contributes its lang directory and ships the `news` module as
.pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
Notifications contributes its lang directory and ships the
`notifications_adm` module as .pot/.po files, converted with
convert_module_to_po.php --remove-from-lang: it no longer exists in the
global language files.
PersonalWorkspace also ships the `wsp` module as .pot/.po files from its
lang directory, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.

Left out as missing in en (last present in lang/ilias_*.lang of
caab027): `wsp` (search_no_match); every language still gets it from
the `search` module.
Portfolio contributes its lang directory and ships the `prtf` and `prtt`
modules as .pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: they no longer exist in the global language files.
PrivacySecurity contributes its lang directory and ships the `ps` module
as .pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
Refinery contributes its lang directory and ships the `validation`
module as .pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
Session contributes its lang directory and ships the `sess` module as
.pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.

Left out as used nowhere and missing in en (last present in
lang/ilias_*.lang of caab027): `sess` (sess_show_members).
Style contributes its lang directory and ships the `style` module as
.pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.

Left out `Style` of `style`: it differs from `style` only in case (one
row in lng_data), so the lowercase key stays; nothing calls `Style`.
Tracking contributes its lang directory and ships the `trac` 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 also ships the `user` module as .pot/.po files from its lang
directory, converted with convert_module_to_po.php --remove-from-lang:
it no longer exists in the global language files.
WebResource contributes its lang directory and ships the `webr` module
as .pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
Wiki contributes its lang directory and ships the `wiki` module as
.pot/.po files, converted with convert_module_to_po.php
--remove-from-lang: it no longer exists in the global language files.
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