Index: trunk/extensions/JSBreadCrumbs/JSBreadCrumbs.i18n.php |
— | — | @@ -13,4 +13,6 @@ |
14 | 14 | */ |
15 | 15 | $messages['en'] = array( |
16 | 16 | 'jsbreadcrumbs-desc' => 'Adds a trail of breadcrumbs below the tab bar.', |
| 17 | + 'jsbreadcrumbs-separator' => '»', |
| 18 | + 'jsbreadcrumbs-leading-description' => 'Navigation trail', |
17 | 19 | ); |
Index: trunk/extensions/JSBreadCrumbs/JSBreadCrumbs.php |
— | — | @@ -17,8 +17,9 @@ |
18 | 18 | # http://www.gnu.org/copyleft/gpl.html |
19 | 19 | |
20 | 20 | $wgJSBreadCrumbsMaxCrumbs = 5; |
21 | | -$wgJSBreadCrumbsSeparator = "»"; |
22 | | -$wgJSBreadCrumbsCookiePath = "/"; |
| 21 | +//BreadCrumbsSeparator default set via localization |
| 22 | +$wgJSBreadCrumbsSeparator = ''; |
| 23 | +$wgJSBreadCrumbsCookiePath = '/'; |
23 | 24 | |
24 | 25 | // Sets Credits |
25 | 26 | $wgExtensionCredits['other'][] = array( |
Index: trunk/extensions/JSBreadCrumbs/js/BreadCrumbs.js |
— | — | @@ -10,6 +10,9 @@ |
11 | 11 | if ( typeof wgJSBreadCrumbsCookiePath == "undefined" ) { |
12 | 12 | wgJSBreadCrumbsCookiePath = "/"; |
13 | 13 | } |
| 14 | + if ( typeof wgJSBreadCrumbsLeadingDescription == "undefined" ) { |
| 15 | + wgJSBreadCrumbsLeadingDescription = "Navigation trail"; |
| 16 | + } |
14 | 17 | |
15 | 18 | var titleState = ( $j.cookie( 'mwext-bc-title' ) || "" ).split( wgJSBreadCrumbsSeparator ); |
16 | 19 | var urlState = ( $j.cookie( 'mwext-bc-url' ) || "" ).split( wgJSBreadCrumbsSeparator ); |
— | — | @@ -30,6 +33,8 @@ |
31 | 34 | urlState.splice( matchTitleIndex, 1 ); |
32 | 35 | } |
33 | 36 | |
| 37 | + mwextbc.append( wgJSBreadCrumbsLeadingDescription ); |
| 38 | + |
34 | 39 | for ( var i = 0; i < titleState.length; i++ ) { |
35 | 40 | mwextbc.append( '<a href="' + urlState[i] + '">' + titleState[i] + '</a> ' + wgJSBreadCrumbsSeparator + ' ' ); |
36 | 41 | } |
Index: trunk/extensions/JSBreadCrumbs/JSBreadCrumbs.hooks.php |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | function addResources( $out ) { |
6 | 6 | global $wgExtensionAssetsPath; |
7 | 7 | |
8 | | - $out->addScriptFile( "$wgExtensionAssetsPath/JSBreadCrumbs/js/BreadCrumbs.js", 3 ); |
| 8 | + $out->addScriptFile( "$wgExtensionAssetsPath/JSBreadCrumbs/js/BreadCrumbs.js", 4 ); |
9 | 9 | $out->addExtensionStyle( "$wgExtensionAssetsPath/JSBreadCrumbs/css/BreadCrumbs.css?1" ); |
10 | 10 | |
11 | 11 | return true; |
— | — | @@ -16,11 +16,21 @@ |
17 | 17 | public static function addJSVars( $vars ) { |
18 | 18 | global $wgJSBreadCrumbsMaxCrumbs, $wgJSBreadCrumbsSeparator, $wgJSBreadCrumbsCookiePath; |
19 | 19 | |
| 20 | + wfLoadExtensionMessages( 'JSBreadCrumbs' ); |
| 21 | + |
| 22 | + // Allow localized separator to be overriden |
| 23 | + if ( $wgJSBreadCrumbsSeparator !== '' ) { |
| 24 | + $separator = $wgJSBreadCrumbsSeparator; |
| 25 | + } else { |
| 26 | + $separator = wfMsg( "jsbreadcrumbs-separator" ); |
| 27 | + } |
| 28 | + |
20 | 29 | $variables = array(); |
21 | 30 | |
22 | 31 | $variables['wgJSBreadCrumbsMaxCrumbs'] = $wgJSBreadCrumbsMaxCrumbs; |
23 | | - $variables['wgJSBreadCrumbsSeparator'] = $wgJSBreadCrumbsSeparator; |
| 32 | + $variables['wgJSBreadCrumbsSeparator'] = $separator; |
24 | 33 | $variables['wgJSBreadCrumbsCookiePath'] = $wgJSBreadCrumbsCookiePath; |
| 34 | + $variables['wgJSBreadCrumbsLeadingDescription'] = wfMsg( "jsbreadcrumbs-leading-description" ); |
25 | 35 | |
26 | 36 | $vars = array_merge( $vars, $variables ); |
27 | 37 | return true; |