Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -2566,6 +2566,7 @@ |
2567 | 2567 | 'comma-separator', |
2568 | 2568 | 'colon-separator', |
2569 | 2569 | 'autocomment-prefix', |
| 2570 | + 'pipe-separator', |
2570 | 2571 | ), |
2571 | 2572 | 'imgmulti' => array( |
2572 | 2573 | 'imgmultipageprev', |
Index: trunk/phase3/maintenance/language/messageTypes.inc |
— | — | @@ -315,6 +315,7 @@ |
316 | 316 | 'comma-separator', |
317 | 317 | 'colon-separator', |
318 | 318 | 'autocomment-prefix', |
| 319 | + 'pipe-separator', |
319 | 320 | 'listgrouprights-right-display', |
320 | 321 | 'timezone-utc', |
321 | 322 | 'whatlinkshere-backlink', |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -3437,6 +3437,7 @@ |
3438 | 3438 | 'comma-separator' => ', ', # only translate this message to other languages if you have to change it |
3439 | 3439 | 'colon-separator' => ': ', # only translate this message to other languages if you have to change it |
3440 | 3440 | 'autocomment-prefix' => '- ', # only translate this message to other languages if you have to change it |
| 3441 | +'pipe-separator' => '|', # only translate this message to other languages if you have to change it |
3441 | 3442 | |
3442 | 3443 | # Multipage image navigation |
3443 | 3444 | 'imgmultipageprev' => '← previous page', |
Index: trunk/phase3/languages/Language.php |
— | — | @@ -1902,13 +1902,35 @@ |
1903 | 1903 | /** |
1904 | 1904 | * Take a list of strings and build a locale-friendly comma-separated |
1905 | 1905 | * list, using the local comma-separator message. |
1906 | | - * @fixme Fix this so it can work for $wgContLang too |
| 1906 | + * @param $list array of strings to put in a comma list |
| 1907 | + * @param $forContent bool Use $wgContentLang instead of the UI lang |
| 1908 | + * @return string |
1907 | 1909 | */ |
1908 | | - function commaList( $list ) { |
| 1910 | + function commaList( $list, $forContent = false ) { |
| 1911 | + $params = array( 'escapenoentities' ); |
| 1912 | + if ( $forContent === true ) { |
| 1913 | + $params[] = 'content'; |
| 1914 | + } |
1909 | 1915 | return implode( |
1910 | 1916 | $list, |
1911 | | - wfMsgExt( 'comma-separator', 'escapenoentities' ) ); |
| 1917 | + wfMsgExt( 'comma-separator', $params ) ); |
1912 | 1918 | } |
| 1919 | + |
| 1920 | + /** |
| 1921 | + * Same as commaList, but separate it with the pipe instead. |
| 1922 | + * @param $list array of strings to put in a pipe list |
| 1923 | + * @param $forContent bool Use $wgContentLang instead of the UI lang |
| 1924 | + * @return string |
| 1925 | + */ |
| 1926 | + function pipeList( $list, $forContent = false ) { |
| 1927 | + $params = array( 'escapenoentities' ); |
| 1928 | + if ( $forContent === true ) { |
| 1929 | + $params[] = 'content'; |
| 1930 | + } |
| 1931 | + return implode( |
| 1932 | + $list, |
| 1933 | + wfMsgExt( 'pipe-separator', $params ) ); |
| 1934 | + } |
1913 | 1935 | |
1914 | 1936 | /** |
1915 | 1937 | * Truncate a string to a specified length in bytes, appending an optional |