s9y / Serendipity

A PHP blog software
https://s9y.org
BSD 3-Clause "New" or "Revised" License
208 stars 88 forks source link

direction_ltr usage #346

Closed ophian closed 8 years ago

ophian commented 9 years ago

In pre 2.0 (backend) versions, we used class="direction_ltr"in all form elements, like input, select, textarea, at least. I assume this was to support languages read from right to left. Don't we need this any more with HTML5 (at all), since they all are gone?

ophian commented 9 years ago

It seems only some plugins and templates made use of it. I will purge this on updates.

yellowled commented 9 years ago

FWIW: the proper way of supporting that would be to use dir="ltr" on <html> for languages that require it.

ophian commented 9 years ago

Let me ask this again. It is based to the serendipity $lang_direction var. Previously used as direction_<?php echo $lang_direction; ?> now as direction_{$lang_direction} in admin/plugin_config_item.tpl. Why do we use this for plugin inspectConfigs only? Is there a specific reason for this?

yellowled commented 9 years ago

Why do we use this for plugin inspectConfigs only? Is there a specific reason for this?

I don't know. Either way, it is pointless (in 2k11) since 2k11's CSS or JS does not make use of this class.

The part of this in BP's CSS has the following comment

/* this is not really implemented, but classes do exist in backend code */

and I guess that pretty much sums it up – the code is there, no one really knows why, but it is safer to leave it in than to remove it. Leaving it in does no harm, but saves us the time to investigate why it exists.

It's kind of dumb, but very pragmatic. ¯\_(ツ)_/¯

ophian commented 9 years ago

FWIW: the proper way of supporting that would be to use dir="ltr" on for languages that require it.

But we dont use this for bidi, don't we? Neither there nor in css as

/* bidi */

[dir="rtl"] {
  direction: rtl;
  unicode-bidi: embed;
}
[dir="ltr"] {
  direction: ltr;
  unicode-bidi: embed;
}
bdo[dir] {
  unicode-bidi: bidi-override;
}
yellowled commented 9 years ago
matthias at yl-mba in ~/GitHub/additional_plugins on master
$ grep -rl unicode-bidi *
serendipity_event_dpsyntaxhighlighter/sh/3.0.83/scripts/shBrushCss.js
serendipity_event_dpsyntaxhighlighter/sh/3.0.83/scripts/shBrushSass.js
serendipity_event_geshi/geshi/css.php

Obviously, that's all 3rd-party code. There is no result for unicode-bidi in Core or additional themes.

ophian commented 9 years ago

No sorry. That was just an example for todays usage in mozilla-defaul-html.css We did support this in default/admin/style.css though

.direction_ltr {
    direction: ltr;
}

.direction_rtl {
    direction: rtl;
}
yellowled commented 9 years ago

I'm sorry, but I don't understand the issue here.

What I can say is: there are many ways to implement RTL styles, but given that fact that a native hook for it exists in HTML (dir="rtl"), I would declare the .direction_* classes pointless.

W3C recommendation:

Avoid using CSS or Unicode control codes for managing direction where you can use markup.

ophian commented 9 years ago

Well yes, I came up with it, since I fell over this class name and did not really know what to do with it. Shouldn' we try to support the html markup then?

yellowled commented 9 years ago

I have no experience with RTL support. I'm not sure we should do that without having someone to test this properly.

ophian commented 9 years ago

I suppose we should then use in 2k11/admin/index.tpl

<!--[if gt IE 8]><!--> <html class="no-js" dir="{$CONST.LANG_DIRECTION}" lang="{$lang}"> <!--<![endif]-->

and in 2k11/admin/style.css

/* bidi */

[dir="rtl"] {
  direction: rtl;
  unicode-bidi: embed;
}
[dir="ltr"] {
  direction: ltr;
  unicode-bidi: embed;
}
bdo[dir] {
  unicode-bidi: bidi-override;
}

/* BASE STYLES */
...

and force someone using Arabic, Hebrew, Pashto, Persian, Sindhi, Syriac, Thaana, Urdu, Yiddish, etc to test this in the backend. It does not harm ltr usage.

yellowled commented 9 years ago

I don't know anyone using any of those languages in a s9y backend.

ophian commented 9 years ago

I suppose we should then use

No, we should not do this! I had it testwise and then set lang to Arabic. It turned all elements to be read rtl, which heavingly "crashes" with floats, etc. We should still have a decision on how (or not) to use this direction for user form elements though (since that was the origin idea on several places).

ophian commented 9 years ago

Maybe @omid can join in, to shed some light where what is needed. Also see his blog http://oxygenws.com/blog/

yellowled commented 9 years ago

Probably a good source of inspiration for the CSS side of things is the rtl-support module in YAML.

Pretty sure it's not enough to just set direction: rtl after seing that. margin, padding, text-align, some cases of float

yellowled commented 8 years ago

No activity in over 20 months, no issue reports from actual “RTL users” (that I know of), unreadable discussion.