/**
* Language code for message documentation. Suggested values are qqq or info.
* If set to false (default), message documentation feature is disabled.
*/
$wgTranslateDocumentationLanguageCode = false;
/**
* Name of the bot which will invalidate translations and do maintenance
* for page translation feature. Also used for importing messages from external
* sources.
*/
$wgTranslateFuzzyBotName = 'FuzzyBot';
/**
* Add a preference "Do not send me email newsletters" in the email preferences.
*/
$wgTranslateNewsletterPreference = false;
/**
* Default values for list of languages to show translators as an aid when
* translating. Each user can override this setting in their preferences.
* Example:
* $wgTranslateLanguageFallbacks['fi'] = 'sv';
* $wgTranslateLanguageFallbacks['sv'] = array( 'da', 'no', 'nn' );
*/
$wgTranslateLanguageFallbacks = [];
/**
* Text that will be shown in translations if the translation is outdated.
* Must be something that does not conflict with actual content.
*/
if ( !defined( 'TRANSLATE_FUZZY' ) ) {
define( 'TRANSLATE_FUZZY', '!!FUZZY!!' );
}
/**
* Define various web services that provide translation suggestions.
*
* Translation memories are documented in our main documentation.
* @see https://www.mediawiki.org/wiki/Help:Extension:Translate/Translation_memories
*
* For Apertium, you should get an API key.
* @see http://wiki.apertium.org/wiki/Apertium_web_service
*
* Yandex translation helper also provides langlimit option to limit total
* number of suggestions (set to 0 to get all possible translations)
* and langorder array to sort languages. Yandex translate engine is based on
* wordnet, generated from search index, so number of indexed websites should be
* a good heuristic to define the default language order.
*
* The machine translation services are provided with the following information:
* - server ip address
* - versions of MediaWiki and Translate extension
* - clients ip address encrypted with $wgProxyKey
* - source text to translate
* - private API key if provided
*/
$wgTranslateTranslationDefaultService = 'TTMServer';
$wgTranslateTranslationServices = [];
$wgTranslateTranslationServices['TTMServer'] = [
'database' => false, // Passed to wfGetDB
'cutoff' => 0.75,
'type' => 'ttmserver',
'public' => false,
];
$wgTranslateTranslationServices['Microsoft'] = [
'url' => 'https://api.cognitive.microsofttranslator.com',
'key' => null,
'timeout' => 3,
'type' => 'microsoft',
];
$wgTranslateTranslationServices['Apertium'] = [
'url' => 'http://apy.projectjj.com/translate',
'pairs' => 'http://apy.projectjj.com/listPairs',
'key' => null,
'timeout' => 3,
'type' => 'apertium',
];
$wgTranslateTranslationServices['Yandex'] = [
'url' => 'https://translate.yandex.net/api/v1.5/tr.json/translate',
'key' => null,
'pairs' => 'https://translate.yandex.net/api/v1.5/tr.json/getLangs',
'timeout' => 3,
'langorder' => [ 'en', 'ru', 'uk', 'de', 'fr', 'pl', 'it', 'es', 'tr' ],
'langlimit' => 1,
'type' => 'yandex',
];
/**
* Experimental support for an "Ask" help button.
* Might change into a hook later on.
* This is an array with keys page, url and params.
* - page is a title of a local wiki page
* - url is an URL to use as is (e.g. an issue tracker submission form)
* which will override the page if set
* - params is an array of key-value pairs of request params
* -- each param value can contain the variable %MESSAGE%
* which will be replaced with the full page name.
* @since 2011-03-11
*/
$wgTranslateSupportUrl = false;
/**
* Like $wgTranslateSupportUrl, but for a specific namespace.
* Each $wgTranslateSupportUrl-like array needs to be the value
* assigned to the numerical ID of a namespace of the wiki.
* @since 2015.09
*/
$wgTranslateSupportUrlNamespace = [];
/**
* When unprivileged users open a translation editor, they will
* see a message stating that a special permission is needed for translating
* messages. If this variable is defined, there is a button which will
* take the user to that page to ask for permission.
* The target needs to be reiterated with the second variable to have
* the same result with sandbox enabled where users can't enter the sandbox.
*/
$wgTranslatePermissionUrl = 'Project:Translator';
$wgTranslateSecondaryPermissionUrl = 'Project:Translator';
#
# === Page translation feature ===
#
# === Message group configuration ===
#
# === System setup related configuration ===
#
# ==== PHPlot ====
#
# ==== YAML driver ====
#
# ==== Sandbox ====
#
# === Unsorted ===
#
/**
* Helper function for adding namespace for message groups.
*
* It defines constants for the namespace (and talk namespace) and sets up
* restrictions and some other configuration.
* @param int $id Namespace number
* @param string $name Name of the namespace
* @param string|null $constant (optional) name of namespace constant, defaults to
* NS_ followed by upper case version of $name, e.g., NS_MEDIAWIKI
*/
function wfAddNamespace( $id, $name, $constant = null ) {
global $wgExtraNamespaces, $wgContentNamespaces, $wgTranslateMessageNamespaces,
$wgNamespaceProtection, $wgNamespacesWithSubpages, $wgNamespacesToBeSearchedDefault;
if ( is_null( $constant ) ) {
$constant = strtoupper( "NS_$name" );
}
define( $constant, $id );
define( $constant . '_TALK', $id + 1 );
$wgExtraNamespaces[$id] = $name;
$wgExtraNamespaces[$id + 1] = $name . '_talk';
$wgContentNamespaces[] = $id;
$wgTranslateMessageNamespaces[] = $id;
$wgNamespacesWithSubpages[$id] = true;
$wgNamespacesWithSubpages[$id + 1] = true;
$wgNamespaceProtection[$id] = [ 'translate' ];
$wgNamespacesToBeSearchedDefault[$id] = true;
}
/** @defgroup TranslateSpecialPage Special pages of Translate extension */