Special property "Language code"

From semantic-mediawiki.org
Language code
Handles BCP47 conform language codes specifying the language of the annotated text
Further Information
Provided by: extension "Semantic MediaWiki "Allows to store and query data annotated to pages
Added: 2.4.0
Removed: still in use
Alias: has no alias
Optional: yes
Visible: yes
Annotable: yes
Declarative: no
Key:
_LCODE
Setting:
SMW_DV_MLTV_LCODE
Focus: language information
In this wiki: Property:Language code
Table of Contents

The Language code property is a special property in Semantic MediaWiki with a built-in meaning: it handles language codes which have to conform with the IETF language tag (BCP47). It was introduced starting with Semantic MediaWiki 2.4.0.1 It is enabled by default. See the help page on the configuration setting $smwgDVFeatures for details on configuring Semantic MediaWiki for special data value feature including "Language code" with the SMW_DV_MLTV_LCODE constant.

Example[edit]

The property "Has special property description" is of datatye "Monolingual text" and gets the following annotation:

[[Has special property description::Handles BCP47 conform language codes specifying the language of the annotated text.@en]]

The "Language code" special property now gets automatically set with "en" since this was the language code defined with "@en" for English via the datavalue. Appending a language code with @?? with "??" replaced by the applicable language code is required. The same applies to annotations to the "Has property description" special property.

See also[edit]

References

  1. ^  Semantic MediaWiki: GitHub pull request gh:smw:1344