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

Public Member Functions

 __construct (LanguageContents $languageContents)
 
 getCode ()
 
 fetchByLanguageCode ( $languageCode)
 
 fetch ( $languageCode)
 
 getNamespaces ()
 
 getNamespaceAliases ()
 
 getDatatypeLabels ()
 
 findDatatypeByLabel ( $label)
 
 getCanonicalDatatypeLabels ()
 
 getDatatypeAliases ()
 
 getCanonicalPropertyLabels ()
 
 getPropertyLabels ()
 
 getCanonicalPropertyAliases ()
 
 getPropertyAliases ()
 
 getPropertyIdByLabel ( $label)
 
 getPropertyLabelList ()
 
 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

◆ __construct()

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

Member Function Documentation

◆ clear()

static SMW\Lang\Lang::clear ( )
static
Since
2.4

◆ fetch()

SMW\Lang\Lang::fetch (   $languageCode)
Since
2.4
Returns
string

◆ fetchByLanguageCode()

SMW\Lang\Lang::fetchByLanguageCode (   $languageCode)
Deprecated:
since 3.0, use Lang::fetch
Since
2.4
Returns
string

◆ findDatatypeByLabel()

SMW\Lang\Lang::findDatatypeByLabel (   $label)
Since
2.5
Parameters
string$label
Returns
string

◆ findMonth()

SMW\Lang\Lang::findMonth (   $label)
Deprecated:
use findMonthNumberByLabel

◆ findMonthNumberByLabel()

SMW\Lang\Lang::findMonthNumberByLabel (   $label)

Function looks up a month and returns the corresponding number.

Since
2.4
Parameters
string$label
Returns
false|integer

◆ getCanonicalDatatypeLabels()

SMW\Lang\Lang::getCanonicalDatatypeLabels ( )
Since
2.4
Returns
array

◆ getCanonicalPropertyAliases()

SMW\Lang\Lang::getCanonicalPropertyAliases ( )

Aliases for predefined properties, if any.

Since
2.4
Returns
array

◆ getCanonicalPropertyLabels()

SMW\Lang\Lang::getCanonicalPropertyLabels ( )
Since
2.4
Returns
array

◆ getCode()

SMW\Lang\Lang::getCode ( )
Since
2.4
Returns
string

◆ getDatatypeAliases()

SMW\Lang\Lang::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

◆ getDatatypeLabels()

SMW\Lang\Lang::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

◆ getDateFormats()

SMW\Lang\Lang::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

◆ getInstance()

static SMW\Lang\Lang::getInstance ( )
static
Since
2.4
Returns
Lang

◆ getMonthLabel()

SMW\Lang\Lang::getMonthLabel (   $number)
Deprecated:
use getMonthLabelByNumber

◆ getMonthLabelByNumber()

SMW\Lang\Lang::getMonthLabelByNumber (   $number)

Return the name of the month with the given number.

Since
2.4
Parameters
integer$number
Returns
array

◆ getNamespaceAliases()

SMW\Lang\Lang::getNamespaceAliases ( )

Function that returns an array of namespace aliases, if any

Since
2.4
Returns
array

◆ getNamespaces()

SMW\Lang\Lang::getNamespaces ( )

Function that returns an array of namespace identifiers.

Since
2.4
Returns
array

◆ getPreferredDateFormatByPrecision()

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

◆ getPropertyAliases()

SMW\Lang\Lang::getPropertyAliases ( )

Aliases for predefined properties, if any.

Since
2.4
Returns
array

◆ getPropertyId()

SMW\Lang\Lang::getPropertyId (   $propertyLabel)
protected
Deprecated:
use getPropertyIdByLabel

◆ getPropertyIdByLabel()

SMW\Lang\Lang::getPropertyIdByLabel (   $label)

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

◆ getPropertyLabelList()

SMW\Lang\Lang::getPropertyLabelList ( )
Since
3.0
Returns
array

◆ getPropertyLabels()

SMW\Lang\Lang::getPropertyLabels ( )

Function that returns the labels for predefined properties.

Since
2.4
Returns
array

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

About | General disclaimer | Privacy policy