Welcome to Geeklog, Anonymous Friday, November 22 2024 @ 10:05 pm EST
Geeklog Forums
Right to left languages' support
Status: offline
LWC
Forum User
Full Member
Registered: 02/19/04
Posts: 818
Making it hardcoded is easy, but not good not just in principal, but for Multilingual sites too, as some of the languages in those sites may be LTR while others may be RTL.
I've posted a patch that became official in Geeklog v1.4 that is opt-in based.
Currently, only hebrew.php has it (that I know of). You can, of course, do it yourself for any language file, but better yet - ask your needed RTL language's author to do it so it'll be there by default in the future.
I've posted a patch that became official in Geeklog v1.4 that is opt-in based.
Currently, only hebrew.php has it (that I know of). You can, of course, do it yourself for any language file, but better yet - ask your needed RTL language's author to do it so it'll be there by default in the future.
25
18
Quote
Status: offline
LWC
Forum User
Full Member
Registered: 02/19/04
Posts: 818
I'm happy to announce my patch (in a slightly better form) is an official part of Geeklog v1.4!
Alas, there's still a problem! See, it's only good for sites that are either one language based (the user can't choose anything else) or multilingual.
A site that lets you choose a language just for the overall feeling while in reality it has a content only in one language (like English [i.e. LTR] in geeklog.net) becomes unreadable when a visitor chooses an opposite direction language (in this case, a RTL language)
(Don't try it in geeklog.net. They actually hardcoded LTR just for that problem. But you can see it in action in demo.geeklog.net).
Therefore, here's my new patch for Geeklog v1.4:
config.php (a new parameter):
// Choose the direction of the primary content in your site.
// The choices are:
// 'ltr' (default) - if your content is written from left to right.
// 'rtl' - if your content is written from right to left.
// 'multilingual' - if you use parallel contents and at least one of them uses a
different direction than the rest. Note: only bother choosing this if you use the
multilingual content's patch!
The phrase if ($_CONF[content_direction] == 'multilingual') could even come in handy for the multilingual patch itself (it sure beats the current way to turn it on/off by having to comment/uncomment it).
public_html/lib-common.php:
if ($_CONF[content_direction] == 'multilingual')
{
// custom code - end
if( empty( $LANG_DIRECTION ))
{
// default to left-to-right
$header->set_var( 'direction', 'ltr' );
}
else
{
$header->set_var( 'direction', $LANG_DIRECTION );
}
// custom code - start
}
else
$header->set_var( 'direction', $_CONF[content_direction] );
// custom code - end
Alas, there's still a problem! See, it's only good for sites that are either one language based (the user can't choose anything else) or multilingual.
A site that lets you choose a language just for the overall feeling while in reality it has a content only in one language (like English [i.e. LTR] in geeklog.net) becomes unreadable when a visitor chooses an opposite direction language (in this case, a RTL language)
(Don't try it in geeklog.net. They actually hardcoded LTR just for that problem. But you can see it in action in demo.geeklog.net).
Therefore, here's my new patch for Geeklog v1.4:
config.php (a new parameter):
Text Formatted Code
$_CONF[content_direction] = 'ltr';// Choose the direction of the primary content in your site.
// The choices are:
// 'ltr' (default) - if your content is written from left to right.
// 'rtl' - if your content is written from right to left.
// 'multilingual' - if you use parallel contents and at least one of them uses a
different direction than the rest. Note: only bother choosing this if you use the
multilingual content's patch!
The phrase if ($_CONF[content_direction] == 'multilingual') could even come in handy for the multilingual patch itself (it sure beats the current way to turn it on/off by having to comment/uncomment it).
public_html/lib-common.php:
Text Formatted Code
// custom code - startif ($_CONF[content_direction] == 'multilingual')
{
// custom code - end
if( empty( $LANG_DIRECTION ))
{
// default to left-to-right
$header->set_var( 'direction', 'ltr' );
}
else
{
$header->set_var( 'direction', $LANG_DIRECTION );
}
// custom code - start
}
else
$header->set_var( 'direction', $_CONF[content_direction] );
// custom code - end
17
23
Quote
Status: offline
LWC
Forum User
Full Member
Registered: 02/19/04
Posts: 818
(Don't try it in geeklog.net. They actually hardcoded LTR just for that problem. But you can see it in action in demo.geeklog.net).
Well, somewhere between v1.4.1b1 and the unofficial v1.4.1b2, geeklog.net has stopped hardcoding LTR. So I invite everyone to switch to RTL and see how the site becomes unreadable (quickly, before they hardcore LTR again). The reason is the site still uses just English (execpt for the internal menu items) and so it turns into unreadable RTL English. The solution is to apply the aforementioned patch. Please apply it to Geeklog, Dirk (it has been submitted as an official patch for a long time now)!
20
21
Quote
All times are EST. The time is now 10:05 pm.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content