From f2ab61387a295c3a1f358646aa30686fe10ed3cb Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Fri, 30 Jan 2004 14:50:26 +0000 Subject: [PATCH] Avoiding use of tag in Japanese --- includes/Skin.php | 22 ++++++++++++---------- languages/Language.php | 6 ++++++ languages/LanguageJa.php | 6 ++++++ 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/includes/Skin.php b/includes/Skin.php index 88df4453f4..bc2eb5e908 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -341,7 +341,7 @@ class Skin { function afterContent() { global $wgUser, $wgOut, $wgServer; - global $wgTitle; + global $wgTitle, $wgLang; if ( $wgOut->isPrintable() ) { $s = "\n\n"; @@ -355,7 +355,7 @@ class Skin { } else { $lm = ""; } $cr = wfMsg( "gnunote" ); - $s .= "

{$rf}{$lm} {$cr}\n"; + $s .= "

" . $wgLang->emphasize("{$rf}{$lm} {$cr}\n"); return $s; } return $this->doAfterContent(); @@ -1685,7 +1685,7 @@ class Skin { # Enhanced RC ungrouped line function recentChangesBlockLine ( $rcObj ) { - global $wgUploadPath ; + global $wgUploadPath, $wgLang ; # Get rc_xxxx variables extract( $rcObj->mAttribs ) ; @@ -1736,8 +1736,9 @@ class Skin { $r .= $rcObj->usertalklink ; # Comment - if ( $rc_comment != "" && $rc_type != RC_MOVE ) - $r .= " (".wfEscapeHTML($rc_comment).")" ; + if ( $rc_comment != "" && $rc_type != RC_MOVE ) { + $r .= $wgLang->emphasize( " (".wfEscapeHTML($rc_comment).")" ); + } $r .= "
\n" ; return $r ; } @@ -1745,7 +1746,7 @@ class Skin { # Enhanced RC group function recentChangesBlockGroup ( $block ) { - global $wgUploadPath ; + global $wgUploadPath, $wgLang ; $r = "" ; $M = wfMsg( "minoreditletter" ); @@ -1848,8 +1849,9 @@ class Skin { $r .= $rcObj->lastlink ; $r .= ") . . ".$rcObj->userlink ; $r .= $rcObj->usertalklink ; - if ( $rc_comment != "" ) - $r .= " (".wfEscapeHTML($rc_comment).")" ; + if ( $rc_comment != "" ) { + $r .= $wgLang->emphasize( " (".wfEscapeHTML($rc_comment).")" ) ; + } $r .= "
\n" ; } $r .= "\n" ; @@ -1985,7 +1987,7 @@ class Skin { # Add comment if ( "" != $rc_comment && "*" != $rc_comment && $rc_type != RC_MOVE ) { - $s .= " (" . wfEscapeHTML( $rc_comment ) . ")"; + $s .= $wgLang->emphasize(" (" . wfEscapeHTML( $rc_comment ) . ")"); } $s .= "\n"; @@ -2144,7 +2146,7 @@ class Skin { . " . . {$ul} ({$nb})"; if ( "" != $c && "*" != $c ) { - $s .= " (" . wfEscapeHTML( $c ) . ")"; + $s .= $wgLang->emphasize(" (" . wfEscapeHTML( $c ) . ")"); } $s .= "\n"; return $s; diff --git a/languages/Language.php b/languages/Language.php index d74f8ab5f2..96255492ef 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -1639,6 +1639,12 @@ class Language { $mw->mCaseSensitive = $rawEntry[0]; $mw->mSynonyms = array_slice( $rawEntry, 1 ); } + + # Italic is unsuitable for some languages + function emphasize( $text ) + { + return "$text"; + } } @include_once( "Language" . ucfirst( $wgLanguageCode ) . ".php" ); diff --git a/languages/LanguageJa.php b/languages/LanguageJa.php index a511a1180c..fb1fdfa5e2 100644 --- a/languages/LanguageJa.php +++ b/languages/LanguageJa.php @@ -1174,6 +1174,12 @@ class LanguageJa extends LanguageUtf8 { return $s; } + # Italic is not appropriate for Japanese script + # Unfortunately most browsers do not recognise this, and render as italic + function emphasize( $text ) + { + return "$text"; + } } ?> -- 2.20.1