From 4013cd8b17fdda27abe922c06e265f6979d5e12b Mon Sep 17 00:00:00 2001 From: samarsultan Date: Sun, 5 Mar 2017 10:25:50 +0200 Subject: [PATCH] enable the localization mode --- notebook/static/edit/js/main.js | 7 ++++++- notebook/static/notebook/js/main.js | 9 +++++++-- notebook/static/tree/js/main.js | 13 +++++++++---- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/notebook/static/edit/js/main.js b/notebook/static/edit/js/main.js index 958d2b711..37d5e1b89 100644 --- a/notebook/static/edit/js/main.js +++ b/notebook/static/edit/js/main.js @@ -13,6 +13,7 @@ require([ 'edit/js/menubar', 'edit/js/savewidget', 'edit/js/notificationarea', + 'bidi/bidi', ], function( $, contents_service, @@ -24,12 +25,16 @@ require([ editmod, menubar, savewidget, - notificationarea + notificationarea, + bidi ){ "use strict"; try { requirejs(['custom/custom'], function() {}); + bidi.loadLocale(bidi.uiLang()); + bidi.setNumericShaping("national"); + bidi.isMirroringEnabled(); } catch(err) { console.log("Error loading custom.js from edition service. Continuing and logging"); console.warn(err); diff --git a/notebook/static/notebook/js/main.js b/notebook/static/notebook/js/main.js index 6f2e82e01..34b8230ef 100644 --- a/notebook/static/notebook/js/main.js +++ b/notebook/static/notebook/js/main.js @@ -42,7 +42,8 @@ require([ 'codemirror/lib/codemirror', 'notebook/js/about', 'notebook/js/searchandreplace', - 'notebook/js/clipboard' + 'notebook/js/clipboard', + 'bidi/bidi' ], function( $, contents_service, @@ -65,7 +66,8 @@ require([ CodeMirror, about, searchandreplace, - clipboard + clipboard, + bidi ) { "use strict"; @@ -74,6 +76,9 @@ require([ try{ requirejs(['custom/custom'], function() {}); + bidi.loadLocale(bidi.uiLang()); + bidi.setNumericShaping("national"); + bidi.isMirroringEnabled(); } catch(err) { console.log("Error processing custom.js. Logging and continuing"); console.warn(err); diff --git a/notebook/static/tree/js/main.js b/notebook/static/tree/js/main.js index e087a8292..655e7d153 100644 --- a/notebook/static/tree/js/main.js +++ b/notebook/static/tree/js/main.js @@ -35,6 +35,7 @@ require([ 'tree/js/terminallist', 'tree/js/newnotebook', 'auth/js/loginwidget', + 'bidi/bidi', ], function( $, contents_service, @@ -49,18 +50,22 @@ require([ kernellist, terminallist, newnotebook, - loginwidget){ + loginwidget, + bidi){ "use strict"; try{ requirejs(['custom/custom'], function() {}); + bidi.loadLocale(bidi.uiLang()); + bidi.setNumericShaping("national"); + bidi.setCalendarType("hijri"); + bidi.isMirroringEnabled(); } catch(err) { console.log("Error loading custom.js from tree service. Continuing and logging"); console.warn(err); } - console.log('Welcome to Project Jupyter! Explore the various tools available and their corresponding documentation. If you are interested in contributing to the platform, please visit the community resources section at http://jupyter.org/community.html.'); - - + + // Setup all of the config related things var common_options = {