Skip to content

Migrate Language component to the Component Revision architecture and introduce Activities - #12090

Open
c-knof wants to merge 10 commits into
ILIAS-eLearning:trunkfrom
kroepelin-projekte:language-component-revision
Open

c-knof wants to merge 10 commits into
ILIAS-eLearning:trunkfrom
kroepelin-projekte:language-component-revision

Conversation

@c-knof

@c-knof c-knof commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Migrates the Language component to the Component Revision architecture ($define/$implement/$use/$contribute/$seek/$provide/$pull/$internal) and introduces Activity implementations for its domain operations, replacing logic previously embedded directly in the GUI classes.

  • Introduce 7 Language Activities (components/ILIAS/Language/src/Activities): InstallLanguage, UninstallLanguage, UpdateLanguage, AddLanguageEntry, RemoveLocalLanguageChanges, SetLanguageDetectionEnabled, SetLanguageTranslationEnabled, plus supporting traits/classes (GrindsFormInput, GrindingInputAccess, ParsesLanguageKeyList, ResolvesLanguageKeysToObjIds, RendersActivityErrors, exception types)
  • Extract corresponding domain logic out of class.ilObjLanguageFolderGUI.php / class.ilObjLanguageExtGUI.php into these Activities
  • Add InstalledLanguageRepository/InstalledLanguageDatabaseRepository and LanguageInstallationManager/LanguageFileParsing under src/Setup to back the new Activities and setup objectives
  • Add ComponentTranslation support (ComponentLanguageFileDirectory, CustomizingLanguageFileDirectory, MainLanguageFileDirectory, LanguageFileDirectoryManager) so individual components can ship their own language files instead of everything living in the central lang/ files; implemented exemplarily for the File component (components/ILIAS/File/File.php, components/ILIAS/File/lang/ilias_{de,en}.lang) as a reference for how other components can adopt this going forward
  • Replace several SELECT * FROM lng_modules queries with queries selecting only the needed columns (e.g. SELECT lang_array FROM lng_modules) as part of the lng_modules access rewrite in class.ilSetupLanguage.php / class.ilObjLanguage.php
  • Wire the new dependency graph in Language.php, Init.php, and AllModernComponents.php
  • Extend README.md and docs/development/language.md with the Activities overview and documented, known deviations from the Activity contract
  • Add extensive PHPUnit coverage for every new Activity, the setup repository/manager, the component dependency graph, and GUI call sites

Other changes

  • ilCertificateDateHelperTest.php: loosen the lng_modules query mock match (SELECT * FROM lng_modules → FROM lng_modules), since the column list actually queried against lng_modules changed as part of this migration (see above) and the previous exact-string match no longer applied.

@c-knof c-knof self-assigned this Sep 17, 2026
@c-knof c-knof added improvement php Pull requests that update Php code authorities Pull requests that contain updates to the authorities of a component. labels Sep 17, 2026
@matthiaskunkel matthiaskunkel removed the authorities Pull requests that contain updates to the authorities of a component. label Oct 3, 2026
@matthiaskunkel

Copy link
Copy Markdown
Member

I removed the ‘Authorities’ label because this is not a PR that should change authority assignments in the maintenance.md.

@c-knof
c-knof force-pushed the language-component-revision branch from 9b99a5f to 1d1950c Compare October 12, 2026 15:53
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.
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.

5 participants