Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -676,9 +676,9 @@ |
677 | 677 | * <i>parsemag</i>: transform the message using magic phrases |
678 | 678 | * <i>content</i>: fetch message for content language instead of interface |
679 | 679 | * Also can accept a single associative argument, of the form 'language' => 'xx': |
680 | | - * <i>language</i>: language code to fetch message for (overriden by |
681 | | - * <i>content</i>), its behaviour with parser, parseinline and parsemag |
682 | | - * is undefined. |
| 680 | + * <i>language</i>: Language object or language code to fetch message for |
| 681 | + * (overriden by <i>content</i>), its behaviour with parser, parseinline |
| 682 | + * and parsemag is undefined. |
683 | 683 | * Behavior for conflicting options (e.g., parse+parseinline) is undefined. |
684 | 684 | */ |
685 | 685 | function wfMsgExt( $key, $options ) { |
— | — | @@ -706,12 +706,7 @@ |
707 | 707 | $langCode = true; |
708 | 708 | } elseif( array_key_exists('language', $options) ) { |
709 | 709 | $forContent = false; |
710 | | - $langCode = $options['language']; |
711 | | - $validCodes = array_keys( Language::getLanguageNames() ); |
712 | | - if( !in_array($options['language'], $validCodes) ) { |
713 | | - # Fallback to en, instead of whatever interface language we might have |
714 | | - $langCode = 'en'; |
715 | | - } |
| 710 | + $langCode = wfGetLangObj( $options['language'] ); |
716 | 711 | } else { |
717 | 712 | $forContent = false; |
718 | 713 | $langCode = false; |
Index: trunk/phase3/languages/Language.php |
— | — | @@ -1903,33 +1903,23 @@ |
1904 | 1904 | * Take a list of strings and build a locale-friendly comma-separated |
1905 | 1905 | * list, using the local comma-separator message. |
1906 | 1906 | * @param $list array of strings to put in a comma list |
1907 | | - * @param $forContent bool Use $wgContentLang instead of the UI lang |
1908 | 1907 | * @return string |
1909 | 1908 | */ |
1910 | 1909 | function commaList( $list, $forContent = false ) { |
1911 | | - $params = array( 'escapenoentities' ); |
1912 | | - if ( $forContent === true ) { |
1913 | | - $params[] = 'content'; |
1914 | | - } |
1915 | 1910 | return implode( |
1916 | 1911 | $list, |
1917 | | - wfMsgExt( 'comma-separator', $params ) ); |
| 1912 | + wfMsgExt( 'comma-separator', array( 'escapenoentities', 'language' => $this ) ) ); |
1918 | 1913 | } |
1919 | 1914 | |
1920 | 1915 | /** |
1921 | 1916 | * Same as commaList, but separate it with the pipe instead. |
1922 | 1917 | * @param $list array of strings to put in a pipe list |
1923 | | - * @param $forContent bool Use $wgContentLang instead of the UI lang |
1924 | 1918 | * @return string |
1925 | 1919 | */ |
1926 | | - function pipeList( $list, $forContent = false ) { |
1927 | | - $params = array( 'escapenoentities' ); |
1928 | | - if ( $forContent === true ) { |
1929 | | - $params[] = 'content'; |
1930 | | - } |
| 1920 | + function pipeList( $list ) { |
1931 | 1921 | return implode( |
1932 | 1922 | $list, |
1933 | | - wfMsgExt( 'pipe-separator', $params ) ); |
| 1923 | + wfMsgExt( 'pipe-separator', array( 'escapenoentities', 'language' => $this ) ) ); |
1934 | 1924 | } |
1935 | 1925 | |
1936 | 1926 | /** |