BlueSpice MediaWiki REL1_27
 All Classes Namespaces Files Functions Variables Groups Pages
SMWLanguage Class Reference
Inheritance diagram for SMWLanguage:

Public Member Functions

 getNamespaces ()
 
 getNamespaceAliases ()
 
 getDatatypeLabels ()
 
 getCanonicalDatatypeLabels ()
 
 getDatatypeAliases ()
 
 getPropertyLabels ()
 
 getCanonicalPropertyAliases ()
 
 getCanonicalPropertyLabels ()
 
 getPropertyAliases ()
 
 getPropertyId ($propName)
 
 getDateFormats ()
 
 getPreferredDateFormats ()
 
 findMonth ($label)
 
 getMonthLabel ($number)
 

Protected Attributes

 $m_DatatypeLabels
 
 $m_DatatypeAliases = array()
 
 $m_SpecialProperties
 
 $m_SpecialPropertyIds
 
 $m_SpecialPropertyAliases = array()
 
 $m_Namespaces
 
 $m_NamespaceAliases = array()
 
 $m_months = array( "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" )
 
 $m_monthsshort = array()
 
 $m_dateformats = array( array( SMW_Y ), array( SMW_MY, SMW_YM ), array( SMW_DMY, SMW_MDY, SMW_YMD, SMW_YDM ) )
 
 $preferredDateFormatsByPrecision
 
 $m_useEnDefaultAliases = true
 Should English default aliases be used in this language?
 

Static Protected Attributes

static $enNamespaceAliases
 Default English aliases for namespaces (typically used in all languages) More...
 
static $enDatatypeAliases
 Default English aliases for namespaces (typically used in all languages) More...
 
static $enPropertyAliases
 Default English aliases for special property names (typically used in all languages)
 

Detailed Description

Base class for all SMW language classes.

Author
Markus Krötzsch

Member Function Documentation

SMWLanguage::findMonth (   $label)

Function looks up a month and returns the corresponding number.

Todo:

Should we add functionality to ignore case here?

Should there be prefix string matching instead of two arrays for full and short names?

SMWLanguage::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.

SMWLanguage::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.

SMWLanguage::getDateFormats ( )

Function that returns the preferred date formats

SMWLanguage::getMonthLabel (   $number)

Return the name of the month with the given number.

SMWLanguage::getNamespaceAliases ( )

Function that returns an array of namespace aliases, if any.

SMWLanguage::getNamespaces ( )

Function that returns an array of namespace identifiers.

SMWLanguage::getPropertyAliases ( )

Aliases for predefined properties, if any.

SMWLanguage::getPropertyId (   $propName)

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

SMWLanguage::getPropertyLabels ( )

Function that returns the labels for predefined properties.

Member Data Documentation

SMWLanguage::$enDatatypeAliases
staticprotected
Initial value:
= array(
'URL' => '_uri',
'Page' => '_wpg',
'String' => '_txt',
'Text' => '_txt',
'Code' => '_cod',
'Boolean' => '_boo',
'Number' => '_num',
'Geographic coordinates'=> '_geo',
'Geographic coordinate' => '_geo',
'Geographic polygon' => '_gpo',
'Temperature' => '_tem',
'Quantity' => '_qty',
'Date' => '_dat',
'Email' => '_ema',
'Annotation URI' => '_anu',
'Telephone number' => '_tel',
'Record' => '_rec',
'Monolingual text' => '_mlt_rec',
)

Default English aliases for namespaces (typically used in all languages)

SMWLanguage::$enNamespaceAliases
staticprotected
Initial value:
= array(
'Property' => SMW_NS_PROPERTY,
'Property_talk' => SMW_NS_PROPERTY_TALK,
'Type' => SMW_NS_TYPE,
'Type_talk' => SMW_NS_TYPE_TALK,
'Concept' => SMW_NS_CONCEPT,
'Concept_talk' => SMW_NS_CONCEPT_TALK
)

Default English aliases for namespaces (typically used in all languages)

SMWLanguage::$m_dateformats = array( array( SMW_Y ), array( SMW_MY, SMW_YM ), array( SMW_DMY, SMW_MDY, SMW_YMD, SMW_YDM ) )
protected

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.

SMWLanguage::$m_months = array( "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" )
protected

Twelve strings naming the months. English is always supported in Type:Date, but we still need the English defaults to ensure that labels are returned by getMonthLabel()

SMWLanguage::$m_monthsshort = array()
protected

Twelve strings briefly naming the months. English is always supported in Type:Date, so the default is simply empty (no labels in addition to English)

SMWLanguage::$preferredDateFormatsByPrecision
protected
Initial value:
= array(
'SMW_PREC_Y' => 'Y',
'SMW_PREC_YM' => 'F Y',
'SMW_PREC_YMD' => 'F j, Y',
'SMW_PREC_YMDT' => 'H:i:s, j F Y'
)

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