LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-25-2005, 11:19 AM   #1
gamor
Member
 
Registered: Jul 2004
Posts: 77

Rep: Reputation: 15
reading from right to left


Hello, I have mandrake 10.1. While installing it, i chose support for both English and Arabic ( I have UTF-8 as default). When I open a file using vi, I get arabic letter written form left to right while they should be written from right to left.
Would anyone know how to fix this problem
thanks
 
Old 08-25-2005, 01:26 PM   #2
corfe
Member
 
Registered: Dec 2004
Location: Washington State, USA
Distribution: Debian Sid
Posts: 128

Rep: Reputation: 16
It looks like vi has a special command line option for arabic / right-to-left languages, as long as it was compiled with support for it.

Try running "vi -A" instead of just "vi".

If this works for you, you'll want to put in your bash profile somewhere :

alias vi='vi -A'
 
Old 08-25-2005, 01:48 PM   #3
gamor
Member
 
Registered: Jul 2004
Posts: 77

Original Poster
Rep: Reputation: 15
That worked. But you know what, the english words are now written backwards. My files have both english and arabic text!!
 
Old 08-25-2005, 02:04 PM   #4
corfe
Member
 
Registered: Dec 2004
Location: Washington State, USA
Distribution: Debian Sid
Posts: 128

Rep: Reputation: 16
Hmm. Maybe make an alias for another command? Do you mind typing a separate command for arabic and english files?

It looks like you can change modes in realtime (in vi) by typing (first to set right-to-left mode, second to unset it)

:set rl
:set norl

If that isn't to your liking, perhaps there's a program out there that detects if your files are arabic or english, and I could help you write a script to use that program, so that vi autodetects which one it should use.
 
Old 08-25-2005, 02:28 PM   #5
gamor
Member
 
Registered: Jul 2004
Posts: 77

Original Poster
Rep: Reputation: 15
actually, in one single file I have both languages. That's what makes it complicated.
 
Old 08-25-2005, 03:10 PM   #6
corfe
Member
 
Registered: Dec 2004
Location: Washington State, USA
Distribution: Debian Sid
Posts: 128

Rep: Reputation: 16
I don't think it will autodetect for you and switch the mode for you, but try those commands, they're commands you type from within vi ":set rl" and ":set norl" - that at least lets you switch modes manually while you're editing a file.
 
Old 08-25-2005, 04:26 PM   #7
gamor
Member
 
Registered: Jul 2004
Posts: 77

Original Poster
Rep: Reputation: 15
Yes, that is working. I just have one more question. The file I mentioned is actually an English to Arabic dictionary. When I look up this file for words, will it know how to read them (L->R or R->L).
Thanks for your help
 
Old 08-26-2005, 09:53 AM   #8
corfe
Member
 
Registered: Dec 2004
Location: Washington State, USA
Distribution: Debian Sid
Posts: 128

Rep: Reputation: 16
I assume so. I read somewhere that "right-to-left" text is still stored like it should be (the first symbol in a right-to-left text line is on the right, and stored file-wise at the beginning of the file, but the program that displays the line knows to display it right-to-left instead of left-to-right).

I would try it out with a couple of words and make sure it works though before you get too far!
 
Old 08-26-2005, 11:12 AM   #9
gamor
Member
 
Registered: Jul 2004
Posts: 77

Original Poster
Rep: Reputation: 15
Just for anyone who has the same issue. In the console, if you go to settings, then configure console, you can check "allow bidirectional text rendering". You will be able to read a language that read from left to right and another that reads from right to left in the same file.
I haven't tried reading from a file yet. I will have to check that out.
Thanks for your help .
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Display to far left and up Elim_Garak Linux - General 8 11-01-2005 10:50 AM
No more folders left cookie_ie Programming 4 03-24-2005 10:17 AM
Mousewheel able to go left/right as well as up/down Khang Linux - Hardware 2 11-07-2004 12:59 PM
Only grub left..? Lillan Linux - General 20 04-07-2004 01:18 PM
Only grub left..? Lillan Linux - Newbie 3 04-06-2004 02:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration