Hilfe:Erweiterung:Übersetzen/Gruppenkonfiguration/MediaWiki

This page is a translated version of the page Help:Extension:Translate/Group configuration/MediaWiki and the translation is 79% complete.

This is documentation how to set up MediaWiki extension groups using the simple text configuration file. Es ist nützlich, wenn du Hunderte an Erweiterungen hast.

Diese Konfiguration geht in LocalSettings.php im MediaWiki-Verzeichnis.

require "$IP/extensions/Translate/Translate.php";

$wgHooks['TranslatePostInitGroups'][] = function ( &$list, &$deps, &$autoload ) {
	$def = "/path/to/mediawiki-extensions.txt";
	$path = '%GROUPROOT%/extensions/';

	$parser = new PremadeMediawikiExtensionGroups( $def, $path );
	$parser->register( $list, $deps, $autoload );

	return true;
}

Konfigurationsdatei

Hier ist ein Beispiel für eine Konfigurierungsdatei:

Simple Extension

Complex Extension
desc = Some text here.
ignored = sidebar, robots.txt
optional = grouppage-recursive-export
prefix = wmf- | sidebar, grouppage-Staff, group-Staff, group-Staff-member
aliasfile = ComplexExtension.alias.php
magicfile = ComplexExtension.magic.php

Die allgemeine Syntax ist: Name der Erweiterung gefolgt von einer Liste von Schlüsseln und Werten und eine leere Zeile vor der nächsten Erweiterung.

ExtensionName - Name der Erweiterung mit entfernten Leerzeichen.

Die verfügbaren Schlüssel sind:

aliasfile
Location of file containing special page alias translations for this extension relative to $wgTranslateExtensionDirectory
desc
Beschreibung der Erweiterung, die Übersetzern angezeigt wird
descmsg
A page in MediaWiki namespace containing the description of the extension shown to translators
file
Ort der Datei, die Nachrichten für diese Erweiterung enthält. Default value depends on the format:
  • php: ExtensionName/ExtensionName.i18n.php
  • json: ExtensionName/i18n/%CODE%.json
format
Dateiformat, welches von der Erweiterung verwendet wird. Unterstützte Werte sind php und json. Standard: format = php
id
Nachrichtengruppen-ID. Standardwert ist ExtensionName in Kleinbuchstaben mit dem Präfix ext-. For example, "Complex Extension" has default id of "ext-complexextension"
ignored
List of comma separated message keys which will not be shown for the translators. This key can be present in multiple times to split the list into multiple lines.
magicfile
Location of file containing magic word translations for this extension relative to $wgTranslateExtensionDirectory
optional
List of comma separated message keys which will be shown to translators only if they select to see optional messages. Optional messages are not counted as untranslated messages, but translated optional messages are counted as translated. This key can be present multiple times.
prefix
To handle conflicting message keys, you can prefix given messages. The syntax is first to have the prefix separated by pipe from comma separated list of message keys. This key can be present multiple times.
var
Name of the php variable holding the messages. Defaults to $messages.