|
ILIAS
trunk Revision v13.0_alpha-62-g3b72d83f2e5
|
The process state native gettext (PHP extension "gettext") needs to serve the compiled catalogs of the migrated modules, and the one place that calls it. More...
Collaboration diagram for ILIAS\Language\ComponentTranslation\NativeGettext:Static Public Member Functions | |
| static | isExtensionLoaded () |
| static | isThreadSafe () |
| Whether PHP is thread-safe (ZTS): the settings of activate() then apply to every thread and are not taken back. More... | |
| static | useThreadSafeForTests (?bool $thread_safe) |
Makes isThreadSafe() return $thread_safe (null: PHP_ZTS again) - for tests only. More... | |
| static | usesSystemLocale () |
| macOS/BSD: activate() uses a SYSTEM_LOCALES entry, their C library ignores LOCPATH. More... | |
| static | useSystemLocaleForTests (?bool $system_locale) |
Makes usesSystemLocale() return $system_locale (null: by PHP_OS_FAMILY again) - for tests only. More... | |
| static | activate (string $locale_directory) |
| Sets LANGUAGE and, if LC_MESSAGES holds no real locale, the locale LOCALE_NAME of $locale_directory (or, see usesSystemLocale(), a system locale) for it; if it fails, getProblem() tells why. More... | |
| static | isActive () |
| Whether activate() succeeded and its settings are still in place (other code, e.g. More... | |
| static | reactivateIfLost () |
| Activates the locale again if it was activated before and the settings changed since. More... | |
| static | restore () |
| Takes LANGUAGE, LC_MESSAGES (if activate() set it) and LC_ALL back to the state before the first activate(); settings changed by other code since stay. More... | |
| static | getProblem () |
| static | bind (string $domain, string $directory) |
| Binds $domain to $directory with the codeset UTF-8. More... | |
| static | isLoaded (string $domain) |
| Whether the catalog of the bound $domain is readable: its header (the translation of the empty message id) is not empty. More... | |
| static | translate (string $domain, string $message_id) |
| The translation of $message_id in $domain, or $message_id itself if there is none (as the C library answers), also for an empty or too long $message_id. More... | |
| static | translatePlural (string $domain, string $message_id, int $n) |
| The form of the plural message $message_id the "Plural-Forms" rule of the catalog selects for $n (a negative $n counts as its absolute value), or $message_id itself if there is none. More... | |
| static | resetForTests () |
| Forgets the activation (without taking the settings back) - for tests only. More... | |
Data Fields | |
| const string | LOCALE_NAME = 'ilias_messages' |
| const array | SYSTEM_LOCALES = ['en_US.UTF-8', 'en_US.utf8'] |
| LC_MESSAGES candidates where the system locale is used, see usesSystemLocale(). More... | |
| const string | CATALOG_LANGUAGE = 'messages' |
| The value of LANGUAGE: the directory below a bound directory the catalogs are looked up in. More... | |
| const string | CATALOG_DIRECTORY = self::CATALOG_LANGUAGE . '/LC_MESSAGES' |
Static Private Member Functions | |
| static | activateSystemLocale (string $locale_directory) |
| static | keptLocale () |
| A real LC_MESSAGES locale stays, so ICU & Co. More... | |
| static | processState () |
| static | activated (string $locale_directory, string $locale, bool $messages_set) |
| static | canLookUp (string $message_id) |
Private Attributes | |
| const array | SYSTEM_LOCALE_OS_FAMILIES = ['Darwin', 'BSD'] |
| const string | CODESET = 'UTF-8' |
| const int | MAX_MESSAGE_LENGTH = 4096 |
| Longer message ids are refused by PHP (ValueError), so they are never found. More... | |
Static Private Attributes | |
| static string | $locale_directory = null |
| static string | $active_locale = null |
| What setlocale() returned in the last successful activate(). More... | |
| static array | $previous = null |
| static bool | $thread_safe_for_tests = null |
| static bool | $system_locale_for_tests = null |
| static string | $problem = null |
| static bool | $messages_set = false |
The process state native gettext (PHP extension "gettext") needs to serve the compiled catalogs of the migrated modules, and the one place that calls it.
Native gettext only translates while LC_MESSAGES is not "C"/"POSIX" and finds a catalog as <bound directory>/<language>/LC_MESSAGES/<domain>.mo. ILIAS does not depend on the locale's language, so a real locale in LC_MESSAGES (e.g. of ilInitialisation::initLocale()) stays. Only for "C"/"POSIX"/"C.<codeset>":
Both settings are process-wide. PHP takes them back at the end of every request (putenv() variables, setlocale() reset to "C"), so no shutdown function is needed (it would stop later shutdown functions from translating). In a thread-safe (ZTS) PHP the end of another thread's request can take them back mid-request: isActive() checks, reactivateIfLost() activates again (the administration shows a hint, see isThreadSafe()). Child processes inherit LANGUAGE=messages, which is harmless, and on macOS/BSD LC_ALL=<active locale> (a kept one too, e.g. the locale of the administration), which overrides the locale of the environment for them.
The C library never reloads a catalog file it has read once (also not a replaced one), so every new state (a build, an overlay revision) gets a directory of its own, and binding the domain loads it.
Definition at line 52 of file NativeGettext.php.
|
static |
Sets LANGUAGE and, if LC_MESSAGES holds no real locale, the locale LOCALE_NAME of $locale_directory (or, see usesSystemLocale(), a system locale) for it; if it fails, getProblem() tells why.
Definition at line 136 of file NativeGettext.php.
References ILIAS\Language\ComponentTranslation\NativeGettext\$locale_directory, ILIAS\Language\ComponentTranslation\NativeGettext\activated(), ILIAS\Language\ComponentTranslation\NativeGettext\activateSystemLocale(), ILIAS\Language\ComponentTranslation\NativeGettext\keptLocale(), and ILIAS\Language\ComponentTranslation\NativeGettext\processState().
Referenced by ILIAS\Language\ComponentTranslation\NativeGettextTest\activateBuild(), ILIAS\Language\ComponentTranslation\NativeGettextTest\activateSystemLocale(), ILIAS\Language\ComponentTranslation\NativeGettext\reactivateIfLost(), ILIAS\Language\ComponentTranslation\TranslationGettextRepository\state(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testActivateFailsWithAProblemAndLeavesTheProcessAsItWas(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testActivateStillFailsWithoutLocaleDirectoryWhenARealLocaleStays(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testRestoreAfterARepeatedActivationGivesBackLcAllFromBeforeTheFirstOne(), and ILIAS\Language\ComponentTranslation\NativeGettextTest\testSystemLocaleBranchTranslatesWithoutLocaleDirectoryAndLeavesLocpathAlone().
Here is the call graph for this function:
Here is the caller graph for this function:
|
staticprivate |
Definition at line 217 of file NativeGettext.php.
References ILIAS\Language\ComponentTranslation\NativeGettext\$locale_directory, and ILIAS\Language\ComponentTranslation\NativeGettext\$messages_set.
Referenced by ILIAS\Language\ComponentTranslation\NativeGettext\activate(), and ILIAS\Language\ComponentTranslation\NativeGettext\activateSystemLocale().
Here is the caller graph for this function:
|
staticprivate |
Definition at line 172 of file NativeGettext.php.
References ILIAS\Language\ComponentTranslation\NativeGettext\$locale_directory, ILIAS\Language\ComponentTranslation\NativeGettext\activated(), ILIAS\Language\ComponentTranslation\NativeGettext\keptLocale(), and ILIAS\Language\ComponentTranslation\NativeGettext\processState().
Referenced by ILIAS\Language\ComponentTranslation\NativeGettext\activate().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Binds $domain to $directory with the codeset UTF-8.
false if the extension is missing or $directory does not exist Definition at line 288 of file NativeGettext.php.
References ILIAS\Language\ComponentTranslation\NativeGettext\isExtensionLoaded().
Referenced by ILIAS\Language\ComponentTranslation\NativeGettextTest\activateBuild(), ILIAS\Language\ComponentTranslation\NativeGettextTest\activateSystemLocale(), ILIAS\Language\ComponentTranslation\TranslationGettextRepository\state(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testBindRefusesADirectoryThatDoesNotExist(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testIsLoadedTellsAReadableCatalogOfOurOwnByItsHeader(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testSystemLocaleBranchTranslatesWithoutLocaleDirectoryAndLeavesLocpathAlone(), and ILIAS\Language\ComponentTranslation\TranslationGettextRepository\withOverlay().
Here is the call graph for this function:
Here is the caller graph for this function:
|
staticprivate |
Definition at line 331 of file NativeGettext.php.
References ILIAS\Language\ComponentTranslation\NativeGettext\isExtensionLoaded().
Here is the call graph for this function:
|
static |
Definition at line 278 of file NativeGettext.php.
References ILIAS\Language\ComponentTranslation\NativeGettext\$problem.
Referenced by ILIAS\Language\ComponentTranslation\NativeGettextTest\activateBuild(), ILIAS\Language\ComponentTranslation\NativeGettextTest\activateSystemLocale(), ILIAS\Language\ComponentTranslation\TranslationGettextRepository\reportLostActivation(), ILIAS\Language\ComponentTranslation\TranslationGettextRepository\state(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testActivateFailsWithAProblemAndLeavesTheProcessAsItWas(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testActivateStillFailsWithoutLocaleDirectoryWhenARealLocaleStays(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testReactivateIfLostFailsWithAProblemWhenTheLocaleIsGone(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testRestoreAfterARepeatedActivationGivesBackLcAllFromBeforeTheFirstOne(), and ILIAS\Language\ComponentTranslation\NativeGettextTest\testSystemLocaleBranchTranslatesWithoutLocaleDirectoryAndLeavesLocpathAlone().
Here is the caller graph for this function:
|
static |
Whether activate() succeeded and its settings are still in place (other code, e.g.
ilInitialisation::initLocale() with setlocale(LC_ALL, …), may have changed LC_MESSAGES since).
Definition at line 232 of file NativeGettext.php.
References ILIAS\Language\ComponentTranslation\NativeGettext\$active_locale, and ILIAS\Language\ComponentTranslation\NativeGettext\usesSystemLocale().
Referenced by ILIAS\Language\ComponentTranslation\TranslationGettextRepository\getPluralText(), ILIAS\Language\ComponentTranslation\TranslationGettextRepository\lookup(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testActivateFailsWithAProblemAndLeavesTheProcessAsItWas(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testActivateKeepsARealLocaleAndRestoreLeavesItWhileTakingLanguageBack(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testActivateServesTheBuildAndRestoreGivesTheProcessStateBack(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testActivateStillFailsWithoutLocaleDirectoryWhenARealLocaleStays(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testAfterRestoreReactivateIfLostActivatesTheLocaleAgain(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testGlibcBranchNeverTouchesLcAll(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testReactivateIfLostFailsWithAProblemWhenTheLocaleIsGone(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testReactivateIfLostKeepsALocaleOtherCodeSetForEverything(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testReactivateIfLostRepairsAForeignResetInAThreadSafePhpToo(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testReactivateIfLostRepairsWhatOtherCodeChanged(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testReactivateIfLostRepairsWhatOtherCodeChangedInTheSystemLocaleBranch(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testRestoreChangesNothingInAThreadSafePhp(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testRestoreChangesNothingInAThreadSafePhpInTheSystemLocaleBranch(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testSystemLocaleBranchKeepsARealLocaleSetsLcAllToItAndRestoreGivesLcAllBack(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testSystemLocaleBranchSetsLcAllToTheActiveLocaleAndRestoreGivesItBackExactly(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testSystemLocaleBranchTranslatesWithoutLocaleDirectoryAndLeavesLocpathAlone(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testSystemLocaleIsOnlyActiveAfterActivateAndRestoreGivesTheProcessStateBack(), and ILIAS\Language\ComponentTranslation\NativeGettextTest\testTheOwnLocaleIsNeverTakenForARealOneAfterLanguageWasLost().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 92 of file NativeGettext.php.
Referenced by ILIAS\Language\ComponentTranslation\NativeGettext\bind(), ILIAS\Language\ComponentTranslation\NativeGettext\canLookUp(), ILIAS\Language\ComponentTranslation\NativeGettext\isLoaded(), and ILIAS\Language\ComponentTranslation\TranslationGettextRepository\state().
Here is the caller graph for this function:
|
static |
Whether the catalog of the bound $domain is readable: its header (the translation of the empty message id) is not empty.
Definition at line 299 of file NativeGettext.php.
References ILIAS\Language\ComponentTranslation\NativeGettext\isExtensionLoaded().
Referenced by ILIAS\Language\ComponentTranslation\TranslationGettextRepository\state(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testIsLoadedTellsAReadableCatalogOfOurOwnByItsHeader(), and ILIAS\Language\ComponentTranslation\TranslationGettextRepository\withOverlay().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Whether PHP is thread-safe (ZTS): the settings of activate() then apply to every thread and are not taken back.
Definition at line 101 of file NativeGettext.php.
Referenced by ILIAS\Language\ComponentTranslation\NativeGettextTest\testRestoreChangesNothingInAThreadSafePhp().
Here is the caller graph for this function:
|
staticprivate |
A real LC_MESSAGES locale stays, so ICU & Co.
keep seeing it (e.g. the one of ilInitialisation::initLocale()).
Definition at line 192 of file NativeGettext.php.
Referenced by ILIAS\Language\ComponentTranslation\NativeGettext\activate(), and ILIAS\Language\ComponentTranslation\NativeGettext\activateSystemLocale().
Here is the caller graph for this function:
|
staticprivate |
Definition at line 212 of file NativeGettext.php.
Referenced by ILIAS\Language\ComponentTranslation\NativeGettext\activate(), and ILIAS\Language\ComponentTranslation\NativeGettext\activateSystemLocale().
Here is the caller graph for this function:
|
static |
Activates the locale again if it was activated before and the settings changed since.
Definition at line 246 of file NativeGettext.php.
References ILIAS\Language\ComponentTranslation\NativeGettext\activate().
Referenced by ILIAS\Language\ComponentTranslation\TranslationGettextRepository\getPluralText(), ILIAS\Language\ComponentTranslation\TranslationGettextRepository\lookup(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testAfterRestoreReactivateIfLostActivatesTheLocaleAgain(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testReactivateIfLostDoesNothingWithoutAnActivationOrWhileActive(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testReactivateIfLostFailsWithAProblemWhenTheLocaleIsGone(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testReactivateIfLostKeepsALocaleOtherCodeSetForEverything(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testReactivateIfLostRepairsAForeignResetInAThreadSafePhpToo(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testReactivateIfLostRepairsWhatOtherCodeChanged(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testReactivateIfLostRepairsWhatOtherCodeChangedInTheSystemLocaleBranch(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testRestoreAfterARepeatedActivationGivesBackLcAllFromBeforeTheFirstOne(), and ILIAS\Language\ComponentTranslation\NativeGettextTest\testTheOwnLocaleIsNeverTakenForARealOneAfterLanguageWasLost().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Forgets the activation (without taking the settings back) - for tests only.
Definition at line 341 of file NativeGettext.php.
References ILIAS\Language\ComponentTranslation\NativeGettext\restore().
Referenced by ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\buildKind(), ILIAS\Language\ComponentTranslation\ShippedTranslationsBuildTest\buildWithSystemLocale(), ILIAS\Language\ComponentTranslation\NativeGettextTest\tearDown(), ILIAS\Language\ComponentTranslation\ShippedTranslationsBuildTest\testABuildNativeGettextCannotServeLeavesCurrentAndThePreviousBuildAsTheyAreAndNoRemnants(), ILIAS\Language\ComponentTranslation\ShippedTranslationsBuildTest\testABuildRemovesLeftoversOfItsOwnLocaleKindOnly(), ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testASystemLocaleBuildOnAnotherPlatformServesNothingAndTheProblemNamesTheCause(), ILIAS\Language\ComponentTranslation\ShippedTranslationsBuildTest\testBuildsOfTheOtherLocaleKindAndTheirPointerSurviveTheCleanup(), ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testEachLocaleKindServesTheBuildOfItsOwnPointer(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testReactivateIfLostDoesNothingWithoutAnActivationOrWhileActive(), ILIAS\Language\ComponentTranslation\ShippedTranslationsBuildTest\testSystemLocaleBuildShipsNoLocaleIsReusedAndDiffersFromTheGlibcBuild(), and ILIAS\Language\ComponentTranslation\ShippedTranslationsBuildTest\useRealLocaleForMessages().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Takes LANGUAGE, LC_MESSAGES (if activate() set it) and LC_ALL back to the state before the first activate(); settings changed by other code since stay.
Only for long-running processes (e.g. Setup's build after its check), a web request needs no call. No-op in a thread-safe PHP, where other threads may use them. The activated directory is kept, so reactivateIfLost() can activate it again.
Definition at line 261 of file NativeGettext.php.
Referenced by ILIAS\Language\Setup\ShippedLanguageFilesCompiledObjective\achieve(), ILIAS\Language\ComponentTranslation\NativeGettext\resetForTests(), ILIAS\Language\ComponentTranslation\NativeGettextTest\setUp(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testActivateKeepsARealLocaleAndRestoreLeavesItWhileTakingLanguageBack(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testActivateServesTheBuildAndRestoreGivesTheProcessStateBack(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testAfterRestoreReactivateIfLostActivatesTheLocaleAgain(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testALocaleOfTheCFamilyIsNotRealSoTheOwnLocaleIsActivatedAndTakenBackAgain(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testGlibcBranchNeverTouchesLcAll(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testReactivateIfLostKeepsALocaleOtherCodeSetForEverything(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testReactivateIfLostRepairsAForeignResetInAThreadSafePhpToo(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testRestoreAfterARepeatedActivationGivesBackLcAllFromBeforeTheFirstOne(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testRestoreChangesNothingInAThreadSafePhp(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testRestoreChangesNothingInAThreadSafePhpInTheSystemLocaleBranch(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testRestoreLeavesALcAllOtherCodeChangedSinceAsItIsInTheSystemLocaleBranch(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testRestoreLeavesASettingOtherCodeChangedSinceAsItIs(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testRestoreWithoutActivationChangesNothing(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testSystemLocaleBranchKeepsARealLocaleSetsLcAllToItAndRestoreGivesLcAllBack(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testSystemLocaleBranchSetsLcAllToTheActiveLocaleAndRestoreGivesItBackExactly(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testSystemLocaleIsOnlyActiveAfterActivateAndRestoreGivesTheProcessStateBack(), and ILIAS\Language\ComponentTranslation\NativeGettextTest\testTheOwnLocaleIsNeverTakenForARealOneAfterLanguageWasLost().
Here is the caller graph for this function:
|
static |
The translation of $message_id in $domain, or $message_id itself if there is none (as the C library answers), also for an empty or too long $message_id.
Definition at line 308 of file NativeGettext.php.
Referenced by ILIAS\Language\ComponentTranslation\TranslationGettextRepository\lookup(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testActivateKeepsARealLocaleAndRestoreLeavesItWhileTakingLanguageBack(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testActivateServesTheBuildAndRestoreGivesTheProcessStateBack(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testAfterRestoreReactivateIfLostActivatesTheLocaleAgain(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testALocaleOfTheCFamilyIsNotRealSoTheOwnLocaleIsActivatedAndTakenBackAgain(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testReactivateIfLostKeepsALocaleOtherCodeSetForEverything(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testReactivateIfLostRepairsAForeignResetInAThreadSafePhpToo(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testReactivateIfLostRepairsWhatOtherCodeChanged(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testReactivateIfLostRepairsWhatOtherCodeChangedInTheSystemLocaleBranch(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testSystemLocaleBranchKeepsARealLocaleSetsLcAllToItAndRestoreGivesLcAllBack(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testSystemLocaleBranchSetsLcAllToTheActiveLocaleAndRestoreGivesItBackExactly(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testSystemLocaleBranchTranslatesWithoutLocaleDirectoryAndLeavesLocpathAlone(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testTheIcuDefaultLocaleStaysTheOneOfTheAdministrator(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testTheOwnLocaleIsNeverTakenForARealOneAfterLanguageWasLost(), and ILIAS\Language\ComponentTranslation\NativeGettextTest\testTranslateAnswersTheMessageIdItself().
Here is the caller graph for this function:
|
static |
The form of the plural message $message_id the "Plural-Forms" rule of the catalog selects for $n (a negative $n counts as its absolute value), or $message_id itself if there is none.
Definition at line 321 of file NativeGettext.php.
Referenced by ILIAS\Language\ComponentTranslation\TranslationGettextRepository\getPluralText(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testTranslateAnswersTheMessageIdItself(), and ILIAS\Language\ComponentTranslation\NativeGettextTest\testTranslatePluralSelectsTheFormOfTheAbsoluteQuantity().
Here is the caller graph for this function:
|
static |
macOS/BSD: activate() uses a SYSTEM_LOCALES entry, their C library ignores LOCPATH.
Definition at line 117 of file NativeGettext.php.
Referenced by ILIAS\Language\ComponentTranslation\MigratedLanguageFilePaths\buildPointerFile(), ILIAS\Language\ComponentTranslation\NativeGettext\isActive(), ILIAS\Language\ComponentTranslation\MigratedTranslations\missingBuildMessage(), ILIAS\Language\ComponentTranslation\MigratedTranslations\pointer(), ILIAS\Language\ComponentTranslation\ShippedTranslationsBuild\readPointer(), ILIAS\Language\ComponentTranslation\MigratedTranslations\reportNewerOtherBuild(), and ILIAS\Language\ComponentTranslation\ShippedTranslationsBuild\runLocked().
Here is the caller graph for this function:
|
static |
Makes usesSystemLocale() return $system_locale (null: by PHP_OS_FAMILY again) - for tests only.
Definition at line 127 of file NativeGettext.php.
Referenced by ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\buildKind(), ILIAS\Language\ComponentTranslation\ShippedTranslationsBuildTest\buildWithSystemLocale(), ILIAS\Language\ComponentTranslation\ShippedTranslationsBuildTest\testABuildNativeGettextCannotServeLeavesCurrentAndThePreviousBuildAsTheyAreAndNoRemnants(), ILIAS\Language\ComponentTranslation\ShippedTranslationsBuildTest\testABuildRemovesLeftoversOfItsOwnLocaleKindOnly(), ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testANewerBuildOfTheOtherLocaleKindIsHintedAtOnlyForOtherShippedFiles(), ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testASystemLocaleBuildOnAnotherPlatformServesNothingAndTheProblemNamesTheCause(), ILIAS\Language\ComponentTranslation\ShippedTranslationsBuildTest\testBuildsOfTheOtherLocaleKindAndTheirPointerSurviveTheCleanup(), ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testEachLocaleKindServesTheBuildOfItsOwnPointer(), ILIAS\Language\ComponentTranslation\ShippedTranslationsBuildTest\testMissingLocaleOfTheCLibraryAbortsBeforeAnythingIsWritten(), ILIAS\Language\ComponentTranslation\ShippedTranslationsBuildTest\testPlatformProblemTellsASystemLocaleBuildOnlyWhereTheShippedLocaleIsNeeded(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testReactivateIfLostKeepsALocaleOtherCodeSetForEverything(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testReactivateIfLostRepairsWhatOtherCodeChangedInTheSystemLocaleBranch(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testRestoreAfterARepeatedActivationGivesBackLcAllFromBeforeTheFirstOne(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testRestoreChangesNothingInAThreadSafePhpInTheSystemLocaleBranch(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testRestoreLeavesALcAllOtherCodeChangedSinceAsItIsInTheSystemLocaleBranch(), ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testSwitchingTheLocaleKindReadsTheOtherPointerWithoutAReset(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testSystemLocaleBranchKeepsARealLocaleSetsLcAllToItAndRestoreGivesLcAllBack(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testSystemLocaleBranchSetsLcAllToTheActiveLocaleAndRestoreGivesItBackExactly(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testSystemLocaleBranchTranslatesWithoutLocaleDirectoryAndLeavesLocpathAlone(), ILIAS\Language\ComponentTranslation\ShippedTranslationsBuildTest\testSystemLocaleBuildShipsNoLocaleIsReusedAndDiffersFromTheGlibcBuild(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testSystemLocaleIsOnlyActiveAfterActivateAndRestoreGivesTheProcessStateBack(), ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testWithoutAnOwnPointerTheMissingBuildIsFatalAndNamesTheBuildOfTheOtherKind(), and ILIAS\Language\ComponentTranslation\ShippedTranslationsBuildTest\useRealLocaleForMessages().
Here is the caller graph for this function:
|
static |
Makes isThreadSafe() return $thread_safe (null: PHP_ZTS again) - for tests only.
Definition at line 111 of file NativeGettext.php.
Referenced by ILIAS\Language\ComponentTranslation\NativeGettextTest\testReactivateIfLostRepairsAForeignResetInAThreadSafePhpToo(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testRestoreChangesNothingInAThreadSafePhp(), and ILIAS\Language\ComponentTranslation\NativeGettextTest\testRestoreChangesNothingInAThreadSafePhpInTheSystemLocaleBranch().
Here is the caller graph for this function:
|
staticprivate |
What setlocale() returned in the last successful activate().
Definition at line 74 of file NativeGettext.php.
Referenced by ILIAS\Language\ComponentTranslation\NativeGettext\isActive().
|
staticprivate |
Definition at line 71 of file NativeGettext.php.
Referenced by ILIAS\Language\ComponentTranslation\NativeGettext\activate(), ILIAS\Language\ComponentTranslation\NativeGettext\activated(), and ILIAS\Language\ComponentTranslation\NativeGettext\activateSystemLocale().
|
staticprivate |
Definition at line 90 of file NativeGettext.php.
Referenced by ILIAS\Language\ComponentTranslation\NativeGettext\activated().
|
staticprivate |
Definition at line 82 of file NativeGettext.php.
|
staticprivate |
Definition at line 88 of file NativeGettext.php.
Referenced by ILIAS\Language\ComponentTranslation\NativeGettext\getProblem().
|
staticprivate |
Definition at line 86 of file NativeGettext.php.
|
staticprivate |
Definition at line 84 of file NativeGettext.php.
| const string ILIAS\Language\ComponentTranslation\NativeGettext::CATALOG_DIRECTORY = self::CATALOG_LANGUAGE . '/LC_MESSAGES' |
Definition at line 64 of file NativeGettext.php.
Referenced by ILIAS\Language\ComponentTranslation\MigratedLanguageFilePaths\buildMoFile(), ILIAS\Language\ComponentTranslation\MigratedLanguageFilePaths\overlayMoFile(), ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testAnOverlayWithASymbolicLinkAnywhereBelowTheOverlayRootIsNotServed(), and ILIAS\Language\ComponentTranslation\NativeGettextTest\testIsLoadedTellsAReadableCatalogOfOurOwnByItsHeader().
| const string ILIAS\Language\ComponentTranslation\NativeGettext::CATALOG_LANGUAGE = 'messages' |
The value of LANGUAGE: the directory below a bound directory the catalogs are looked up in.
Definition at line 62 of file NativeGettext.php.
Referenced by ILIAS\Language\ComponentTranslation\NativeGettextTest\testActivateKeepsARealLocaleAndRestoreLeavesItWhileTakingLanguageBack(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testActivateServesTheBuildAndRestoreGivesTheProcessStateBack(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testSystemLocaleBranchTranslatesWithoutLocaleDirectoryAndLeavesLocpathAlone(), and ILIAS\Language\ComponentTranslation\NativeGettextTest\testTheOwnLocaleIsNeverTakenForARealOneAfterLanguageWasLost().
|
private |
Definition at line 66 of file NativeGettext.php.
| const string ILIAS\Language\ComponentTranslation\NativeGettext::LOCALE_NAME = 'ilias_messages' |
Definition at line 54 of file NativeGettext.php.
Referenced by ILIAS\Language\ComponentTranslation\NativeGettextTest\testActivateFailsWithAProblemAndLeavesTheProcessAsItWas(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testActivateServesTheBuildAndRestoreGivesTheProcessStateBack(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testActivateStillFailsWithoutLocaleDirectoryWhenARealLocaleStays(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testALocaleOfTheCFamilyIsNotRealSoTheOwnLocaleIsActivatedAndTakenBackAgain(), ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testLostNativeGettextServesNothingNotEvenTheIdentifierForAnOverlayValue(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testReactivateIfLostDoesNothingWithoutAnActivationOrWhileActive(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testReactivateIfLostFailsWithAProblemWhenTheLocaleIsGone(), ILIAS\Language\ComponentTranslation\NativeGettextTest\testSystemLocaleBranchTranslatesWithoutLocaleDirectoryAndLeavesLocpathAlone(), ILIAS\Language\ComponentTranslation\ShippedTranslationsBuildTest\testSystemLocaleBuildShipsNoLocaleIsReusedAndDiffersFromTheGlibcBuild(), and ILIAS\Language\ComponentTranslation\NativeGettextTest\testTheOwnLocaleIsNeverTakenForARealOneAfterLanguageWasLost().
|
private |
Longer message ids are refused by PHP (ValueError), so they are never found.
Definition at line 69 of file NativeGettext.php.
|
private |
Definition at line 59 of file NativeGettext.php.
| const array ILIAS\Language\ComponentTranslation\NativeGettext::SYSTEM_LOCALES = ['en_US.UTF-8', 'en_US.utf8'] |
LC_MESSAGES candidates where the system locale is used, see usesSystemLocale().
Definition at line 57 of file NativeGettext.php.
Referenced by ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\requireSystemLocale(), ILIAS\Language\ComponentTranslation\NativeGettextTest\requireSystemLocale(), ILIAS\Language\ComponentTranslation\ShippedTranslationsBuildTest\requireSystemLocale(), ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testASystemLocaleBuildOnAnotherPlatformServesNothingAndTheProblemNamesTheCause(), and ILIAS\Language\ComponentTranslation\NativeGettextTest\testSystemLocaleIsOnlyActiveAfterActivateAndRestoreGivesTheProcessStateBack().