-
Notifications
You must be signed in to change notification settings - Fork 142
Hebrew translation #146
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
Hebrew translation #146
Conversation
Please note that for proper display of Hebrew, the page HTML tag needs to have dir=rtl
This is great, thank you. I'll add support for marking languages rtl and merge this and push it to the beta site. |
One bit of trouble I ran into was with pages with "mixed languages". I need to learn a little bit more about how people implement RTF. Anyway, just an update that it's still in progress.. |
If the page is generally in Hebrew, you can enclose English text in <span
dir="ltr">text</span>
And vice versa, if the page is in English, single Hebrew strings would be
in <span dir="rtl">text</span>
Both are needed only where directionality actually matters, like paragraphs
containing punctuation marks and mixed ltr/rtl in the same paragraph. Small
strings like menu items etc can be left as is. Browsers know to render them
RTL (or LTR in Hebrew pages) based on the characters themselves. ltr/rtl
are just for complete paragraphs and also general page directionality.
…On Sat, Aug 19, 2017 at 6:59 PM, Ask Bjørn Hansen ***@***.***> wrote:
One bit of trouble I ran into was with pages with "mixed languages". I
need to learn a little bit more about how people implement RTF. Anyway,
just an update that it's still in progress..
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#146 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AGKJ-dWruuoVbD6ofTOiBFU7rU4GeGulks5sZwZogaJpZM4LyDcw>
.
|
Thank you for the explanation. I was fussing with it a bit more. I started adding a "rtl" option in the list of languages in code, but in the code which language gets pulled in is quickly abstracted away (basically if it's the translation or an English fallback). Given your explanation I wonder if it'd make most sense to just wrap the Hebrew .html files (the ones you translated) in ... ? |
Sorry but I kind of lost you on where the problem is. Let me give an example of how I would build a multi-lingual website that also supports languages that aren't read left-to-right. In general I like to work with the concept of functional decorators. Meaning: functions (or methods if you're into OO), that get some input as a parameter (or setting a variable in a renderer object if OO prior to calling its' main render() method). In cases where inside the Hebrew page I will have to have something left-to-right, like code snippets, I could just specifically wrap them with some tag that says direction: ltr in its' CSS, or even simpler, since those code snippets will likely ALWAYS be left-to-right, regardless of language, then the 'direction: ltr' can just be in the global CSS file defining the regular styling of code snippets; Since these CSS classes will be more-specific than the HTML which is in the outermost scope, they'll prevail, and code snippets will be displayed left-to-right in right-to-left pages without needing to add special code within the page or the translation text. That's all that is needed, assuming that you have some rendering engine that decides what it is going to show and pass that information forward if you have some renderer. Hope this helps? |
or... if it's simpler, you could (if possible) use the gettext/equivalent template engine and just define a string for direction (_ltr), which by default render as "ltr", and could be "translated" to "rtl", and put that string on all HTML pages in the html tag; since "ltr" is the default, on non-"translated-to-rtl" languages there will be no effect (dir will be ltr), and on RTL languages we can translate it to 'rtl'... reversing the direction. |
Hi @shimile -- thank you again for this! It will be on the beta site shortly https://web.beta.grundclock.com/en/ I didn't do the rtl changes yet, so I am guessing it's all broken, but I figured better get the completed work merged in. Reading through my old questions and your comments I have some new ideas for how to make this work. I think there was another RTL translation recently, too, that's probably also broken! |
Please note that for proper display of Hebrew, the page HTML tag needs to have dir="rtl"