Podręcznik:$wgExtensionMessagesFiles
Rozszerzenia: $wgExtensionMessagesFiles | |
---|---|
Pliki komunikatów dla rozszerzeń. |
|
Wprowadzono w wersji: | 1.11.0 |
Usunięto w wersji: | nadal w użyciu |
Dozwolone wartości: | (tablica) |
Domyślna wartość: | [] |
Inne ustawienia: Alfabetycznie | Według funkcji |
This global variable must only be used to specify the paths to internationalization files that define magic words , special page aliases and/or namespace names .
For message files , use $wgMessagesDirs
instead and avoid overlap in variable names.
If there is an entry in $wgMessagesDirs
with the same key as one in $wgExtensionMessagesFiles
, $wgMessagesDirs
will take precedence over the other.
Przykład
The ConfirmEdit extension contains a PHP file, ConfirmEdit.alias.php
, which defines language-specific aliases for a special page (Special:Captcha).
If the extension were to define the variable directly in PHP, it would have something like this:
$wgExtensionMessagesFiles['ConfirmEditAlias'] = __DIR__ . '/ConfirmEdit.alias.php';
extension.json
Instead of using our global variable directly, modern extensions like ConfirmEdit set the equivalent field ExtensionMessagesFiles
in the extension.json
file.
This field corresponds directly with $wgExtensionMessagesFiles
:
"ExtensionMessagesFiles": {
"ConfirmEditAlias": "ConfirmEdit.alias.php"
},
Zobacz też
- $wgMessagesDirs - global variable for messages
- Requests for comment/Localisation format for background
- Lokalizacja
- zadanie T220757 - "Deprecate use of wgExtensionMessagesFiles in favour of wgMessagesDirs and others" (submitted in 2019)