Semantic MediaWiki and related extensions
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
SMW\ExtraneousLanguage\ExtraneousLanguage Class Reference

Public Member Functions

 __construct (LanguageContents $languageContents)
 
 setHistoricTypeNamespace ($historicTypeNamespace)
 
 getCode ()
 
 fetchByLanguageCode ($languageCode)
 
 getNamespaces ()
 
 getNamespaceAliases ()
 
 getDatatypeLabels ()
 
 findDatatypeByLabel ($label)
 
 getCanonicalDatatypeLabels ()
 
 getDatatypeAliases ()
 
 getCanonicalPropertyLabels ()
 
 getPropertyLabels ()
 
 getCanonicalPropertyAliases ()
 
 getPropertyAliases ()
 
 getPropertyIdByLabel ($propertyLabel)
 
 getDateFormats ()
 
 getPreferredDateFormatByPrecision ($precision=null)
 
 findMonth ($label)
 
 findMonthNumberByLabel ($label)
 
 getMonthLabel ($number)
 
 getMonthLabelByNumber ($number)
 

Static Public Member Functions

static getInstance ()
 
static clear ()
 

Protected Member Functions

 getPropertyId ($propertyLabel)
 

Detailed Description

This class provides "extraneous" language functions independent from MediaWiki to handle certain language options in a way required by Semantic MediaWiki and its registration system.

GNU GPL v2+

Since
2.4
Author
mwjames

Constructor & Destructor Documentation

SMW\ExtraneousLanguage\ExtraneousLanguage::__construct ( LanguageContents  $languageContents)
Since
2.4
Parameters
LanguageContents$languageContents

Member Function Documentation

static SMW\ExtraneousLanguage\ExtraneousLanguage::clear ( )
static
Since
2.4
SMW\ExtraneousLanguage\ExtraneousLanguage::fetchByLanguageCode (   $languageCode)
Since
2.4
Returns
string
SMW\ExtraneousLanguage\ExtraneousLanguage::findDatatypeByLabel (   $label)
Since
2.5
Parameters
string$label
Returns
string
SMW\ExtraneousLanguage\ExtraneousLanguage::findMonth (   $label)
Deprecated:
use findMonthNumberByLabel
SMW\ExtraneousLanguage\ExtraneousLanguage::findMonthNumberByLabel (   $label)

Function looks up a month and returns the corresponding number.

Since
2.4
Parameters
string$label
Returns
false|integer
SMW\ExtraneousLanguage\ExtraneousLanguage::getCanonicalDatatypeLabels ( )
Since
2.4
Returns
array
SMW\ExtraneousLanguage\ExtraneousLanguage::getCanonicalPropertyAliases ( )

Aliases for predefined properties, if any.

Since
2.4
Returns
array
SMW\ExtraneousLanguage\ExtraneousLanguage::getCanonicalPropertyLabels ( )
Since
2.4
Returns
array
SMW\ExtraneousLanguage\ExtraneousLanguage::getCode ( )
Since
2.4
Returns
string
SMW\ExtraneousLanguage\ExtraneousLanguage::getDatatypeAliases ( )

Return an array that maps aliases to internal type ids. All ids used here should also have a primary label defined in m_DatatypeLabels.

Since
2.4
Returns
array
SMW\ExtraneousLanguage\ExtraneousLanguage::getDatatypeLabels ( )

Return all labels that are available as names for built-in datatypes. Those are the types that users can access via [[has type::...]] (more built-in types may exist for internal purposes but the user won't need to know this). The returned array is indexed by (internal) type ids.

Since
2.4
Returns
array
SMW\ExtraneousLanguage\ExtraneousLanguage::getDateFormats ( )

Function that returns the preferred date formats

Preferred interpretations for dates with 1, 2, and 3 components. There is an array for each case, and the constants define the obvious order (e.g. SMW_YDM means "first Year, then Day, then Month). Unlisted combinations will not be accepted at all.

Since
2.4
Returns
array
static SMW\ExtraneousLanguage\ExtraneousLanguage::getInstance ( )
static
Since
2.4
Returns
ExtraneousLanguage
SMW\ExtraneousLanguage\ExtraneousLanguage::getMonthLabel (   $number)
Deprecated:
use getMonthLabelByNumber
SMW\ExtraneousLanguage\ExtraneousLanguage::getMonthLabelByNumber (   $number)

Return the name of the month with the given number.

Since
2.4
Parameters
integer$number
Returns
array
SMW\ExtraneousLanguage\ExtraneousLanguage::getNamespaceAliases ( )

Function that returns an array of namespace aliases, if any

Since
2.4
Returns
array
SMW\ExtraneousLanguage\ExtraneousLanguage::getNamespaces ( )

Function that returns an array of namespace identifiers.

Since
2.4
Returns
array
SMW\ExtraneousLanguage\ExtraneousLanguage::getPreferredDateFormatByPrecision (   $precision = null)
Since
2.4
Parameters
integer | null$precision
Returns
string
SMW\ExtraneousLanguage\ExtraneousLanguage::getPropertyAliases ( )

Aliases for predefined properties, if any.

Since
2.4
Returns
array
SMW\ExtraneousLanguage\ExtraneousLanguage::getPropertyId (   $propertyLabel)
protected
Deprecated:
use getPropertyIdByLabel
SMW\ExtraneousLanguage\ExtraneousLanguage::getPropertyIdByLabel (   $propertyLabel)

Function receives property name (for example, `Modificatino date') and returns a property id (for example, `_MDAT'). Property name may be localized one. If property name is not recognized, a null value returned.

Since
2.4
Returns
string|null
SMW\ExtraneousLanguage\ExtraneousLanguage::getPropertyLabels ( )

Function that returns the labels for predefined properties.

Since
2.4
Returns
array
SMW\ExtraneousLanguage\ExtraneousLanguage::setHistoricTypeNamespace (   $historicTypeNamespace)
Since
2.5
Parameters
boolean$historicTypeNamespace

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