git-cheatsheet icon indicating copy to clipboard operation
git-cheatsheet copied to clipboard

Adding RTL mode for supporting RTL languages.

Open amiria703 opened this issue 2 years ago • 6 comments

Is your feature request related to a problem? Please describe. Hi! I want to contribute to this project and Persian language, but as it's a RTL language, forcing it to be shown LTR is not a good idea.

Describe the solution you'd like Adding a RTL mode for RTL languages.

Describe alternatives you've considered I don't know what to write here. :/

Additional context image Here, I added direction: rtl; for testing the layout.

amiria703 avatar Jun 01 '22 15:06 amiria703

This would be great. I can work out the layout issues with rtl if you can provide a translation. I can't do it at the moment, but I'll look at it in the next week and make a branch to contribute to.

ndp avatar Jun 01 '22 16:06 ndp

@amiria703 At the command level, is it still RTL, or does that switch to LTR at some point?

ndp avatar Jun 07 '22 21:06 ndp

WIP here https://github.com/ndp/git-cheatsheet/pull/42

ndp avatar Jun 07 '22 22:06 ndp

@ndp What does command level mean? Which part of website?

amiria703 avatar Jun 09 '22 17:06 amiria703

I don't know anything about rtl. I am also assuming you are working in a CLI (command line interface). I'm assuming this CLI is LTR and the commands are the same as the English version I'm familiar with. Please correct me if any of those assumptions are wrong.

I set up my German to be RTL, and I get screenshots like this:

Screen Shot 2022-06-09 at 10 53 15 AM Screen Shot 2022-06-09 at 10 53 04 AM

By "command", I mean what you type on the CLI. So what I'm doing is switching the "command" to be LTR... thanks for your help.

ndp avatar Jun 09 '22 18:06 ndp

It's ready to try out if you want to start a translation. There are instructions in 32a1103 To see RTL working, change the dir property of the language, per 1af3595

ndp avatar Jun 10 '22 00:06 ndp

This has been merged into the master branch if anyone wants to take a whack at translating a LTR language. My implementation may not be right, as I'm not sure how this works and don't currently have the language skills to know what is right and wrong. But the basic idea of text being able to be drawn the other way works.

ndp avatar Sep 07 '22 17:09 ndp