From cdd1f5d46c8f7a6c807401e50e25cb5d2b7e59bc Mon Sep 17 00:00:00 2001 From: Magnus Manske Date: Fri, 30 Dec 2005 16:52:10 +0000 Subject: [PATCH] Commons upload license list language fix --- includes/Licenses.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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(); -- 2.20.1