Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4114387
ContentLanguage.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
807 B
Referenced Files
None
Subscribers
None
ContentLanguage.php
View Options
<?php
namespace
Cite\ResourceLoader
;
use
MediaWiki\MediaWikiServices
;
use
MediaWiki\ResourceLoader
as
RL
;
/**
* Callback to deliver language data for the content language, if different than the interface language.
*
* @copyright 2024 VisualEditor Team's Cite sub-team and others; see AUTHORS.txt
* @license MIT
*/
class
ContentLanguage
{
public
static
function
makeScript
(
RL\Context
$context
):
string
{
$contentLang
=
MediaWikiServices
::
getInstance
()->
getContentLanguage
();
$contentLangCode
=
$contentLang
->
getCode
();
$interfaceLangCode
=
$context
->
getLanguage
();
if
(
$contentLangCode
===
$interfaceLangCode
)
{
return
''
;
}
return
'mw.language.setData('
.
$context
->
encodeJson
(
$contentLangCode
)
.
','
.
$context
->
encodeJson
(
$contentLang
->
getJsData
()
)
.
');'
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, Aug 19, 00:07 (2 d, 8 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
00/45/5dcfe3cc732a83e2d48ddeb188c2
Default Alt Text
ContentLanguage.php (807 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment