Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4148164
LazyLocalizationContext.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
849 B
Referenced Files
None
Subscribers
None
LazyLocalizationContext.php
View Options
<?php
/**
* @license GPL-2.0-or-later
* @file
*/
namespace
MediaWiki\Language
;
/**
* Wrapper for injecting a LocalizationContext with lazy initialization.
*
* @since 1.42
* @ingroup Language
*/
class
LazyLocalizationContext
implements
LocalizationContext
{
/** @var callable */
private
$instantiator
;
private
?
LocalizationContext
$context
=
null
;
public
function
__construct
(
callable
$instantiator
)
{
$this
->
instantiator
=
$instantiator
;
}
private
function
resolve
():
LocalizationContext
{
if
(
!
$this
->
context
)
{
$this
->
context
=
(
$this
->
instantiator
)();
}
return
$this
->
context
;
}
/** @inheritDoc */
public
function
getLanguageCode
()
{
return
$this
->
resolve
()->
getLanguageCode
();
}
/** @inheritDoc */
public
function
msg
(
$key
,
...
$params
)
{
return
$this
->
resolve
()->
msg
(
$key
,
...
$params
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Aug 19 2026, 18:40 (6 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
52/f6/9a423e122b31803cc4344deabb3a
Default Alt Text
LazyLocalizationContext.php (849 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment