[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Hebrew: General question about location of shortcut indicator "&" and reading direction



c.buhtz@posteo.jp writes:

 > I am upstream maintainer of "backintime". I don't know nothing
 > about Hebrew just that it is a right-to-left language.

Hebrew itself is written right-to left, but even American English as
read by junior high school kids in Kansas is no longer just English.
At the very least they also speak emoticon. :-)  In the case of Hebrew
(and Arabic), things are complicated by *frequent* interjection of
non-Hebrew text, including "Arabic" numerals and English and other
foreign languages.  These are *not* notated right-to-left, but rather
left-to-right because Hebrew speakers generally are familiar with
European languages which are left-to-right, and it's easier to always
read numbers and foreign words in their "natural" orientation.  Thus
written Hebrew (or Arabic) is not right-to-left, it is bidirectional
(often denoted "BIDI").

 > The term "&Options" is translated into "????????". Weblate do know
 > the diff between RTL and LTR languages. It displays the "&" on the
 > right side of the string.
 > 
 > But looking into the raw po file (using vim) The "&" is on the left 
 > side. That confused me.

Right, and it is confusing.  The most brain-breaking content in the
Unicode Standard is the algorithm for handling BIDI text, and it
sometimes gets it wrong (or authors want it "wrong" to express some
thought!), so the standard includes control characters to override the
algorithm!

So, here's the thing: do Hebrew speakers *speak* or *enter text*
bidirectionally?  They do not!  They speak and enter text linearly, or
in what is call "logical order".  And that is the order you see in the
file.  (It turns out that this makes the most sense for internal
string processing but I'm not going to try to justify it beyond saying
that lazy data structures make I/O easier, but nothing can make I/O
easy, so take what you can get!! :-)  On screen, however, Hebrew text
goes in the other direction.

Now, I'm pretty sure that if you look carefully at the file in
vim, you'll see that not only is the '&' on the left side, but the
order of the Hebrew characters is also "backwards".

Why doesn't either the terminal or vim use the BIDI algorithm to
display Hebrew "correctly" in the .po file?  Well, text terminals are
relatively simpleminded beasts, so they mostly don't try, but depend
on the application to handle it.  And I would imagine that vim *can*
do it but requires an option to do so (the default for the option is
probably locale-dependent).

Note that it probably makes sense for non-BIDI locales to default to
displaying in logical order in a programmer's editor.  To a non-BIDI
left-to-right programmer, they will most likely treat the option
*name* as a "visual blob", but they are most comfortable with the
*option character* (whether '&', '?', '#', '-', or '/') on the left.

Perhaps that is more detail than you wanted, but I'm addicted to
pedantry.  Hope it's useful!

Steve


Reply to: