Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92300575
PhabricatorTranslation.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Nov 19, 05:24
Size
944 B
Mime Type
text/x-php
Expires
Thu, Nov 21, 05:24 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22414450
Attached To
rPH Phabricator
PhabricatorTranslation.php
View Options
<?php
abstract
class
PhabricatorTranslation
{
abstract
public
function
getLanguage
();
abstract
public
function
getName
();
abstract
public
function
getTranslations
();
/**
* Return the cleaned translation array.
*
* @return dict<string, wild> Translation map with empty translations removed.
*/
public
function
getCleanTranslations
()
{
return
$this
->
clean
(
$this
->
getTranslations
());
}
/**
* Removes NULL-valued translation keys from the translation map, to prevent
* echoing out empty strings.
*
* @param dict<string, wild> Translation map, with empty translations.
* @return dict<string, wild> Map with empty translations removed.
*/
protected
function
clean
(
array
$translation_array
)
{
foreach
(
$translation_array
as
$key
=>
$translation_string
)
{
if
(
$translation_string
===
null
)
{
unset
(
$translation_array
[
$key
]);
}
}
return
$translation_array
;
}
}
Event Timeline
Log In to Comment