|
ILIAS
trunk Revision v13.0_alpha-62-g3b72d83f2e5
|
Go to the source code of this file.
Variables | |
| if (PHP_SAPI !=='cli') | |
| Pilot conversion tool for the PO/MO migration. More... | |
| $printable | |
| Makes control characters (e.g. More... | |
| $read_file | |
| Read once, so the lines and the hash checked by –remove-from-lang come from the same bytes. More... | |
| $body_lines | |
| The lines of $content the installer reads (see LanguageFileParsing::cutHeader()). More... | |
| $has_start_marker | |
| $read_lines | |
| $module_lines | |
| $entries_of | |
| $parse_module | |
| $find_duplicate_keys | |
A legacy .lang file can define the same identifier twice for one module (uniqueness validation of the FR "PO-Files for improving language handling", 2.4). More... | |
| $format_keys | |
| $without_module_lines | |
| $content without the lines of $module - exactly those $read_lines reports, and only behind the line "<!-- language file start -->" (the installer ignores everything before it; only called for files with that line). More... | |
| $is_fuzzy_marker = LegacyFuzzyMarker::matches(...) | |
Whether a ### comment is the dated "not translated yet" marker (-> "#, fuzzy") rather than a note (-> "#."), see LegacyFuzzyMarker (shared with the installation). More... | |
| $singular_form_index | |
| The form that serves n = 1 if it serves no other n, else null. More... | |
| $singular_form_of | |
| The form of the plural message $key that gets the singular key's value, or null: only if the singular key is translated (not empty, not from the reference language, no "new variable" marker) and the rule has a form for n = 1 alone. More... | |
| $plural_forms_of | |
| $copies_own_value | |
| Whether the own value of the plural message $key was copied into several forms (flagged fuzzy, see the file docblock). More... | |
| $build_catalog | |
| $removal_target_problem | |
| Why $output_argument is no place –remove-from-lang may rely on, or null: it must be the existing components/<Vendor>/<Component>/lang whose component class contributes a ComponentLanguageFileDirectory for $module there with the file name pattern $pattern - otherwise the installation would not find the .po files and the module would lose its values. More... | |
| $existing_headers | |
| $write | |
| $arguments = [] | |
| $pattern = null | |
| $skip_unmigratable_keys = false | |
| $remove_from_lang = false | |
| foreach(array_slice($argv, 1) as $argument) | $usage |
| if(!isset($arguments[0])) if(count( $arguments) > 3) if(! $remove_from_lang &&isset($arguments[2]) &&!is_dir($arguments[2])) | $module = $arguments[0] |
| $reference_lang_key = $arguments[1] ?? 'en' | |
| try | |
| catch(InvalidArgumentException $e) | $repo_root = dirname(__DIR__, 5) |
| if($remove_from_lang) | $plural_config_file = __DIR__ . '/plurals.json' |
| $plural_config = ['plural_forms' => [], 'modules' => []] | |
| if(is_file($plural_config_file)) | else |
| $plural_rules = [] | |
| $plural_definitions | |
| $output_dir = isset($arguments[2]) ? rtrim($arguments[2], '/') : (__DIR__ . '/output/' . $module) | |
| $lang_dir = $repo_root . '/lang' | |
| $lang_files = glob($lang_dir . '/ilias_*.lang') | |
| if($lang_files===[]) | $per_language = [] |
| $read_files = [] | |
| $files_without_marker = [] | |
| $removal_problems = [] | |
| $duplicates = [] | |
| $unsafe_files = [] | |
| foreach($lang_files as $file) if( $unsafe_files !==[]) if($files_without_marker !==[] && $remove_from_lang) foreach( $files_without_marker as $file) if($removal_problems !==[]) | $invalid_encoding = [] |
| foreach( $per_language as $lang_key=> $entries) if($invalid_encoding !==[]) if(array_sum(array_column( $read_files, 'lines'))===0) if(!isset($per_language[$reference_lang_key])) | $reference_keys = array_map('strval', array_keys($per_language[$reference_lang_key])) |
| $duplicate_report = [] | |
| $identical_duplicate_report = [] | |
| foreach($duplicates as $lang_key=> $keys) if( $duplicate_report !==[]) if($identical_duplicate_report !==[]) | $unmigratable_keys = [] |
| foreach($per_language as $lang_key=> $entries) if( $unmigratable_keys !==[] &&! $skip_unmigratable_keys) if($unmigratable_keys !==[]) | $reference_entries = $per_language[$reference_lang_key] |
| $source_lang_keys = array_values(array_unique([$reference_lang_key, 'de', 'en'])) | |
| if($reference_entries===[]) | $markup_policy = new TranslationMarkupPolicy() |
| $markup_report = [] | |
| $markup_messages = [] | |
| foreach( $per_language as $lang_key=> $entries) foreach($markup_messages as $message=> $lines) | $own_entry_counts = array_map('count', $per_language) |
| $filled = [] | |
| foreach($per_language as $lang_key=> $entries) | $plural_problems = [] |
| foreach($plural_definitions as $key=> $definition) if( $plural_definitions !==[]) if($plural_problems !==[]) | $language_names = [] |
| $english_lang_file = $repo_root . '/lang/ilias_en.lang' | |
| if(is_file($english_lang_file)) if( $language_names===[]) foreach(array_keys($per_language) as $lang_key) | $pot_path = $output_dir . '/' . MigratedLanguageFilePaths::templateFileName($pattern, $module) |
| $contents = [] | |
| $report = [] | |
| $pot_headers = $existing_headers($pot_path) | |
| $all_ok = true | |
| foreach ( $report as $row) | |
| if(! $all_ok) if(!is_dir($output_dir) &&! @mkdir($output_dir, 0775, true) &&!is_dir($output_dir)) | $written = [] |
| if(! $remove_from_lang) | $new_lang_contents = [] |
| $changed_files = [] | |
| foreach( $read_files as $lang_key=> $read) | if ( $changed_files !==[]) |
| $removed_total = 0 | |
| foreach ( $new_lang_contents as $lang_key=>[ $new_content, $removed]) | |
| $all_ok = true |
Definition at line 1053 of file convert_module_to_po.php.
| $arguments = [] |
Definition at line 557 of file convert_module_to_po.php.
Referenced by ActiveRecord\__call(), ilSoapFunctions\__call(), ILIAS\AuthSOAP\SoapDummyAuthHandler\__soapCall(), ILIAS\LegalDocuments\Value\CriterionContent\arguments(), ILIAS\Tests\Refinery\String\MakeClickableTest\createInput(), ILIAS\LegalDocuments\Condition\Definition\RoleDefinition\formGroup(), ILIAS\LegalDocuments\Condition\Definition\UserCountryDefinition\formGroup(), ILIAS\LegalDocuments\Condition\Definition\UserLanguageDefinition\formGroup(), ILIAS\GlobalScreen\getWithMultipleArguments(), MigrateMailAttachmentsToIRSSUnitTest\invokePrivate(), ILIAS\Refinery\Parser\ABNF\Primitives\lazy(), ILIAS\AuthSOAP\SoapDummyAuthHandler\normalizeParameterKeys(), ChildPhp\open(), ChildPhp\run(), ilMailDeliveryJob\run(), ConvertModuleToPoToolTest\runTool(), LanguageIdentifierEnumToolTest\runTool(), ConvertModuleToPoToolTest\runToolAt(), ilVirusScannerICapClient\scanFile(), ilVirusScannerClamAV\scanFile(), ConvertModuleToPoToolTest\testARunWithoutAModuleFailsAndWritesNothing(), ConvertModuleToPoToolTest\testInvalidArgumentsFailWithExitOneAndWriteNothing(), LanguageIdentifierEnumToolTest\testInvalidInputIsRefusedWithExitCodeTwoAndNothingIsWritten(), and ILIAS\MetaData\OERExposer\OAIPMH\Responses\RequestProcessor\writeBadArgumentError().
| $body_lines |
The lines of $content the installer reads (see LanguageFileParsing::cutHeader()).
Definition at line 125 of file convert_module_to_po.php.
| $build_catalog |
| array<array-key,array{value | string, comment: ?string}> $reference_entries msgid order + fallback extracted comments | |
| array<string,array{value | string, comment: ?string}>|null $translation_entries null => POT (no msgstr, no fuzzy) | |
| array<string,string> | $existing_headers headers of an already existing target file | |
| array<string,array{singular? | string, plural_id?: string}> $plural_definitions msgid => definition | |
| string | null | $language_name | English name of the language, null => keep an existing "Language-Team" |
| array<string,true> | $filled_keys keys whose value was taken from the reference language (-> fuzzy) | |
| bool | $is_source_language | original texts (see $source_lang_keys): a plural value copied into several forms is not fuzzy |
Definition at line 394 of file convert_module_to_po.php.
| $changed_files = [] |
Definition at line 1092 of file convert_module_to_po.php.
| $contents = [] |
Definition at line 928 of file convert_module_to_po.php.
Referenced by assOrderingQuestion\cleanImagefiles(), ILIAS\UI\examples\MainControls\Slate\Combined\combined(), ilMemberExportGUI\downloadExportFile(), ilPRGMembersExportGUI\downloadExportFile(), TestRailXMLWriter\getBlockContents(), ILIAS\UI\Implementation\Component\MainControls\Slate\Renderer\getCombinedSlateContents(), ilObjLearningSequenceLearnerGUI\getMainContent(), ILIAS\Test\Results\Presentation\AttemptResultsTable\getMapping(), ILIAS\UI\examples\Layout\Page\Standard\getUIMainbar(), ILIAS\MetaData\OERExposer\OAIPMH\Responses\RequestProcessorTestCase\getWriter(), ILIAS\UI\examples\MainControls\Slate\Legacy\legacy(), ilRisReader\parseString(), ilTestArchiver\readArchiveDataIndex(), ilBcryptPasswordEncoder\readClientSalt(), ilFileSystemCleanTempDirCron\reportCorruptedPaths(), ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\rewind(), wsdl\serializeType(), LanguageInstallationManagerMigratedUnshippedOverlaysTest\testOnlyModulesWithLocalChangesNotYetInTheRecordAreReportedAsUnrecorded(), ILIAS\UI\Implementation\Component\Input\withInput(), and ILIAS\UI\Implementation\Component\Input\Field\HasDynamicInputs\withInput().
| $copies_own_value |
Whether the own value of the plural message $key was copied into several forms (flagged fuzzy, see the file docblock).
| array<string,array{value | string, comment: ?string}> $entries |
| array{singular? | string, plural_id?: string} $definition |
| array<string,true> | $filled_keys |
Definition at line 371 of file convert_module_to_po.php.
| $duplicate_report = [] |
Definition at line 757 of file convert_module_to_po.php.
| $duplicates = [] |
Definition at line 665 of file convert_module_to_po.php.
Referenced by ilLanguageDuplicateIdentifierException\__construct(), ILIAS\WebDAV\Objects\TreeProxyRepository\analyseProblems(), ilObjLanguageExtGUI\duplicateIdentifierMessage(), ILIAS\Language\ComponentTranslation\IdentifierUniqueness\duplicatesIn(), ilSCTreeDuplicatesTableGUI\fillRow(), ILIAS\Language\ComponentTranslation\IdentifierUniqueness\findDuplicatesAmong(), ILIAS\MetaData\Settings\Vocabularies\Import\Importer\findDuplicateValues(), ILIAS\COPage\ID\ContentIdManager\getDuplicatePCIds(), ilLanguageDuplicateIdentifierException\getDuplicates(), ILIAS\COPage\ID\ContentIdManager\hasDuplicatePCIds(), ILIAS\MetaData\Settings\Vocabularies\Import\Importer\import(), ilObjLanguageFolderGUI\installObject(), ILIAS\Language\Activities\AddLanguageEntry\perform(), ilObjLanguageFolderGUI\refreshSelectedObject(), ILIAS\Language\Tests\ComponentTranslation\IdentifierUniquenessTest\testAtMostTenDuplicatesAreNamedPerEntryInSortedOrder(), and ILIAS\Language\Tests\ComponentTranslation\IdentifierUniquenessTest\testManyEntriesWithTheSameIdentifierAreComparedInLinearTime().
| $english_lang_file = $repo_root . '/lang/ilias_en.lang' |
Definition at line 896 of file convert_module_to_po.php.
| $entries_of |
| list<array{0 | string, 1: string}> $lines see $module_lines - a later line of the same key wins |
Definition at line 191 of file convert_module_to_po.php.
| $existing_headers |
Definition at line 537 of file convert_module_to_po.php.
| $files_without_marker = [] |
Definition at line 662 of file convert_module_to_po.php.
| $filled = [] |
Definition at line 860 of file convert_module_to_po.php.
| $find_duplicate_keys |
A legacy .lang file can define the same identifier twice for one module (uniqueness validation of the FR "PO-Files for improving language handling", 2.4).
| list<array{0 | string, 1: string}> $lines see $module_lines |
Definition at line 222 of file convert_module_to_po.php.
| $format_keys |
| array<array-key> | $keys |
Definition at line 240 of file convert_module_to_po.php.
| $has_start_marker |
Definition at line 136 of file convert_module_to_po.php.
| $identical_duplicate_report = [] |
Definition at line 758 of file convert_module_to_po.php.
| foreach( $lang_files as $file) if($unsafe_files !==[]) if( $files_without_marker !==[] &&$remove_from_lang) foreach($files_without_marker as $file) if ( $removal_problems !==[]) $invalid_encoding = [] |
Definition at line 724 of file convert_module_to_po.php.
| $is_fuzzy_marker = LegacyFuzzyMarker::matches(...) |
Whether a ### comment is the dated "not translated yet" marker (-> "#, fuzzy") rather than a note (-> "#."), see LegacyFuzzyMarker (shared with the installation).
Definition at line 291 of file convert_module_to_po.php.
| $lang_dir = $repo_root . '/lang' |
Definition at line 650 of file convert_module_to_po.php.
| $lang_files = glob($lang_dir . '/ilias_*.lang') |
Definition at line 652 of file convert_module_to_po.php.
Referenced by ilPluginLanguage\getAvailableLangFiles(), and ConvertModuleToPoToolTest\testASecondRunForAMigratedModuleFailsAndKeepsThePoFilesByteIdentical().
| foreach( $plural_definitions as $key=> $definition) if($plural_definitions !==[]) if ( $plural_problems !==[]) $language_names = [] |
Definition at line 895 of file convert_module_to_po.php.
| $markup_messages = [] |
Definition at line 833 of file convert_module_to_po.php.
| if ( $reference_entries===[]) $markup_policy = new TranslationMarkupPolicy() |
Definition at line 831 of file convert_module_to_po.php.
Referenced by ILIAS\Language\ComponentTranslation\MigratedLanguageFileSync\databaseValues().
| $markup_report = [] |
Definition at line 832 of file convert_module_to_po.php.
| if(!isset( $arguments[0])) if(count($arguments) > 3) if (! $remove_from_lang &&isset( $arguments[2]) &&!is_dir( $arguments[2])) $module = $arguments[0] |
Definition at line 597 of file convert_module_to_po.php.
Referenced by ILIAS\BookingManager\Bookings\Table\BookingsTable\__construct(), ILIAS\Language\Setup\LanguageDataNotSavedException\__construct(), ilLanguage\__destruct(), ilObjLanguageExt\_deleteValues(), ilObjLanguageExt\_getRemarks(), ilRTESettings\_getUsedHTMLTags(), ilObjLanguageExt\_getValues(), addGlobal_ilDB(), ConvertModuleToPoToolTest\addRegisteredComponent(), ILIAS\Language\ComponentTranslation\ShippedPoMerger\addToTemplate(), LanguageInstallationManagerMigratedModulesTestCase\applyLngDataDelete(), ShippedLanguageFilesCompiledObjectiveTest\artifactPath(), ILIAS\Language\ComponentTranslation\MigratedLanguageFilePaths\assertValidModule(), ILIAS\Language\ComponentTranslation\ShippedPoMerger\backupFileNames(), ILIAS\Language\ComponentTranslation\ShippedPoMerger\backupShippedPoFiles(), PoMigrationWriteBackTest\bootstrapOverlayFromShipped(), SyncMigratedFilesAfterDeleteModeImportTest\bootstrapOverlayFromShipped(), ILIAS\Language\ComponentTranslation\ShippedTranslationsBuildTest\breakPo(), ILIAS\Init\Environment\HttpPathBuilder\build(), ILIAS\Language\ComponentTranslation\ShippedTranslationsBuildTest\build(), ilSoapFunctions\buildHTTPPath(), ILIAS\Language\ComponentTranslation\TranslationGettextRepository\buildKeys(), ILIAS\Language\ComponentTranslation\MigratedLanguageFilePaths\buildKeysFile(), ILIAS\Language\ComponentTranslation\MigratedLanguageFilePaths\buildMoFile(), SaveValuesMergesOntoOverlayTest\callCurrentModuleContent(), PoMigrationLoadLanguageModuleTest\callLoadFromMigratedLanguageFile(), UninstallRemovesMigratedMoFilesTest\callLoadFromMigratedLanguageFile(), MigratedPoFixture\catalog(), IdentifierTxtTest\catalog(), ILIAS\Help\Module\ModuleRetrieval\collectData(), PoMigrationLoadLanguageModuleTest\contributeFixtureModule(), PluralTxtTest\contributeModule(), ShippedPoModulesConsistencyTest\contributions(), ilObjLanguageExt\currentModuleContent(), ILIAS\Language\Activities\RepositoryProvider\currentModuleEntries(), LanguageInstallationManagerMigratedModulesTestCase\db(), ILIAS\Language\ComponentTranslation\MigratedLanguageFileSync\deltaOf(), ResetMigratedLocalChangesTest\directory(), ILIAS\Notifications\ilNotificationDatabaseHandler\disableListeners(), LanguageInstallationManagerMigratedModulesTestCase\droppedIdentifiers(), ILIAS\Language\ComponentTranslation\IdentifierUniqueness\duplicatesIn(), ILIAS\Language\Setup\LanguageInstallationManager\duplicatesOfCustomizingLines(), MigratedLanguageFileSyncEditableTest\editable(), ILIAS\Notifications\ilNotificationSystem\enableListeners(), ILIAS\Notifications\ilNotificationDatabaseHandler\enableListeners(), ILIAS\Notifications\ilNotificationSystem\enableUserListeners(), ilLanguage\exists(), ILIAS\Language\ComponentTranslation\IdentifierUniqueness\filterAddable(), ILIAS\Language\ComponentTranslation\ShippedTranslationsBuild\findCollisions(), ILIAS\Language\ComponentTranslation\IdentifierUniqueness\findDuplicatesAmong(), ILIAS\Language\Activities\RepositoryProvider\findDuplicatesOf(), ILIAS\Language\ComponentTranslation\IdentifierUniqueness\findDuplicatesOf(), ILIAS\Language\ComponentTranslation\MigratedLanguageFileSync\findModuleEntry(), ILIAS\Language\ComponentTranslation\MigratedLanguageFileSync\findModulesWithOverlay(), ILIAS\Language\ComponentTranslation\ShippedPoMerger\findShippedChangesSinceBackup(), ILIAS\Language\ComponentTranslation\ShippedTranslationsBuild\findShippedFiles(), ILIAS\Language\ComponentTranslation\MigratedLanguageFileSync\findShippedModuleFiles(), ILIAS\Language\ComponentTranslation\MigratedLanguageFilePaths\findShippedTemplates(), ILIAS\Language\ComponentTranslation\MigratedLanguageFileSync\flatModuleValues(), ILIAS\Language\ComponentTranslation\ShippedTranslationsBuild\formerCatalog(), ILIAS\Filesystem\Configuration\DatabaseBackedFilesystemConfig\fromSettingsTable(), ilClassificationBlockGUI\getHTML(), ILIAS\Language\Activities\AddLanguageEntry\getInputDescription(), ilLanguageStatisticsTable\getItems(), ILIAS\Language\ComponentTranslation\TranslationGettextRepository\getKeys(), ILIAS\Language\ComponentTranslation\TranslationInMemoryRepository\getKeys(), ILIAS\Language\ComponentTranslation\TranslationGettextRepository\getPluralText(), ILIAS\Language\ComponentTranslation\TranslationInMemoryRepository\getPluralText(), ILIAS\Language\ComponentTranslation\MigratedTranslations\getProblem(), ilObjLanguageExt\getShippedChangesSinceBackup(), ILIAS\Language\ComponentTranslation\TranslationGettextRepository\getText(), ILIAS\Language\ComponentTranslation\TranslationInMemoryRepository\getText(), ILIAS\Notifications\ilNotificationDatabaseHandler\getUsersByListener(), ILIAS\Language\ComponentTranslation\ShippedTranslationsBuild\hashes(), ILIAS\Language\Activities\RepositoryProvider\hasUnreadableContent(), PoMigrationLoadLanguageModuleTest\indexedDirectory(), ilLanguagesInstalledAndUpdatedObjective\informAboutInvalidMarkupInLocalChanges(), ILIAS\Language\Setup\LanguageInstallationManager\insertLanguageForApplyingLocalChanges(), ILIAS\Language\ComponentTranslation\TranslationGettextRepository\invalidateModule(), ilObjLanguageExt\isMaintainedInPoFiles(), ILIAS\FileDelivery\Setup\DeliveryMethodObjective\isModXSendFileLoaded(), ILIAS\Language\Setup\LanguageInstallationManager\isReadableOverlay(), ILIAS\Language\ComponentTranslation\MigratedLanguageFileSync\isRevision(), ILIAS\Language\ComponentTranslation\MigratedTranslations\isShippedModule(), ILIAS\Language\ComponentTranslation\MigratedLanguageFilePaths\isValidModule(), ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\keys(), ILIAS\Language\Activities\RepositoryProvider\languagesWithoutPluralForm(), PoMigrationWriteBackTest\loadFixturePo(), SyncMigratedFilesAfterDeleteModeImportTest\loadFixturePo(), ilDBPdo\loadModule(), ILIAS\Language\Setup\LanguageInstallationManager\loadOverlay(), SyncMigratedFilesAfterDeleteModeImportTest\loadOverlayPo(), ILIAS\Language\ComponentTranslation\MigratedLanguageFileSync\loadShippedFuzzyIdentifiers(), ILIAS\Language\ComponentTranslation\MigratedLanguageFileSync\loadShippedModuleEntries(), ILIAS\Language\ComponentTranslation\MigratedLanguageFileSync\loadShippedModules(), ILIAS\Language\ComponentTranslation\MigratedLanguageFileSync\loadShippedNotes(), ILIAS\Language\Tests\Activities\RepositoryProviderTest\managerFor(), ilObjLanguageExt\mergeIntoDatabase(), ilObjLanguageExt\mergeLocalChangesIntoShippedPoFiles(), ILIAS\Language\ComponentTranslation\MigratedLanguageFileSync\moduleEntries(), ShippedPoModulesConsistencyTest\moduleProvider(), ILIAS\Language\ComponentTranslation\MigratedLanguageFileSync\modulesWithLocalChangesTakenOver(), ilLanguage\moduleText(), ilLanguage\moduleTexts(), ResetMigratedLocalChangesTest\overlayBase(), PoMigrationWriteBackTest\overlayBase(), ILIAS\Language\ComponentTranslation\MigratedLanguageFilePaths\overlayDirectory(), SyncMigratedFilesAfterDeleteModeImportTest\overlayDirectory(), ILIAS\Language\ComponentTranslation\MigratedLanguageFilePaths\overlayDomain(), AdminGuiReadsValuesFromMigratedFileTest\overlayFile(), SyncMigratedFilesAfterDeleteModeImportTest\overlayFixtureDirectories(), SyncMigratedFilesAfterDeleteModeImportTest\overlayMoExists(), ILIAS\Language\ComponentTranslation\MigratedLanguageFilePaths\overlayMoFile(), UninstallRemovesMigratedMoFilesTest\overlayPath(), UninstallRemovesPluginMigratedMoFilesTest\overlayPath(), SyncMigratedFilesAfterDeleteModeImportTest\overlayRemarks(), ILIAS\Language\Activities\AddLanguageEntry\perform(), PluralTxtTest\pluralCatalog(), ilLanguage\pluralTxt(), ILIAS\Language\ComponentTranslation\ShippedTranslationsBuild\readManifest(), ilLanguage\readModuleTexts(), ILIAS\Language\ComponentTranslation\MigratedLanguageFileSync\readOverlayEntries(), ILIAS\Language\ComponentTranslation\ShippedTranslationsBuild\readPointerOf(), ilObjLanguageExt\readShippedMigratedModules(), ILIAS\Language\ComponentTranslation\MigratedLanguageFileSync\remarksOf(), ILIAS\Language\ComponentTranslation\MigratedLanguageFileSync\removeOverlayFiles(), ILIAS\Language\Setup\LanguageInstallationManager\removeOverlays(), ILIAS\Notifications\ilNotificationUserIterator\rewind(), ilHelpGUI\search(), PoMigrationWriteBackTest\seedFixtureModule(), SyncMigratedFilesAfterDeleteModeImportTest\seedFixtureModule(), LanguageInstallationManagerMigratedUnshippedOverlaysTest\seedGhostOverlay(), ResetMigratedLocalChangesTest\seedOverlay(), UninstallRemovesMigratedMoFilesTest\seedOverlay(), UninstallRemovesPluginMigratedMoFilesTest\seedOverlay(), MigratedLanguageFileSyncTestCase\seedShipped(), UninstallRemovesMigratedMoFilesTest\seedShippedModule(), UninstallRemovesPluginMigratedMoFilesTest\seedShippedModule(), ILIAS\Language\ComponentTranslation\TranslationGettextRepository\servedState(), MigratedPoFixture\servedTexts(), ILIAS\Language\ComponentTranslation\ShippedTranslationsBuildTest\servedValues(), ILIAS\Language\ComponentTranslation\ShippedTranslationsBuild\servesShippedPo(), ilObjLanguageExt\setOverlayRemarks(), ILIAS\ObjectGroup\Setup\ilObjectGroupRebrandMigration\settingsKeywordExists(), ILIAS\Language\ComponentTranslation\ShippedTranslationsBuildTest\ship(), ILIAS\Language\ComponentTranslation\MigratedLanguageFilePaths\shippedDomain(), ILIAS\Language\Activities\RepositoryProvider\shippedModuleFile(), ilObjLanguageExt\shippedModuleValues(), UninstallRemovesMigratedMoFilesTest\shippedPath(), UninstallRemovesPluginMigratedMoFilesTest\shippedPath(), MigratedLanguageFileSyncTestCase\shippedPo(), ILIAS\Language\Tests\Activities\RepositoryProviderTest\shippedPoDirectory(), ILIAS\Language\ComponentTranslation\ShippedTranslationsTest\shippedPoPath(), ResetMigratedLocalChangesTest\shipPo(), ILIAS\Language\ComponentTranslation\MigratedTranslations\shipsPoFor(), ILIAS\Language\ComponentTranslation\MigratedTranslations\shipsPoWithoutBuild(), ILIAS\Language\ComponentTranslation\ShippedTranslationsBuild\sourceParts(), ILIAS\Language\ComponentTranslation\MigratedLanguageFileSync\splitPluralDelta(), ILIAS\Language\ComponentTranslation\TranslationGettextRepository\state(), ILIAS\Language\Setup\LanguageInstallationManager\syncMigratedModules(), ILIAS\Language\ComponentTranslation\MigratedLanguageFilePaths\templateFileName(), ILIAS\Language\ComponentTranslation\ShippedTranslationsBuild\templateKeys(), ILIAS\Language\ComponentTranslation\MigratedLanguageFilePaths\templateLockFile(), ILIAS\Language\Tests\Activities\AddLanguageEntryWritesTest\testAddsEntryForEachInstalledLanguageWithANonEmptyValueAndSkipsEmptyOnes(), ShippedPoMergerTest\testAFailingMarkingOfTheOverlayIsReportedAndTheFilesStayWrittenAndTheNextMergeMakesUpForIt(), ILIAS\Language\Tests\Activities\AddLanguageEntryValidationTest\testAFormKeyWithNoSuchFormInAShippedMessageRejectsTheRequestBeforeAnyWrite(), ILIAS\Language\Tests\Activities\AddLanguageEntryWritesTest\testALanguageWhoseModuleCacheUpdateReportsAnUnwrittenOverlayIsListed(), ILIAS\Language\Tests\Activities\AddLanguageEntryWritesTest\testALanguageWithUnreadableModuleContentIsReportedUnwrittenAndNeverWritten(), ILIAS\Language\Tests\Activities\AddLanguageEntryValidationTest\testAnIdentifierExistingInAnotherModuleRejectsTheRequestBeforeAnyWrite(), ILIAS\Language\Tests\Activities\AddLanguageEntryWritesTest\testASkippedLanguageIsNeverListedAsHavingAnUnwrittenOverlay(), ILIAS\Language\Tests\Activities\AddLanguageEntryWritesTest\testAThrowingReplaceLangEntryPartwayThroughTheWriteLoopLeavesEarlierLanguagesWritten(), MigratedLanguageFilePathsTest\testBuildMoFileRejectsAModuleThatIsNotAPlainFileName(), ShippedPoModulesConsistencyTest\testEveryShippedPotIsContributed(), OfflineHandlingTest\testFileObjectSupportsOfflineHandling(), UninstallRemovesPluginMigratedMoFilesTest\testIsANoOpWhenClientDataDirIsNotResolvable(), UninstallRemovesPluginMigratedMoFilesTest\testIsANoOpWhenTheModuleHasNoOverlayForALanguageItShips(), UninstallRemovesPluginMigratedMoFilesTest\testLogsAndSwallowsARemovalFailureForOneLanguageWithoutAbortingOthers(), ShippedPoMergerTest\testMergeContinuesOtherModulesWhenTheDatabaseCallbackThrowsForOne(), ShippedPoModulesConsistencyTest\testModuleIsContributedExactlyOnce(), ShippedPoModulesConsistencyTest\testModuleIsRemovedFromLegacyLangFiles(), ShippedPoModulesConsistencyTest\testModuleShipsPotAndEnglishPo(), ILIAS\Language\ComponentTranslation\ShippedTranslationsBuildTest\testServesShippedPoIsTrueOnlyForThePoTheBuildWasMadeFrom(), MigratedLanguageFilePathsTest\testTemplateFileName(), MigratedAndLegacyModulesTest\testTheModuleLoadedLastWinsAlsoAcrossMigratedAndLegacyModules(), MigratedLanguageFileSyncReadersTest\testTheShippedPoCacheNeverGrowsBeyondItsConfiguredLimit(), UninstallRemovesPluginMigratedMoFilesTest\testUninstallDoesNotTouchAnotherModulesOverlay(), UninstallRemovesPluginMigratedMoFilesTest\testUninstallRemovesBothOverlayFilesForEveryLanguageThePluginShipsButLeavesTheShippedPoUntouched(), ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\text(), ilLanguage\txt(), ILIAS\Language\Activities\RepositoryProvider\updateModuleCache(), ilObjLanguageExt\updateRemark(), ILIAS\LegalDocuments\ConsumerToolbox\Blocks\userManagementAgreeDateField(), ilObjLanguageExt\withModuleLock(), ilObjLanguageExt\withoutUnreadableModules(), ILIAS\Language\ComponentTranslation\TranslationGettextRepository\withOverlay(), LanguageInstallationManagerTest\writeLangFile(), ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\writeOverlay(), MigratedPoFixture\writeOverlayRevision(), ILIAS\Language\ComponentTranslation\MigratedLanguageFileSync\writeRevision(), and ShippedLanguageFilesCompiledObjectiveTest\writeShippedPo().
| $module_lines |
Definition at line 176 of file convert_module_to_po.php.
| if (! $remove_from_lang) $new_lang_contents = [] |
Definition at line 1091 of file convert_module_to_po.php.
| $output_dir = isset($arguments[2]) ? rtrim($arguments[2], '/') : (__DIR__ . '/output/' . $module) |
Definition at line 649 of file convert_module_to_po.php.
| foreach($per_language as $lang_key=> $entries) foreach ( $markup_messages as $message=> $lines) $own_entry_counts = array_map('count', $per_language) |
Definition at line 859 of file convert_module_to_po.php.
| $parse_module |
Definition at line 210 of file convert_module_to_po.php.
| if (preg_match('/\A[A-Za-z0-9_]+\z/', $module) !==1||preg_match('/\A[A-Za-z0-9_]+\z/', $reference_lang_key) !==1) $pattern = null |
Definition at line 558 of file convert_module_to_po.php.
Referenced by ILIAS\Filesystem\Finder\Finder\addVCSPattern(), ILIAS\KeyValueStorage\Subject\SubjectId\assertIdentifier(), ILIAS\Language\ComponentTranslation\MigratedLanguageFilePaths\assertValidShippedFileNamePattern(), ILIAS\components\DataCollection\Fields\Formula\FormulaParser\Result\MathResultResolver\calculateFunctions(), ilAssLacCompositeValidator\checkOperatorExistForExpression(), ILIAS\Language\ComponentTranslation\ShippedTranslationsBuildTest\directoryWithPattern(), MigratedLanguageFilePathsTest\directoryWithPattern(), ShippedLanguageFilesCompiledObjectiveTest\directoryWithPattern(), ilShibbolethRoleAssignmentRule\doesMatch(), ILIAS\Notifications\ilNotificationDatabaseHandler\fillPlaceholders(), ilDidacticTemplateAction\filterRoles(), HTML_Template_IT\findBlocks(), ILIAS\Notifications\ilNotificationDatabaseHandler\findPlaceholders(), ILIAS\Language\ComponentTranslation\ShippedTranslationsBuild\findShippedFiles(), ILIAS\Language\ComponentTranslation\MigratedLanguageFilePaths\findShippedPoFiles(), ilECSUpdateSteps9\fix_duplicate_import_types(), ilAuthModeDetermination\getAuthModeSequence(), ilHTLMMigration\getFileNameCallback(), ilMobMigration\getFileNameCallback(), ILIAS\Export\ImportHandler\File\XML\Export\Handler\getILIASPath(), ILIAS\Export\ImportHandler\File\Handler\getPathPart(), ILIAS\UI\Implementation\Component\Symbol\Icon\Renderer\getStandardIconPath(), iso8601_to_timestamp(), ILIAS\Refinery\String\MakeClickable\match(), ilObjLanguageExt\matchesLikePattern(), ilDBPdoMySQLFieldDefinition\matchPattern(), ilDidacticTemplateImport\parseBlockRoleAction(), ilDidacticTemplateImport\parseLocalPolicyAction(), ILIAS\Language\ComponentTranslation\MigratedLanguageFilePaths\shippedFileNamePattern(), ilBookingManagerBookingInfoMigration\step(), ilBookingManagerObjectInfoMigration\step(), ilExercisePeerFeedbackMigration\step(), ilExerciseSampleSolutionMigration\step(), ILIAS\Language\ComponentTranslation\MigratedLanguageFilePaths\templateFileName(), MigratedLanguageFilePathsTest\testAssertValidShippedFileNamePatternAcceptsValidPatterns(), MigratedLanguageFilePathsTest\testAssertValidShippedFileNamePatternRejectsInvalidPatterns(), AdminGuiReadsValuesFromMigratedFileTest\testConsecutivePercentSignsMatchLikeASinglePercentSign(), ShippedPoModulesConsistencyTest\testModuleShipsPotAndEnglishPo(), MigratedLanguageFilePathsTest\testTemplateFileName(), AdminGuiReadsValuesFromMigratedFileTest\testThePatternFilterOfAMigratedModuleFollowsSqlLikeSemantics(), timestamp_to_iso8601(), ILIAS\components\DataCollection\Fields\Formula\FormulaParser\Token\Tokenizer\tokenizeMath(), CapabilityTest\updateREADME(), ilAssLacCompositeValidator\validateSubTree(), ilShibbolethRoleAssignmentRule\wildcardCompare(), and ilLDAPRoleAssignmentRule\wildcardCompare().
| if ( $lang_files===[]) $per_language = [] |
Definition at line 659 of file convert_module_to_po.php.
| $plural_config = ['plural_forms' => [], 'modules' => []] |
Definition at line 624 of file convert_module_to_po.php.
| if ( $remove_from_lang) $plural_config_file = __DIR__ . '/plurals.json' |
Definition at line 623 of file convert_module_to_po.php.
| foreacharray< string, array{singular?:string, plural_id?:string}> $plural_definitions |
Definition at line 645 of file convert_module_to_po.php.
| $plural_forms_of |
| array<string,array{value | string, comment: ?string}> $entries |
| array{singular? | string, plural_id?: string} $definition |
| array<string,true> | $filled_keys |
Definition at line 349 of file convert_module_to_po.php.
| foreach ( $per_language as $lang_key=> $entries) $plural_problems = [] |
Definition at line 874 of file convert_module_to_po.php.
| $plural_rules = [] |
Definition at line 635 of file convert_module_to_po.php.
| $pot_headers = $existing_headers($pot_path) |
Definition at line 930 of file convert_module_to_po.php.
| if(is_file( $english_lang_file)) if($language_names===[]) foreach (array_keys( $per_language) as $lang_key) $pot_path = $output_dir . '/' . MigratedLanguageFilePaths::templateFileName($pattern, $module) |
Definition at line 927 of file convert_module_to_po.php.
| $printable |
Makes control characters (e.g.
the ESC of a terminal escape sequence) visible in everything printed from a .lang file or the command line.
Definition at line 104 of file convert_module_to_po.php.
| $read_file |
Read once, so the lines and the hash checked by –remove-from-lang come from the same bytes.
Definition at line 111 of file convert_module_to_po.php.
| $read_files = [] |
Definition at line 661 of file convert_module_to_po.php.
Referenced by ilComponentDefinitionReaderTest\setUp().
| $read_lines |
| string | $content | of the .lang file $file (only named in warnings) |
Definition at line 150 of file convert_module_to_po.php.
| foreach( $per_language as $lang_key=> $entries) if($unmigratable_keys !==[] &&! $skip_unmigratable_keys) if ( $unmigratable_keys !==[]) $reference_entries = $per_language[$reference_lang_key] |
Definition at line 819 of file convert_module_to_po.php.
| foreach($per_language as $lang_key=> $entries) if( $invalid_encoding !==[]) if(array_sum(array_column($read_files, 'lines'))===0) if (!isset( $per_language[ $reference_lang_key])) $reference_keys = array_map('strval', array_keys($per_language[$reference_lang_key])) |
Definition at line 753 of file convert_module_to_po.php.
| $reference_lang_key = $arguments[1] ?? 'en' |
Definition at line 598 of file convert_module_to_po.php.
| $removal_problems = [] |
Definition at line 663 of file convert_module_to_po.php.
| $removal_target_problem |
Why $output_argument is no place –remove-from-lang may rely on, or null: it must be the existing components/<Vendor>/<Component>/lang whose component class contributes a ComponentLanguageFileDirectory for $module there with the file name pattern $pattern - otherwise the installation would not find the .po files and the module would lose its values.
A text check without bootstrap: only ‘new ComponentLanguageFileDirectory($this, ’<module>'[, '<path>'[, '<pattern>']]) with string literals as positional arguments in an assignment to$contribute[LanguageFileDirectory::class]` is recognised (comments ignored); any other form is refused.
Definition at line 479 of file convert_module_to_po.php.
| $remove_from_lang = false |
Definition at line 560 of file convert_module_to_po.php.
| $removed_total = 0 |
Definition at line 1110 of file convert_module_to_po.php.
| catch (InvalidArgumentException $e) $repo_root = dirname(__DIR__, 5) |
Definition at line 612 of file convert_module_to_po.php.
| $report = [] |
Definition at line 929 of file convert_module_to_po.php.
Referenced by ilTestRandomQuestionSetConfigStateMessageHandler\buildLostPoolsReportMessage(), ilObjCmiXapiGUI\debug(), ilXapiStatementEvaluation\evaluateReport(), ilObjSCORM2004LearningModuleGUI\exportTrackingItems(), ilObjSCORMLearningModuleGUI\exportTrackingItems(), ilObjCmiXapiGUI\fetchXapiStatements(), ilTestRandomQuestionsSrcPoolDefinitionQuantitiesCalculation\getDistributionReport(), ilExerciseManagementGUI\getReportPanel(), ilSCORM2004TrackingItemsPerScoFilterGUI\parse(), ilSCORMTrackingItemsPerScoFilterGUI\parse(), ilSCORM2004TrackingItemsPerUserFilterGUI\parse(), ilSCORMTrackingItemsPerUserFilterGUI\parse(), ilObjSCORM2004LearningModuleGUI\readTrackingReport(), ilObjSCORMLearningModuleGUI\readTrackingReport(), ILIAS\Tests\Setup\CLI\StatusCommandTest\reporting(), ilXapiResultsCronjob\run(), ilLTIObjectRankingGUI\show(), ilObjSCORM2004LearningModuleGUI\showTrackingItems(), ilObjSCORMLearningModuleGUI\showTrackingItems(), ilObjSCORM2004LearningModuleGUI\showTrackingItemsBySco(), ilObjSCORMLearningModuleGUI\showTrackingItemsBySco(), ilObjServerInfoGUI\status(), ReportErrorIncidentTest\testDoesNothingWhenLogDirectoryIsEmpty(), ilKSDocumentationEntryGUITest\testRenderEntry(), PanelTest\testRenderReport(), and ReportErrorIncidentTest\testWritesLogFileAndRecordsIncident().
| $singular_form_index |
The form that serves n = 1 if it serves no other n, else null.
Found by evaluating the rule (not its formula text): form 0 in en, de, es, it, cs, pl; form 1 in ar; null where that form also serves 0 (fr, pt), 21, 101 (ru, hr, sl) and in single-form languages.
Definition at line 298 of file convert_module_to_po.php.
| $singular_form_of |
The form of the plural message $key that gets the singular key's value, or null: only if the singular key is translated (not empty, not from the reference language, no "new variable" marker) and the rule has a form for n = 1 alone.
Else every form keeps the own value: an untranslated placeholder must not replace a translated form.
| array<string,array{value | string, comment: ?string}> $entries the language's entries of the module |
| array{singular? | string, plural_id?: string} $definition |
| array<string,true> | $filled_keys keys whose value was taken from the reference language |
Definition at line 320 of file convert_module_to_po.php.
| $skip_unmigratable_keys = false |
Definition at line 559 of file convert_module_to_po.php.
| $source_lang_keys = array_values(array_unique([$reference_lang_key, 'de', 'en'])) |
Definition at line 822 of file convert_module_to_po.php.
| foreach( $duplicates as $lang_key=> $keys) if($duplicate_report !==[]) if ( $identical_duplicate_report !==[]) $unmigratable_keys = [] |
Definition at line 788 of file convert_module_to_po.php.
| $unsafe_files = [] |
Definition at line 666 of file convert_module_to_po.php.
| foreach (array_slice( $argv, 1) as $argument) $usage |
Definition at line 581 of file convert_module_to_po.php.
Referenced by ILIAS\MediaObjects\OverviewGUI\Table\Retrieval\addExternalData(), ILIAS\MediaObjects\OverviewGUI\Table\Builder\buildLinkListingFromData(), ILIAS\MediaObjects\Usage\UsageRetrieval\buildRow(), ILIAS\MediaPool\PageUsage\Retrieval\buildRow(), ILIAS\MediaObjects\Usage\UsageRetrieval\buildVersions(), ILIAS\MediaPool\PageUsage\Retrieval\buildVersions(), ilMobStakeholder\canBeAccessedByCurrentUser(), ilObjMediaObjectAccess\checkAccessMob(), ilMobStakeholder\checkAccessMobUsage(), ILIAS\MediaObjects\Usage\UsageRetrieval\collectData(), ILIAS\MediaPool\PageUsage\Retrieval\collectData(), ilObjSkillTreeGUI\deleteNodes(), ILIAS\components\ILIAS\Glossary\Table\TermUsagesTable\getDataRetrieval(), ILIAS\Glossary\Taxonomy\TaxonomyManager\getTaxonomyId(), ILIAS\Skill\Service\SkillUIService\getUsagesUI(), ilTaxonomyDataSet\importRecord(), ILIAS\Glossary\Taxonomy\TaxonomyManager\showInEditing(), ilBasicSkillTemplateGUI\showUsage(), ilSkillTemplateCategoryGUI\showUsage(), ilSkillTreeNodeGUI\showUsage(), ILIAS\LearningModule\Editing\PagesTableBuilder\transformRow(), and ilLMObject\updateInternalLinks().
| $without_module_lines |
$content without the lines of $module - exactly those $read_lines reports, and only behind the line "<!-- language file start -->" (the installer ignores everything before it; only called for files with that line).
Every other byte stays: header, comments, line endings, order, a missing final line break.
Definition at line 254 of file convert_module_to_po.php.
| $write |
Definition at line 547 of file convert_module_to_po.php.
Referenced by ILIAS\Style\Content\Access\StyleAccessManager\enableWrite().
| if(! $all_ok) if (!is_dir( $output_dir) &&! @mkdir( $output_dir, 0775, true) &&!is_dir( $output_dir)) $written = [] |
Definition at line 1072 of file convert_module_to_po.php.
Referenced by ilObjLanguageExt\_deleteValues(), LanguageInstallationManagerMigratedModulesTestCase\applyLngDataDelete(), ilIniFileTest\testAssignedGroupsAreWritten(), ILIAS\Language\Tests\ComponentTranslation\Catalog\TranslationCatalogMoTest\testFromMoStringLosesEmptyAndZeroPluralForms(), ilIniFileTest\testGroupsAndVariablesRemovedFromGroupsAreNotWritten(), ConvertModuleToPoToolTest\testRemoveFromLangAcceptsAContributionInEveryNotationOfTheComponentClass(), ILIAS\Language\Tests\Activities\LanguageSettingsLegacyProxyTest\testSettingsAreWrittenAsOneAndZeroUnderTheirKeys(), ILIAS\Tests\FileDelivery\Setup\AgentTest\testUpdateWithoutConfigAndArtefactStaysDeactivated(), ILIAS\Tests\FileDelivery\Setup\AgentTest\testUpdateWithoutConfigKeepsCurrentSettings(), ILIAS\Tests\FileDelivery\Setup\AgentTest\testUpdateWithoutSectionKeepsCurrentSettings(), ILIAS\Tests\FileDelivery\Setup\AgentTest\testUpdateWithSectionOverridesCurrentSettings(), ILIAS\Language\Activities\RepositoryProvider\updateModuleCache(), and ILIAS\Language\ComponentTranslation\AtomicFileWriter\writeContent().
| if (is_file( $plural_config_file)) else |
Definition at line 632 of file convert_module_to_po.php.
| foreach($new_lang_contents as $lang_key=>[$new_content, $removed]) | ( | $new_lang_contents as | ) |
Definition at line 1111 of file convert_module_to_po.php.
| foreach($contents as $path=> $content) | ( | $report as | ) |
Definition at line 1054 of file convert_module_to_po.php.
Referenced by ilObjGroupGUI\addCustomData(), ilObjLearningSequenceGUI\addCustomData(), ilCourseParticipantsTableGUI\parse(), ilGroupParticipantsTableGUI\parse(), ilLearningSequenceParticipantsTableGUI\parse(), ilDidacticTemplateImport\parseSettings(), ilSubscriberTableGUI\readSubscriberData(), ilWaitingListTableGUI\readUserData(), and ILIAS\ResourceStorage\Resource\ResourceBuilder\store().
| foreach($read_files as $lang_key=> $read) if($changed_files !==[]) | ( | $changed_files ! = = [] | ) |
Definition at line 1103 of file convert_module_to_po.php.
| if(PHP_SAPI !=='cli') | ( | PHP_SAPI ! | = = 'cli' | ) |
Pilot conversion tool for the PO/MO migration.
Reads the legacy lang/ilias_<lang>.lang files of one language module and writes, via the language component's TranslationCatalog adapter (so the tool writes exactly what the runtime reads):
The entries have no msgctxt: a file belongs to one module (the directory's prefix) and stays valid when the module is renamed (e.g. a plugin that becomes a component). The runtime still reads files with the module as msgctxt.
No .mo file is written: the .po files are the shipped source of truth and are compiled by Setup's build (ShippedTranslationsBuild) into artifacts/language/. The per-installation overlay only holds local changes.
Headers of an existing target .po are kept, so a re-run only changes what the .lang files changed. The "Plural-Forms" header comes from plurals.json next to this tool. "Language-Team" is the English language name from meta_l_<lang> of lang/ilias_en.lang, or, once "meta" is migrated, of a shipped components/<Vendor>/<Component>/lang/meta_en.po (default file name pattern only).
The reference language (default "en") gives the msgids, their order and the .pot. A reference key that a language lacks or has empty gets the reference value, flagged "fuzzy" (fuzzy entries are shipped like all others). A key only other languages have cannot be taken over (see –skip-unmigratable-keys). A value with markup the build cleans (TranslationMarkupPolicy) is kept (WARNING), unless cleaning leaves nothing: then it counts as missing. The reference language's "###" note becomes "#.", another own note a translator comment "# " (msgmerge keeps it).
Plural messages (plurals.json, "modules"): the tool invents no text, it distributes existing values (one taken from the reference language counts). Where the rule has a form for n = 1 alone (found by evaluating the rule: form 0 in en, de, es, it, cs, pl; form 1 in ar), that form gets the configured singular key's value - only if the language translated it (not empty, not from the reference language, no "new variable" marker) - and every other form the message's own value; otherwise every form is the own value. The msgid_plural is "<msgid>_plural" unless configured. The fuzzy flag follows the own value, and is also set where the own value was copied into several forms - except in the source languages (reference language, de, en). The singular key stays an entry of its own.
Deliberately declares no named classes or functions: this file lives inside the classmap-scanned components/ tree, and anything named here would end up in Composer's classmap and Setup's class discovery. Everything is a closure.
Usage: php convert_module_to_po.php [–pattern=<pattern>] [–skip-unmigratable-keys] [–remove-from-lang] <module> [referenceLangKey (default "en")] [outputDir] –pattern file name of a language without ".po", "%s" = language key (default "<module>_%s"); must match the pattern of the module's ComponentLanguageFileDirectory –skip-unmigratable-keys instead of failing: leave out (WARNING on stderr) every key the reference language does not have, the empty key and every key containing " [" (plural form syntax "<key> [<form>]"), and use one occurrence of a key that occurs more than once with the same value and comment every time, as the installer reads them (other duplicates of a left out key only warn, all others fail); left out keys are not part of the round-trip check –remove-from-lang only after a completely successful run (every file written and round-tripped): remove every line of the module - the left out ones included - from every lang/ilias_<lang>.lang read (atomically per file, all other bytes unchanged; computed and checked before anything is written). Requires (checked first) an existing outputDir components/<Vendor>/<Component>/lang whose <Component>.php already contributes the module's ComponentLanguageFileDirectory, no symbolic link in lang/ and the start marker in every lang/ilias_<lang>.lang <module> is required. Unknown options (anything starting with "-") and a fourth argument fail; module and reference language must match [A-Za-z0-9_]+; a given outputDir must exist. An existing unreadable target .po/.pot is replaced without its headers (WARNING). Like the installer, a .lang file is only read behind its line "<!-- language file start -->"; a file without that line is skipped with a WARNING (a FAILURE with –remove-from-lang). A module without any line in lang/ fails without writing anything (most likely migrated already). Every check runs before anything is written: a failing run writes no .po/.pot and changes no .lang file (except on write errors or a .lang file changed during the run, both reported). The self-check reads every .po back and compiles it. Example: php convert_module_to_po.php tos en ../../../TermsOfService/lang
Definition at line 84 of file convert_module_to_po.php.
| try |
Definition at line 605 of file convert_module_to_po.php.