Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5961275
LanguageService.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
LanguageService.php
View Options
<?php
namespace
MediaWiki\Skins\Vector\Services
;
class
LanguageService
{
/**
* The list of language codes for those languages that the search autocomplete widget cannot
* split a word on a Unicode code point followed by one or many combining marks (also code
* points).
*
* This list was compiled by [@TJones](https://phabricator.wikimedia.org/p/TJones/) as part
* of [T281797](https://phabricator.wikimedia.org/T281797).
*
* @var string[]
*/
private
$splittableLanguages
;
public
function
__construct
()
{
$this
->
splittableLanguages
=
[
'ar'
,
'ary'
,
'arz'
,
'ckb'
,
'fa'
,
'glk'
,
'ks'
,
'mzn'
,
'pnb'
,
'ps'
,
'sd'
,
'skr'
,
'ug'
,
'ur'
,
'as'
,
'bn'
,
'bpy'
,
'awa'
,
'bh'
,
'dty'
,
'gom'
,
'hi'
,
'ks'
,
'mai'
,
'mr'
,
'ne'
,
'new'
,
'pi'
,
'sa'
,
'gu'
,
'pa'
,
'kn'
,
'tcy'
,
'km'
,
'ml'
,
'or'
,
'si'
,
'ta'
,
'te'
,
];
}
/**
* Gets whether or not we can split words arbitrarily, for example when highlighting the user's query in the search
* autocomplete widget.
*
* @param string $code
* @return bool
*/
public
function
canWordsBeSplitSafely
(
string
$code
):
bool
{
return
!
in_array
(
$code
,
$this
->
splittableLanguages
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 3, 07:58 (1 w, 6 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
6b/31/d4bc5fabcc10741c52a8e4bab20d
Default Alt Text
LanguageService.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment