Skip to content
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

Support right-to-left languages #26

Closed
MajidCS opened this issue Jan 11, 2017 · 13 comments
Closed

Support right-to-left languages #26

MajidCS opened this issue Jan 11, 2017 · 13 comments
Milestone

Comments

@MajidCS
Copy link

MajidCS commented Jan 11, 2017

Hi,

this project is cool and i want use it. but it does not support RTL language. could you pleas consider adding this feature?

For example : Bi-directional Text Demo

Thanks a lot

@AndreYonadam
Copy link
Contributor

Interesting. I got somewhere but right clicking on the textfield and clicking the following to change the direction of the writing. This was in Chrome.
image

However the overlay was still doing left to right so I'm assuming there is a way to do that also using CSS.
image

@AndreYonadam
Copy link
Contributor

How's it going @MajidCS . What are the symptoms you are exhibiting when using RTL other than the overlay is not on the correct side?

@AndreYonadam
Copy link
Contributor

I think I might know the first for this. I will probably get to it sometime in the next few days.

@AndreYonadam
Copy link
Contributor

Just as a heads up. Safari also has a feature that allows setting the text direction as shown below.
image

If you want to change the direction to RTL I've found that all you have to do is add a direction property with rtl as the css value to the container that holds both the textarea and the span elements.

@kazzkiq kazzkiq added this to the v0.3.0 milestone Jan 17, 2017
@kazzkiq
Copy link
Owner

kazzkiq commented Jan 17, 2017

A quick text-align: right on .CodeFlask__textarea and .CodeFlask__code should do most of the job.

The problem is that indentation should also get handled properly on RTL mode (which means there would be changes on JS as well as CSS). I believe this should be added as an option to .run()/.runAll() functions. Something like:

const flask = new CodeFlask;
flask.run('#editor', {language: 'javascript', rtl: true}) // add rlt functionality

@AndreYonadam
Copy link
Contributor

@kazzkiq That's what I was mentioning too. I might be able to write something up that includes both allowing people to select the RTL mode on runtime when running the editor and also some JS code that listens to the changes to the textarea text-align css property that changes the placeholder one as well.

@kazzkiq
Copy link
Owner

kazzkiq commented Jan 17, 2017

@AndreYonadam awesome! Once you move forward with the code, or if you get in any trouble, please let us know.

@AndreYonadam
Copy link
Contributor

Pull request #28 fixes all these features just as described.

@MajidCS
Copy link
Author

MajidCS commented Jan 18, 2017

@AndreYonadam @kazzkiq Thanks guys

@AndreYonadam
Copy link
Contributor

@MajidCS Sure thing. I've been working on it but it seems that it's not producing an idea result. I'm not really familiar with how it's supposed to work but it seems like it's a limitation for all textareas when in RTL mode. Check the gif @kazzkiq has posted in #28 . We're getting mis-formatting for some reason.

@MajidCS
Copy link
Author

MajidCS commented Jan 18, 2017

@AndreYonadam

We need this mostly with Markdown

it's working

thank you

@AndreYonadam
Copy link
Contributor

@MajidCS Wow thanks for the testing. I wasn't able to test it because I didn't know what the expected output was. Thanks again.

@kazzkiq
Copy link
Owner

kazzkiq commented Jan 18, 2017

PR #28 fixes this.

@kazzkiq kazzkiq closed this as completed Jan 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants