-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bidi support #2357
Bidi support #2357
Conversation
This approach looks great! Having a user toggle for locale makes sense to me. |
pinging @ellisonbg for design consideration. |
Could you please review ? |
@samarsultan Can you please resolve the merge conflicts for this PR? What is the current status? We are closing in on 5.1 release and if this is complete, then let's try to get it in there! |
@gnestor ,Conflicts have been resolved. The current status is having a mirrored UI with loading the dedicated Locale form momentJS. |
@samarsultan Excellent!! How do I set locale or enable mirroring? |
For now, you can do it by just setting the browser language to "ar" . However, it will be better to have a user toggle for locale as proposed above. |
I'm going to mark this as 5.2 and will merge into master as soon as 5.1 is released. This will everyone a chance to use it before it's released. |
5.1 is released so let's merge this and start testing it! |
if(_isMirroringEnabled()){ | ||
$("body").attr("dir","rtl"); | ||
} | ||
requirejs(['components/moment/locale/'+_uiLang()], function (err){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to special case en
and en-us
since the files are not there and are the builtins from moment: moment/moment#2081
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you already took care of it! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah I should have noted that again here. Good to go now.
Notebook 5.2.0rc1 is available on PyPI so please give it a try 👍:
|
@takluyver Should we add the following from https://github.com/jupyter/notebook/blob/master/notebook/i18n/README.md#how-the-language-is-selected- to the README?
|
I'd focus on getting the machinery for building and contributing translations in place first. |
Hello @Carreau ,
This pull request contains the bidi work and fixes the UI mirroring issues.
Here are some functions added such : LoadLocale -> to load the required locale that is defined at Momentjs based on the browser preferences setting . I propose to leave it to the user selection rather than the browser preferences and to create a UI component to toggle among the list of locales.
For Numeric Shaping : I need another component to toggle between the options.
With respect to National Calendar , I found an external plugin at Momentjs called moment-hijri that is dedicated to Hijri-calendar so I removed the related functions that were mentioned at the design. Actually I didn't find moment at the documentation . I'll put the links below :
http://momentjs.com/docs/#/plugins/hijri/
https://github.com/xsoh/moment-hijri
Could you please review ?
Waiting your comments. Thanks !