From: Magnus Manske Date: Fri, 30 Dec 2005 16:52:10 +0000 (+0000) Subject: Commons upload license list language fix X-Git-Tag: 1.6.0~840 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=cdd1f5d46c8f7a6c807401e50e25cb5d2b7e59bc;p=lhc%2Fweb%2Fwiklou.git Commons upload license list language fix --- diff --git a/includes/Licenses.php b/includes/Licenses.php index 36b5a7e846..5429b4c079 100644 --- a/includes/Licenses.php +++ b/includes/Licenses.php @@ -38,7 +38,20 @@ class Licenses { */ function Licenses( $str = null ) { // PHP sucks, this should be possible in the constructor - $this->msg = is_null( $str ) ? wfMsgForContent( 'licenses' ) : $str; + + global $wgLanguageCode ; + if ( is_null( $str ) ) { + # Try for language-localized license list; if not, try the deault + $t = 'licenses/'.$wgLanguageCode ; + $s = wfMsgForContent( $t ) ; + if ( $s == '<'.$t.'>' ) + $t = wfMsgForContent( 'licenses' ) ; + $this->msg = $s ; + } else { + # Use passed string + $this->msg = $str ; + } +# $this->msg = is_null( $str ) ? wfMsgForContent( 'licenses' ) : $str; # Old code, do not use! $this->html = ''; $this->makeLicenses();