Repository navigation
Conversation
… introduce Activities
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.
… of the component translation classes
…ndent of their order
…tead of a path read during wiring
…y proxy instead of a global $DIC fallback
…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.
Group contributes its lang directory and ships the `grp` module as .pot/.po files, converted with convert_module_to_po.php --remove-from-lang: it no longer exists in the global language files.
Logging also ships the `log` 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 used nowhere and missing in en (last present in lang/ilias_*.lang of caab027): `log` (log_browser, log_browser_users, log_cache_, log_cache_info, log_cache_level, log_component_root_desc, log_general_settings, log_log_level, log_memory).
OrgUnit contributes its lang directory and ships the `orgu` 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 missing in en (last present in lang/ilias_*.lang of caab027): `orgu` (org_op_manage_participants, org_op_score_participants); every language still gets them from the `rbac` module.
Repository contributes its lang directory and ships the `rep` 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): `rep` (rep_add_to_favourites, rep_added_to_favourites, rep_remove_from_favourites, rep_removed_from_favourites).
ResourceStorage contributes its lang directory and ships the `irss` module as .pot/.po files, converted with convert_module_to_po.php --remove-from-lang: it no longer exists in the global language files.
Search contributes its lang directory and ships the `search` 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): `search` (search_area, search_sort_generic_asc, search_sort_generic_desc).
StudyProgramme contributes its lang directory and ships the `prg` 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 also ships the `survey` 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 used nowhere and missing in en (last present in lang/ilias_*.lang of caab027): `survey` (dont_use_questionpool, err_no_pool_name, select_questionpool_short, spl_online_property_description, survey_360_appraisee_info, survey_360_no_closed_appraisees, survey_360_rate_other_appraisees, survey_360_raters_status_info, survey_existing_pool, survey_from_x_points, survey_new_pool, survey_no_pool, survey_pool_selection, survey_question_pool_usage, survey_question_pool_usage_active, survey_question_pool_usage_active_info, survey_question_pool_usage_inactive, survey_question_pool_usage_inactive_info, svy_mail_own_results, svy_page_add_question, svy_results_view_own, svy_results_view_own_info). Left out as missing in en (last present in lang/ilias_*.lang of caab027): `survey` (select_questionpool); every language still gets it from the `common` module.
en and the 29 other languages have rpc_pdf_font, rpc_pdf_font_info and rpc_pdf_generation in `common`, hu has them in `administration` by mistake. JavaServerGUI.php calls them, so hu keeps its texts when `administration` is served from PO files without these keys.
Administration contributes its lang directory and ships the `administration` 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): `administration` (rpc_pdf_configuration).
MetaData contributes its lang directory and ships the `meta` 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): `meta` (meta_oer_blocked, meta_oer_blocked_info, meta_oer_categories, meta_oer_target). Left out as missing in en (last present in lang/ilias_*.lang of caab027): `meta` (meta_subjectmatterexpert). It is still used (MetaData Vocabularies Standard Repository, role "subject matter expert") but was removed from en and de in c1a3ed0; en and de already showed the identifier.
…hanges `language_merge_local_changes_info` only named `lang/ilias_%s.lang`, but the local changes of modules maintained in PO files are merged into the `.po` files of their components. Translations are marked fuzzy, the English fallback is renewed.
As decided for the migration to PO files (unused modules are removed, not migrated), the global language files no longer contain these modules (last present in lang/ilias_*.lang of caab027): - `cptch` (cptch_freetype_support_needed, cptch_wrong_input) - `bkm` (bkm_fold_created) - `pdesk` (bookmark_moved_ok, bookmark_select_target) - `excv` (excv_create, excv_create_info) - `impr` (impr_page_type_impr) - `sc13` (sc13_page_type_sahs) - `cond` (cond_under_parent_control) - `notifications` (push_notification) - `violation` (not_a_string) No code asks for these identifiers; `push_notification` is only the label of an icon, not translated. `not_a_string` is still used (Refinery MakeClickable), every language gets it from the `validation` module.
Administration also ships the `adm` 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.
Authentication contributes its lang directory and ships the `auth` module as .pot/.po files, converted with convert_module_to_po.php --remove-from-lang: it no longer exists in the global language files.
BackgroundTasks contributes its lang directory and ships the `bgtask` and `background_tasks` modules as .pot/.po files, converted with convert_module_to_po.php --remove-from-lang: they no longer exist in the global language files.
COPage also ships the `content` 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 used nowhere and missing in en (last present in lang/ilias_*.lang of caab027): `content` (cont_Link, cont_Media). They differ from cont_link and cont_media only in case (one row in lng_data), so the lowercase keys stay.
Dashboard also ships the `pd` 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 used nowhere and missing in en (last present in lang/ilias_*.lang of caab027): `pd` (pd_no_items_to_manage, pd_remove_multiple, pd_unsubscribe_memberships, pd_unsubscribe_multiple_memberships).
LTI also ships the `lti` 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.
MainMenu contributes its lang directory and ships the `mme` 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 also ships the `mem` 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.
Notifications also ships the `noti` 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.
Scorm2004 contributes its lang directory and ships the `scormdebug` module as .pot/.po files, converted with convert_module_to_po.php --remove-from-lang: it no longer exists in the global language files.
ScormAicc contributes its lang directory and ships the `scormtrac`, `scov` and `sahs` 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): `sahs` (sahs_activate_expert_mode, sahs_activate_expert_mode_info).
Test also ships the `assessment` 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 used nowhere and missing in en (last present in lang/ilias_*.lang of caab027): `assessment` (err_divider_too_big_specific).
Language also ships the `common` 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, which now only keep their header. Left out as used nowhere and missing in en (last present in lang/ilias_*.lang of caab027): `common` (marked_entries, obj_extt, obj_extt_desc). Left out as missing in en (last present in lang/ilias_*.lang of caab027): `common` (obj_objf_desc). It is still used (ilTree, the description of the system object "objf") but was removed from en and de in c1a3ed0; en and de already showed the identifier. Left out as missing in en (last present in lang/ilias_*.lang of caab027): `common` (obj_spl_select). It was removed from en in c3347a4; ilObject::_prepareCloneSelection() still asks for it as the first option, which ilObjSurveyQuestionPool::_getAvailableQuestionpools() never shows.
Every language module is now shipped as gettext files by its component and the global files in /lang hold no entries anymore. Describe the format and location of the .pot/.po files in the guidelines, `common` as module of the Language component, `php cli/setup.php build` instead of refreshing the languages, and that the shipped files are never read from the database and need native gettext. The rules themselves are unchanged.
Only the confirmation screen removed from `ilObjLanguageFolderGUI` used it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 4 of 4 of the migration of all language modules to PO files.
Depends on #12264
One commit per component. Each commit moves the component's modules from
lang/ilias_<lang>.langintocomponents/<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
.pofiles of the component from now on.