ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ILIAS\Language\ComponentTranslation\MigratedTranslations Class Reference

Build status and problems of the ILIAS modules served by TranslationGettextRepository: which modules are shipped, whether a .po is left unbuilt, and the problems of this request for the administration. More...

+ Collaboration diagram for ILIAS\Language\ComponentTranslation\MigratedTranslations:

Static Public Member Functions

static isShippedModule (string $module)
 Whether $module belongs to the ILIAS components (never served from lng_data then). More...
 
static shipsPoFor (string $module, string $lang_key)
 Whether the template directory of $module has a <module>_<lang>.po. More...
 
static clientDataDir ()
 CLIENT_DATA_DIR, before it is defined (Setup, CLI) resolveClientDataDir(); cached until reset(). More...
 
static shipsPoWithoutBuild (string $module, string $lang_key, ?LanguageFileDirectory $directory)
 Whether $module ships a .po for $lang_key that the build does not serve; cached until reset(). More...
 
static reportMissingBuild ()
 Reports (fatal) a missing build; false if there is one. More...
 
static reportProblem (string $message, bool $fatal=false)
 Records a problem (logged once per request, see getProblem()). More...
 
static getProblem (?string $client_data_dir)
 The first fatal problem of this request, otherwise the first one - after checking the first module of the build, so the administration can show it even if no migrated module was used yet. More...
 
static reportActivationProblem (string $reason)
 Native gettext cannot be activated (first use or later): one message per request, whatever the reason. More...
 
static reset ()
 Forgets what was read in this request, the served translations included (e.g. More...
 
static resetForTests ()
 Forgets everything read so far, the problems included - for tests only. More...
 
static pointer ()
 
static artifactDirectory ()
 

Static Private Member Functions

static missingBuildMessage ()
 
static reportNewerOtherBuild (array $pointer)
 Records (not fatal, not logged) that the pointer of the other locale kind was switched later than $pointer to a build of other shipped files. More...
 
static otherBuildHint (string $prefix, bool $system_locale)
 
static shippedTemplates ()
 
static iliasDirectory ()
 

Static Private Attributes

static bool $pointer_read = false
 
static bool $pointer_system_locale = null
 The locale kind (NativeGettext::usesSystemLocale()) $pointer was read for. More...
 
static array $pointer = null
 
static array $shipped_templates = null
 
static array $shipped_modules = []
 
static string $client_data_dir = null
 
static bool $client_data_dir_resolved = false
 
static array $shipped_without_build = []
 
static array $problems = []
 
static bool $activation_problem_reported = false
 

Detailed Description

Build status and problems of the ILIAS modules served by TranslationGettextRepository: which modules are shipped, whether a .po is left unbuilt, and the problems of this request for the administration.

Static: the problems are collected per request like a log, also from static callers (ilLanguage::_lookupEntry(), the write paths). No part of TranslationRepository, as no translation is read here.

@phpstan-import-type Pointer from ShippedTranslationsBuild

Definition at line 32 of file MigratedTranslations.php.

Member Function Documentation

◆ artifactDirectory()

static ILIAS\Language\ComponentTranslation\MigratedTranslations::artifactDirectory ( )
static

Definition at line 327 of file MigratedTranslations.php.

327 : string
328 {
329 return MigratedLanguageFilePaths::shippedArtifactDirectory(self::iliasDirectory());
330 }
static shippedArtifactDirectory(string $ilias_absolute_path)
The directory Setup's build writes into (see ShippedTranslationsBuild), in the untracked artifacts/.

References ILIAS\Language\ComponentTranslation\MigratedLanguageFilePaths\shippedArtifactDirectory().

Referenced by ILIAS\Language\ComponentTranslation\TranslationGettextRepository\state().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clientDataDir()

static ILIAS\Language\ComponentTranslation\MigratedTranslations::clientDataDir ( )
static

CLIENT_DATA_DIR, before it is defined (Setup, CLI) resolveClientDataDir(); cached until reset().

Definition at line 103 of file MigratedTranslations.php.

103 : ?string
104 {
105 if (defined('CLIENT_DATA_DIR')) {
106 return (string) CLIENT_DATA_DIR;
107 }
108 if (!self::$client_data_dir_resolved) {
109 self::$client_data_dir = MigratedLanguageFilePaths::resolveClientDataDir(self::iliasDirectory());
110 self::$client_data_dir_resolved = true;
111 }
112
114 }
static resolveClientDataDir(?string $ilias_absolute_path=null)
The client data directory (CLIENT_DATA_DIR) of this installation, null if it cannot be determined or ...
const CLIENT_DATA_DIR
Definition: constants.php:46

References ILIAS\Language\ComponentTranslation\MigratedTranslations\$client_data_dir, CLIENT_DATA_DIR, and ILIAS\Language\ComponentTranslation\MigratedLanguageFilePaths\resolveClientDataDir().

+ Here is the call graph for this function:

◆ getProblem()

static ILIAS\Language\ComponentTranslation\MigratedTranslations::getProblem ( ?string  $client_data_dir)
static

The first fatal problem of this request, otherwise the first one - after checking the first module of the build, so the administration can show it even if no migrated module was used yet.

null if there is none. Paths below the ILIAS directory and the client data directory are relative in the message (<data>/…); the log has them in full.

Returns
array{message: string, fatal: bool}|null

Definition at line 177 of file MigratedTranslations.php.

177 : ?array
178 {
180 if ($pointer === null) {
181 self::reportProblem(self::missingBuildMessage(), true);
182 } else {
183 foreach ($pointer['modules'] as $module => $languages) {
184 if ($languages !== []) {
185 (new TranslationGettextRepository())->getKeys((string) $module, $languages[0], $client_data_dir);
186 break;
187 }
188 }
189 }
190
191 if (self::$problems === []) {
192 return null;
193 }
194 $message = (string) (array_search(true, self::$problems, true) ?: array_key_first(self::$problems));
195 $replace = [
196 rtrim(self::iliasDirectory(), '/') . '/' => '',
197 rtrim(self::artifactDirectory(), '/') . '/' => 'artifacts/language/',
198 ];
199 if ($client_data_dir !== null) {
200 $replace[rtrim($client_data_dir, '/') . '/'] = '<data>/';
201 }
202
203 return ['message' => strtr($message, $replace), 'fatal' => self::$problems[$message]];
204 }
static reportProblem(string $message, bool $fatal=false)
Records a problem (logged once per request, see getProblem()).
if(!isset($arguments[0])) if(count( $arguments) > 3) if(! $remove_from_lang &&isset($arguments[2]) &&!is_dir($arguments[2])) $module

References ILIAS\Language\ComponentTranslation\MigratedTranslations\$client_data_dir, $message, $module, ILIAS\Language\ComponentTranslation\MigratedTranslations\$pointer, ILIAS\Language\ComponentTranslation\MigratedTranslations\pointer(), and ILIAS\Language\ComponentTranslation\MigratedTranslations\reportProblem().

Referenced by ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testAFatalProblemIsReportedBeforeAnEarlierNonFatalOne(), ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testAHealthyBuildHasNoProblem(), ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testANewerBuildOfTheOtherLocaleKindIsHintedAtOnlyForOtherShippedFiles(), ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testAnOverlayProblemNamesItsPathRelativeToTheClientDataDirectory(), ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testAProblemOfOneModuleIsNotFatalAndHasNoAbsolutePaths(), ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testASystemLocaleBuildOnAnotherPlatformServesNothingAndTheProblemNamesTheCause(), ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testGetProblemChecksTheFirstModuleOfTheBuildEvenIfNothingWasUsedYet(), ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testLostNativeGettextServesNothingNotEvenTheIdentifierForAnOverlayValue(), ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testNoBuildIsAFatalProblemWithoutAbsolutePaths(), ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testWithoutABuildNothingIsMigratedAndTheProblemSaysSo(), and ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testWithoutAnOwnPointerTheMissingBuildIsFatalAndNamesTheBuildOfTheOtherKind().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ iliasDirectory()

static ILIAS\Language\ComponentTranslation\MigratedTranslations::iliasDirectory ( )
staticprivate

Definition at line 332 of file MigratedTranslations.php.

332 : string
333 {
334 return defined('ILIAS_ABSOLUTE_PATH') ? (string) ILIAS_ABSOLUTE_PATH : dirname(__DIR__, 5);
335 }

◆ isShippedModule()

array< string, bool > see ILIAS\Language\ComponentTranslation\MigratedTranslations::isShippedModule ( string  $module)
static

Whether $module belongs to the ILIAS components (never served from lng_data then).

Works without the component graph: from the build's recorded contributions, else from the shipped templates.

Definition at line 75 of file MigratedTranslations.php.

75 : bool
76 {
77 if (!isset(self::$shipped_modules[$module])) {
79 // a pointer without build (e.g. written from no directories) lists nothing reliable
80 self::$shipped_modules[$module] = $pointer !== null && $pointer['build'] !== null && $pointer['shipped'] !== null
81 ? in_array($module, $pointer['shipped'], true)
82 : isset($pointer['modules'][$module]) || isset(self::shippedTemplates()[$module]);
83 }
84
85 return self::$shipped_modules[$module];
86 }

References $module, ILIAS\Language\ComponentTranslation\MigratedTranslations\$pointer, and ILIAS\Language\ComponentTranslation\MigratedTranslations\pointer().

Referenced by ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testAModuleIsShippedIfItIsBuiltOrHasATemplateInTheComponents(), ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testWithABuildTheRecordedContributionsDecideEvenForAModuleWithoutAnyPo(), and ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testWithoutABuildOrAListOfContributionsTheShippedTemplatesDecide().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ missingBuildMessage()

static ILIAS\Language\ComponentTranslation\MigratedTranslations::missingBuildMessage ( )
staticprivate

Definition at line 247 of file MigratedTranslations.php.

247 : string
248 {
249 $message = sprintf(
250 'There is no build of the language files ("%s") - run "php cli/setup.php build".',
251 MigratedLanguageFilePaths::buildPointerFile(self::artifactDirectory())
252 );
253 $system_locale = !NativeGettext::usesSystemLocale();
254
255 return is_file(MigratedLanguageFilePaths::buildPointerFileOf(self::artifactDirectory(), $system_locale))
256 ? $message . ' ' . self::otherBuildHint('A build exists', $system_locale)
257 : $message;
258 }
static buildPointerFile(string $artifact_directory)
artifacts/language/current.json (current-system.json where NativeGettext::usesSystemLocale()): names ...
static buildPointerFileOf(string $artifact_directory, bool $system_locale)
The pointer of the builds made with ($system_locale) or without a system locale.
static otherBuildHint(string $prefix, bool $system_locale)
static usesSystemLocale()
macOS/BSD: activate() uses a SYSTEM_LOCALES entry, their C library ignores LOCPATH.

References $message, ILIAS\Language\ComponentTranslation\MigratedLanguageFilePaths\buildPointerFile(), ILIAS\Language\ComponentTranslation\MigratedLanguageFilePaths\buildPointerFileOf(), ILIAS\Language\ComponentTranslation\MigratedTranslations\otherBuildHint(), and ILIAS\Language\ComponentTranslation\NativeGettext\usesSystemLocale().

+ Here is the call graph for this function:

◆ otherBuildHint()

static ILIAS\Language\ComponentTranslation\MigratedTranslations::otherBuildHint ( string  $prefix,
bool  $system_locale 
)
staticprivate

Definition at line 283 of file MigratedTranslations.php.

283 : string
284 {
285 return sprintf(
286 '%s for %s ("%s") - run "php cli/setup.php build" on the platform of the web server to serve it.',
287 $prefix,
288 $system_locale ? 'a system locale (macOS/BSD)' : 'glibc',
289 MigratedLanguageFilePaths::buildPointerFileOf(self::artifactDirectory(), $system_locale)
290 );
291 }

References ILIAS\Language\ComponentTranslation\MigratedLanguageFilePaths\buildPointerFileOf().

Referenced by ILIAS\Language\ComponentTranslation\MigratedTranslations\missingBuildMessage(), and ILIAS\Language\ComponentTranslation\MigratedTranslations\reportNewerOtherBuild().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pointer()

static ILIAS\Language\ComponentTranslation\MigratedTranslations::pointer ( )
static

Definition at line 306 of file MigratedTranslations.php.

306 : ?array
307 {
308 $system_locale = NativeGettext::usesSystemLocale();
309 if (self::$pointer_read && self::$pointer_system_locale !== $system_locale) {
310 self::reset();
311 }
312 if (!self::$pointer_read) {
313 self::$pointer = ShippedTranslationsBuild::readPointer(self::artifactDirectory());
314 self::$pointer_read = true;
315 self::$pointer_system_locale = $system_locale;
316 if (self::$pointer !== null) {
317 self::reportNewerOtherBuild(self::$pointer);
318 }
319 }
320
321 return self::$pointer;
322 }
static reportNewerOtherBuild(array $pointer)
Records (not fatal, not logged) that the pointer of the other locale kind was switched later than $po...
static reset()
Forgets what was read in this request, the served translations included (e.g.
static readPointer(string $artifact_directory)
The pointer of this PHP's locale kind in $artifact_directory, null if it is missing or not valid.

References ILIAS\Language\ComponentTranslation\MigratedTranslations\$pointer, ILIAS\Language\ComponentTranslation\ShippedTranslationsBuild\readPointer(), ILIAS\Language\ComponentTranslation\MigratedTranslations\reportNewerOtherBuild(), ILIAS\Language\ComponentTranslation\MigratedTranslations\reset(), and ILIAS\Language\ComponentTranslation\NativeGettext\usesSystemLocale().

Referenced by ILIAS\Language\ComponentTranslation\MigratedTranslations\getProblem(), ILIAS\Language\ComponentTranslation\MigratedTranslations\isShippedModule(), ILIAS\Language\ComponentTranslation\MigratedTranslations\reportMissingBuild(), ILIAS\Language\ComponentTranslation\TranslationGettextRepository\state(), and ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testSwitchingTheLocaleKindReadsTheOtherPointerWithoutAReset().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reportActivationProblem()

static ILIAS\Language\ComponentTranslation\MigratedTranslations::reportActivationProblem ( string  $reason)
static

Native gettext cannot be activated (first use or later): one message per request, whatever the reason.

Definition at line 209 of file MigratedTranslations.php.

209 : void
210 {
211 if (self::$activation_problem_reported) {
212 return;
213 }
214 self::$activation_problem_reported = true;
215 self::reportProblem(sprintf('Native gettext is not available: %s.', $reason), true);
216 }

References ILIAS\Language\ComponentTranslation\MigratedTranslations\reportProblem().

Referenced by ILIAS\Language\ComponentTranslation\TranslationGettextRepository\reportLostActivation(), and ILIAS\Language\ComponentTranslation\TranslationGettextRepository\state().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reportMissingBuild()

static ILIAS\Language\ComponentTranslation\MigratedTranslations::reportMissingBuild ( )
static

Reports (fatal) a missing build; false if there is one.

Definition at line 137 of file MigratedTranslations.php.

137 : bool
138 {
140 if ($pointer !== null && $pointer['build'] !== null) {
141 return false;
142 }
143 self::reportProblem(self::missingBuildMessage(), true);
144
145 return true;
146 }

References ILIAS\Language\ComponentTranslation\MigratedTranslations\$pointer, ILIAS\Language\ComponentTranslation\MigratedTranslations\pointer(), and ILIAS\Language\ComponentTranslation\MigratedTranslations\reportProblem().

Referenced by ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testReportMissingBuildIsFatalWithoutABuildAndSilentWithOne().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reportNewerOtherBuild()

static ILIAS\Language\ComponentTranslation\MigratedTranslations::reportNewerOtherBuild ( array  $pointer)
staticprivate

Records (not fatal, not logged) that the pointer of the other locale kind was switched later than $pointer to a build of other shipped files.

Parameters
Pointer$pointer

Definition at line 266 of file MigratedTranslations.php.

266 : void
267 {
268 $system_locale = !NativeGettext::usesSystemLocale();
269 $other_file = MigratedLanguageFilePaths::buildPointerFileOf(self::artifactDirectory(), $system_locale);
270 $other_time = @filemtime($other_file);
271 $own_time = @filemtime(MigratedLanguageFilePaths::buildPointerFile(self::artifactDirectory()));
272 if ($other_time === false || ($own_time !== false && $own_time >= $other_time)) {
273 return;
274 }
275 $other = ShippedTranslationsBuild::readPointerOf(self::artifactDirectory(), $system_locale);
276 if ($other === null || $other['build'] === null || ($pointer['sources'] !== null && $pointer['sources'] === $other['sources'])) {
277 return;
278 }
279 // a state of the installation for the administration, not worth a log line on every request
280 self::$problems[self::otherBuildHint('A newer build exists', $system_locale)] ??= false;
281 }
static readPointerOf(string $artifact_directory, bool $system_locale)

References ILIAS\Language\ComponentTranslation\MigratedTranslations\$pointer, ILIAS\Language\ComponentTranslation\MigratedLanguageFilePaths\buildPointerFile(), ILIAS\Language\ComponentTranslation\MigratedLanguageFilePaths\buildPointerFileOf(), ILIAS\Language\ComponentTranslation\MigratedTranslations\otherBuildHint(), ILIAS\Language\ComponentTranslation\ShippedTranslationsBuild\readPointerOf(), and ILIAS\Language\ComponentTranslation\NativeGettext\usesSystemLocale().

Referenced by ILIAS\Language\ComponentTranslation\MigratedTranslations\pointer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reportProblem()

static ILIAS\Language\ComponentTranslation\MigratedTranslations::reportProblem ( string  $message,
bool  $fatal = false 
)
static

Records a problem (logged once per request, see getProblem()).

Parameters
bool$fatalwhether it concerns every migrated module (no native gettext, no build) rather than one module, language or overlay

Definition at line 154 of file MigratedTranslations.php.

154 : void
155 {
156 if (isset(self::$problems[$message])) {
157 return;
158 }
159 self::$problems[$message] = $fatal;
160
161 global $DIC;
162 try {
163 $DIC->logger()->forComponent('lang')->warning($message);
164 } catch (\Throwable) {
165 error_log($message);
166 }
167 }
global $DIC
Definition: shib_login.php:26

References $DIC, and $message.

Referenced by ILIAS\Language\ComponentTranslation\MigratedTranslations\getProblem(), ILIAS\Language\ComponentTranslation\MigratedTranslations\reportActivationProblem(), ILIAS\Language\ComponentTranslation\MigratedTranslations\reportMissingBuild(), ILIAS\Language\ComponentTranslation\TranslationGettextRepository\state(), ILIAS\Language\Activities\RepositoryProvider\updateModuleCache(), and ILIAS\Language\ComponentTranslation\TranslationGettextRepository\withOverlay().

+ Here is the caller graph for this function:

◆ reset()

static ILIAS\Language\ComponentTranslation\MigratedTranslations::reset ( )
static

Forgets what was read in this request, the served translations included (e.g.

after a new build in the same process).

Definition at line 222 of file MigratedTranslations.php.

222 : void
223 {
224 (new TranslationGettextRepository())->invalidateAll();
225 self::$pointer_read = false;
226 self::$pointer = null;
227 self::$pointer_system_locale = null;
228 self::$shipped_templates = null;
229 self::$shipped_modules = [];
230 self::$client_data_dir = null;
231 self::$client_data_dir_resolved = false;
232 self::$shipped_without_build = [];
233 }

Referenced by ILIAS\Language\Setup\ShippedLanguageFilesCompiledObjective\achieve(), ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\buildKind(), ILIAS\Language\ComponentTranslation\MigratedTranslations\pointer(), ILIAS\Language\ComponentTranslation\MigratedTranslations\resetForTests(), ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testABuildWithoutTheIdentifiersOfAModuleServesNothingOfIt(), ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testAFatalProblemIsReportedBeforeAnEarlierNonFatalOne(), ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testAModuleIsShippedIfItIsBuiltOrHasATemplateInTheComponents(), ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testAProblemOfOneModuleIsNotFatalAndHasNoAbsolutePaths(), ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testASystemLocaleBuildOnAnotherPlatformServesNothingAndTheProblemNamesTheCause(), ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testEachLocaleKindServesTheBuildOfItsOwnPointer(), ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testGetProblemChecksTheFirstModuleOfTheBuildEvenIfNothingWasUsedYet(), ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testResetForgetsTheBuildSoANewOneIsServed(), ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testTheSameProblemOfAnotherLanguageOfTheModuleIsNotLoggedAgain(), and ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testWithoutABuildOrAListOfContributionsTheShippedTemplatesDecide().

+ Here is the caller graph for this function:

◆ resetForTests()

static ILIAS\Language\ComponentTranslation\MigratedTranslations::resetForTests ( )
static

Forgets everything read so far, the problems included - for tests only.

Definition at line 240 of file MigratedTranslations.php.

240 : void
241 {
242 self::reset();
243 self::$problems = [];
244 self::$activation_problem_reported = false;
245 }

References ILIAS\Language\ComponentTranslation\MigratedTranslations\reset().

+ Here is the call graph for this function:

◆ shippedTemplates()

static ILIAS\Language\ComponentTranslation\MigratedTranslations::shippedTemplates ( )
staticprivate
Returns
array<string, string>

Definition at line 296 of file MigratedTranslations.php.

296 : array
297 {
298 return self::$shipped_templates ??= MigratedLanguageFilePaths::findShippedTemplates(self::iliasDirectory());
299 }
static findShippedTemplates(string $ilias_absolute_path)
Module => lang/ directory of its <module>.pot; works without the component graph (Setup).

References ILIAS\Language\ComponentTranslation\MigratedLanguageFilePaths\findShippedTemplates().

Referenced by ILIAS\Language\ComponentTranslation\MigratedTranslations\shipsPoFor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ shipsPoFor()

static ILIAS\Language\ComponentTranslation\MigratedTranslations::shipsPoFor ( string  $module,
string  $lang_key 
)
static

Whether the template directory of $module has a <module>_<lang>.po.

Definition at line 91 of file MigratedTranslations.php.

91 : bool
92 {
93 $directory = self::shippedTemplates()[$module] ?? null;
94
95 return $directory !== null
97 && is_file($directory . '/' . $module . '_' . $lang_key . '.po');
98 }

References $module, ILIAS\Language\ComponentTranslation\MigratedLanguageFilePaths\isValidLanguageKey(), and ILIAS\Language\ComponentTranslation\MigratedTranslations\shippedTemplates().

Referenced by ILIAS\Language\ComponentTranslation\MigratedTranslations\shipsPoWithoutBuild(), and ILIAS\Language\ComponentTranslation\MigratedTranslationsTest\testShipsPoForNeedsATemplateADefaultNamedPoAndAValidLanguageKey().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ shipsPoWithoutBuild()

static ILIAS\Language\ComponentTranslation\MigratedTranslations::shipsPoWithoutBuild ( string  $module,
string  $lang_key,
?LanguageFileDirectory  $directory 
)
static

Whether $module ships a .po for $lang_key that the build does not serve; cached until reset().

Definition at line 119 of file MigratedTranslations.php.

119 : bool
120 {
121 if (!isset(self::$shipped_without_build[$module . '|' . $lang_key])) {
122 try {
123 self::$shipped_without_build[$module . '|' . $lang_key] = $directory === null
124 ? self::shipsPoFor($module, $lang_key)
125 : is_file(MigratedLanguageFilePaths::shippedBasePath(self::iliasDirectory(), $directory, $lang_key) . '.po');
126 } catch (\InvalidArgumentException) {
127 self::$shipped_without_build[$module . '|' . $lang_key] = false;
128 }
129 }
130
131 return self::$shipped_without_build[$module . '|' . $lang_key];
132 }
static shipsPoFor(string $module, string $lang_key)
Whether the template directory of $module has a <module>_<lang>.po.

References $module, ILIAS\Language\ComponentTranslation\MigratedLanguageFilePaths\shippedBasePath(), and ILIAS\Language\ComponentTranslation\MigratedTranslations\shipsPoFor().

+ Here is the call graph for this function:

Field Documentation

◆ $activation_problem_reported

bool ILIAS\Language\ComponentTranslation\MigratedTranslations::$activation_problem_reported = false
staticprivate

Definition at line 69 of file MigratedTranslations.php.

◆ $client_data_dir

string ILIAS\Language\ComponentTranslation\MigratedTranslations::$client_data_dir = null
staticprivate

◆ $client_data_dir_resolved

bool ILIAS\Language\ComponentTranslation\MigratedTranslations::$client_data_dir_resolved = false
staticprivate

Definition at line 55 of file MigratedTranslations.php.

◆ $pointer

◆ $pointer_read

bool ILIAS\Language\ComponentTranslation\MigratedTranslations::$pointer_read = false
staticprivate

Definition at line 34 of file MigratedTranslations.php.

◆ $pointer_system_locale

bool ILIAS\Language\ComponentTranslation\MigratedTranslations::$pointer_system_locale = null
staticprivate

The locale kind (NativeGettext::usesSystemLocale()) $pointer was read for.

Definition at line 37 of file MigratedTranslations.php.

◆ $problems

array ILIAS\Language\ComponentTranslation\MigratedTranslations::$problems = []
staticprivate

Definition at line 67 of file MigratedTranslations.php.

◆ $shipped_modules

array ILIAS\Language\ComponentTranslation\MigratedTranslations::$shipped_modules = []
staticprivate

Definition at line 52 of file MigratedTranslations.php.

◆ $shipped_templates

array ILIAS\Language\ComponentTranslation\MigratedTranslations::$shipped_templates = null
staticprivate

Definition at line 47 of file MigratedTranslations.php.

◆ $shipped_without_build

array ILIAS\Language\ComponentTranslation\MigratedTranslations::$shipped_without_build = []
staticprivate

Definition at line 60 of file MigratedTranslations.php.


The documentation for this class was generated from the following file: