mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SyntaxHighlight_GeSHi
synced 2024-11-15 02:24:07 +00:00
* Change function name on i18n file for SyntaxHighlight extension to compy with maintenance/language/checkExtensioni18n.php
* Update i18n.db for SyntaxHighlight
This commit is contained in:
parent
8cfe16db82
commit
ce5e258e78
|
@ -6,7 +6,7 @@
|
|||
* @addtogroup Extensions
|
||||
*/
|
||||
|
||||
function efSyntaxHighlightMessages() {
|
||||
function efSyntaxHighlight_GeSHiMessages() {
|
||||
return array(
|
||||
|
||||
/* English (Brion Vibber) */
|
||||
|
@ -37,6 +37,7 @@ function efSyntaxHighlightMessages() {
|
|||
'syntaxhighlight-specify' => 'Anda harus menentukan suatu bahasa seperti ini:',
|
||||
'syntaxhighlight-supported' => 'Bahasa-bahasa yang didukung oleh pewarnaan sintaks:',
|
||||
'syntaxhighlight-err-loading' => '(kesalahan pemuatan daftar bahasa yang didukung)',
|
||||
'syntaxhighlight-err-language' => 'Bahasa tak sah.',
|
||||
),
|
||||
|
||||
/* Italian (BrokenArrow) */
|
||||
|
|
|
@ -61,14 +61,14 @@ function syntaxHighlightLoadMessages() {
|
|||
}
|
||||
global $wgMessageCache;
|
||||
require_once( dirname( __FILE__ ) . '/SyntaxHighlight_GeSHi.i18n.php' );
|
||||
foreach( efSyntaxHighlightMessages() as $lang => $messages )
|
||||
foreach( efSyntaxHighlight_GeSHiMessages() as $lang => $messages )
|
||||
$wgMessageCache->addMessages( $messages, $lang );
|
||||
}
|
||||
|
||||
function syntaxHighlightHook( $text, $params = array(), $parser ) {
|
||||
if ( !class_exists( 'GeSHi' ) ) {
|
||||
require( 'geshi/geshi.php' );
|
||||
}
|
||||
}
|
||||
syntaxHighlightLoadMessages();
|
||||
return isset( $params['lang'] )
|
||||
? syntaxHighlightFormat( trim( $text ), $params, $parser )
|
||||
|
@ -110,8 +110,8 @@ function syntaxHighlightFormat( $text, $params, $parser ) {
|
|||
return syntaxHighlightHelp( $error );
|
||||
} else {
|
||||
$geshi->set_overall_class( "source-$lang" );
|
||||
$parser->mOutput->addHeadItem(
|
||||
"<style><!--\n" .
|
||||
$parser->mOutput->addHeadItem(
|
||||
"<style><!--\n" .
|
||||
$geshi->get_stylesheet( false ) .
|
||||
"--></style>\n",
|
||||
"source-$lang" );
|
||||
|
@ -124,8 +124,8 @@ function syntaxHighlightFormat( $text, $params, $parser ) {
|
|||
* @param string $error HTML error message
|
||||
*/
|
||||
function syntaxHighlightHelp( $error = false ) {
|
||||
return syntaxHighlightError(
|
||||
( $error ? "<p>$error</p>" : '' ) .
|
||||
return syntaxHighlightError(
|
||||
( $error ? "<p>$error</p>" : '' ) .
|
||||
'<p>' . wfMsg( 'syntaxhighlight-specify' ) . ' ' .
|
||||
'<samp><source lang="html">...</source></samp></p>' .
|
||||
'<p>' . wfMsg( 'syntaxhighlight-supported' ) . '</p>' .
|
||||
|
|
Loading…
Reference in a new issue