Nápověda:Rozšíření:Translate/Group configuration/MediaWiki

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

Toto je dokumentace, jak nastavit skupiny rozšíření MediaWiki pomocí jednoduchého textového konfiguračního souboru. Je to užitečné, pokud máte stovky rozšíření.

Tato konfigurace se vkládá do LocalSettings.php v adresáři MediaWiki.

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;
}

Konfigurační soubor

Zde je příklad konfiguračního souboru:

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

Obecná syntaxe je: Název přípony následovaný seznamem klíčů a hodnot a jeden prázdný řádek před další příponou.

ExtensionName - Název přípony s odstraněnými mezerami.

Dostupné klíče jsou:

aliasfile
Umístění souboru obsahujícího speciální překlady aliasů stránky pro toto rozšíření vzhledem k $wgTranslateExtensionDirectory
desc
Description of the extension shown to translators
descmsg
A page in MediaWiki namespace containing the description of the extension shown to translators
file
Location of the file containing messages for this extension. Default value depends on the format:
  • php: ExtensionName/ExtensionName.i18n.php
  • json: ExtensionName/i18n/%CODE%.json
format
File format used by the extension. Supported values are php and json. Default: format = php
id
Message group id. Default value is ExtensionName in lowercase prefixed with 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.