Package org.apache.wiki.plugin
Class LanguagePlugin
java.lang.Object
org.apache.wiki.plugin.LanguagePlugin
- All Implemented Interfaces:
org.apache.wiki.api.plugin.Plugin
Shows the content that matches the language preference of the visitor, as the browser sends it in the
Accept-Language
header. The body holds one block per language, written as :xx:text:: with the language code between colons, and an optional
:else:text:: block for visitors that none of the blocks suits:
[{LanguagePlugin
:de:Willkommen:: :en:Welcome:: :else:Welcome / Willkommen::}]
The languages of the visitor are tried in the order of their quality values, and a block matches when its code is the language of
the tag, so de matches de-AT. Only the language is compared, not the region. If no block matches and there is no
:else: block, nothing is shown. The text of the chosen block is rendered as wiki markup. A block ends at the first
::, so the text of a block cannot contain it.
Parameters: none.
- Since:
- 3.0.1
-
Field Summary
Fields inherited from interface org.apache.wiki.api.plugin.Plugin
CORE_PLUGINS_RESOURCEBUNDLE -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
LanguagePlugin
public LanguagePlugin()
-
-
Method Details
-
getDisplayName
- Specified by:
getDisplayNamein interfaceorg.apache.wiki.api.plugin.Plugin
-
getSnipExample
- Specified by:
getSnipExamplein interfaceorg.apache.wiki.api.plugin.Plugin
-
execute
public String execute(org.apache.wiki.api.core.Context context, Map<String, String> params) throws org.apache.wiki.api.exceptions.PluginException- Specified by:
executein interfaceorg.apache.wiki.api.plugin.Plugin- Throws:
org.apache.wiki.api.exceptions.PluginException
-