echo <<<END
Run this script to rewrite the messages array in the files languages/messages/MessagesXX.php.
Parameters:
\t* lang: Language code (default: the installation default language). You can also specify "all" to check all the languages.
\t* help: Show this help.
Options:
\t* dry-run: Don't write the array to the file.
\t* no-unknown: Don't list the unknown messages.

END;
    exit;
}
# Get the language code
if (isset($options['lang'])) {
    $wgCode = $options['lang'];
} else {
    $wgCode = $wgContLang->getCode();
}
# Get the options
$wgWriteToFile = !isset($options['dry-run']);
$wgListUnknownMessages = !isset($options['no-unknown']);
# Get language objects
$wgLanguages = new languages();
# Write all the language
if ($wgCode == 'all') {
    foreach ($wgLanguages->getLanguages() as $language) {
        rebuildLanguage($language, $wgWriteToFile, $wgListUnknownMessages);
    }
} else {
    rebuildLanguage($wgCode, $wgWriteToFile, $wgListUnknownMessages);
}
示例#2
0
TEXT;
    exit(1);
}
# Get the language code
if (isset($options['lang'])) {
    $wgCode = $options['lang'];
} else {
    $wgCode = $wgContLang->getCode();
}
# Get the duplicate message source
if (isset($options['remove-duplicates']) && strcmp($options['remove-duplicates'], '')) {
    $wgDupeMessageSource = $options['remove-duplicates'];
} else {
    $wgDupeMessageSource = '';
}
# Get the options
$wgWriteToFile = !isset($options['dry-run']);
$wgListUnknownMessages = !isset($options['no-unknown']);
$wgRemoveUnknownMessages = isset($options['remove-unknown']);
$wgRemoveDuplicateMessages = isset($options['remove-duplicates']);
$messagesFolder = isset($options['messages-folder']) ? $options['messages-folder'] : false;
# Get language objects
$languages = new languages();
# Write all the language
if ($wgCode == 'all') {
    foreach ($languages->getLanguages() as $languageCode) {
        rebuildLanguage($languages, $languageCode, $wgWriteToFile, $wgListUnknownMessages, $wgRemoveUnknownMessages, $wgRemoveDuplicateMessages, $wgDupeMessageSource, $messagesFolder);
    }
} else {
    rebuildLanguage($languages, $wgCode, $wgWriteToFile, $wgListUnknownMessages, $wgRemoveUnknownMessages, $wgRemoveDuplicateMessages, $wgDupeMessageSource, $messagesFolder);
}
示例#3
0
# Show help
if (isset($options['help'])) {
    echo <<<END
Run this script to rewrite the messages array in the files languages/messages/MessagesXX.php.
Parameters:
\t* lang: Language code (default: the installation default language). You can also specify "all" to check all the languages.
\t* help: Show this help.
Options:
\t* dry-run: Don't write the array to the file.

END;
    exit;
}
# Get the language code
if (isset($options['lang'])) {
    $wgCode = $options['lang'];
} else {
    $wgCode = $wgContLang->getCode();
}
# Get the write options
$wgWriteToFile = !isset($options['dry-run']);
# Get language objects
$wgLanguages = new languages();
# Write all the language
if ($wgCode == 'all') {
    foreach ($wgLanguages->getLanguages() as $language) {
        rebuildLanguage($language, $wgWriteToFile);
    }
} else {
    rebuildLanguage($wgCode, $wgWriteToFile);
}