RTL Language Support

117 views
Skip to first unread message

OQ

unread,
Jan 13, 2013, 8:58:29 AM1/13/13
to monoc...@googlegroups.com
I've tested a few Arabic ePub files and only the first 'page' ever shows up. I suspect this is related to how the pagination works. I would like to help in adding Arabic support for Monocle, would anyone be able to point me towards the files I should be looking at?

Quick outline of what needs to be done:
1- Proper pagination for Arabic text.
2- RTL text alignment (Not very familiar with Monocle, but it should simply be a CSS rule).
3- Make pages go from right to left (Can this be achieved by simply making a custom flipper?)

Joseph Pearson

unread,
Jan 16, 2013, 5:57:46 PM1/16/13
to monoc...@googlegroups.com
As far as I know, the most promising work on this front is still @timdream's fork: https://github.com/timdream/Monocle

But that is now well behind Monocle master. Still, looking through his commits might point you in the right direction.

In theory 1 and 2 should just fall out from CSS rules in Monocle (1) and in your book content (2). However, I'm not all that familiar with text direction needs or provisions in CSS, so I'm not the best guide here.

3 should be a custom flipper, yes. It might also have implications for the 'columns' dimension class (src/dimensions/columns.js) — I'm not sure.

Ori Idan

unread,
Mar 30, 2013, 5:21:35 AM3/30/13
to monoc...@googlegroups.com
I have implemented RTL support for slider flipper.

As for seeing only the first page of each chapter, it happened in Hebrew only when body tag had dir="rtl"
I removed the dir="rtl" tag from the body and inserted a <div dir="rtl"> immediately after the <body> tag.

-- 
Ori Idan

Joseph Pearson

unread,
Apr 2, 2013, 2:02:42 PM4/2/13
to monoc...@googlegroups.com
Thanks Ori, that's a big clue. (But ugh, what a pain. Modifying the DOM by injecting a top-level div breaks xpaths and some CSS selectors... not ideal. I wonder if we can avoid it somehow.)

— J


--
You received this message because you are subscribed to the Google Groups "Monocle" group.
To unsubscribe from this group and stop receiving emails from it, send an email to monocle-js+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Joseph Pearson | software inventor | inventivelabs.com.au | +61394163198

Ori Idan

unread,
Apr 2, 2013, 2:48:54 PM4/2/13
to monocle-js
Well, it took me a while to experiment in it.
I had several books written with <body dir="rtl" style="text-align:right">
What I did was a perl script that added a CSS file with direction:rtl directives for p and div.
The perl script also removed the dir="rtl" from the body tag.
The reader displayed the modified HTML.
I am not proficient enough in JavaScript and therefore could not find the reason that caused this behavior in the first place.

You can see what I've done until now here: 

-- 
Ori Idan
 

Alain

unread,
Oct 16, 2014, 3:07:14 PM10/16/14
to monoc...@googlegroups.com
Hi Ori,
i saw ur rtl example and i tried it but it is always giving an error "Cannot read property 'pageNumber' of null" and am in need to show page numbers.
There is also another problem which is the scrubber, it is not showing from right to left. (always ltr).
Any hints about these issues? have u solved them?

10x.

Ori Idan

unread,
Oct 18, 2014, 10:16:04 AM10/18/14
to monocle-js
I have never tried to show page numbers, so I have no idea how to solve it.
I'd be happy to hear of any solution.

-- 
Ori Idan CEO Helicon Books




For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages