Boostnote: Please add RTL support

Created on 4 Sep 2017  路  15Comments  路  Source: BoostIO/Boostnote

Please paste some screenshots with the developer tool open if you report a bug.

feature request funded on issuehunt help wanted

Most helpful comment

Lots of people use RLT language, please add it.
screen shot 1396-09-13 at 17 07 05
screen shot 1396-09-13 at 17 07 11

All 15 comments

memo: rtlMoveVisually: boolean https://codemirror.net/doc/manual.html

Lots of people use RLT language, please add it.
screen shot 1396-09-13 at 17 07 05
screen shot 1396-09-13 at 17 07 11

Guys, do you have any ideas how we can understand a note is written in RTL language?

Maybe we should not detect if language per note, but per user. If user's browser settings suggest he is using RTL language then the whole app should rearrange itself.

var language = window.navigator.userLanguage || window.navigator.language;

Also found this on Stackoverflow:

function isRTL(s){           
    var ltrChars    = 'A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02B8\u0300-\u0590\u0800-\u1FFF'+'\u2C00-\uFB1C\uFDFE-\uFE6F\uFEFD-\uFFFF',
        rtlChars    = '\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC',
        rtlDirCheck = new RegExp('^[^'+ltrChars+']*['+rtlChars+']');

    return rtlDirCheck.test(s);
};

@dariubs
Perhaps this person's cooperation can be helpful in this project
the following project belongs to him:
https://github.com/dariubs/rtlmd

@kazup01 cancelled funding, $20, of this issue. Visit this issue on Issuehunt

One solution can be adding a toggle-rtl option some place to change the preview mode to rtl and apply the appropriate styles to the preview pane. the settings could be consistent for each note (although not necessary).

please add rtl language like persian to boostnote

Would a rtl/ltr toggle suffice? @kazup01

@b3u That should be enough for a first version with RTL support. If we want a better way of detecting it in the future then we can add that at a later point.

Thanks for wanting to implement this feature!

There is also a direction library which checks a string and returns its direction based on the first (not neutral) character in the string. deciding the direction of each paragraph could be easier using this library, if dynamic changing of the direction is preferred.

Hey,

See #3282
I think that this satisfies the need for RTL support.

any ideas on improvements?

@ibraude could it be possible to add a direction: ltr and text-align: left property for the code tag that would always be LTR?

@tuxitop Yeah, good catch. I added that and also an option to set up a hotkey for direction toggle

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lijinglue picture lijinglue  路  3Comments

cyber-arsenull picture cyber-arsenull  路  3Comments

NonlinearFruit picture NonlinearFruit  路  3Comments

necan picture necan  路  3Comments

croulibri picture croulibri  路  3Comments