CSS Customization and numbering system
Hi, i think customization of CSS(and javascipt) is needed for translators. For example we are using other type of number in persian(fa,mzn,glk) language (۱۲۳۴۵۶۷۸۹۰) instead (1234567890), also ckb and some other languages use other type of number (١٢٣٤٥٦٧٨٩٠) (that have bit differences). Mediawiki parser functions have not problem for produce our numbers(in persian wiki {{formatnum:123}}=>۱۲۳) but html <ol> tag cannot produce our number well(without local patches same [1][2]), persian and arabic-indic numbering is a new feature that supported in CSS3 that already are supported in firefox with -moz- prefix and in webkit browsers(chrome, safari and ...) without any prefix but also it is easy to support this numbers in other browsers with javascript!
I provided this example of list-style-type usings, that you can see them correctly in firefox, chrome, safari now. Default numbring:
- 1
- 2
- 3
- 4
- 5
- 6
Persian numbring:
- ۱
- ۲
- ۳
- ۴
- ۵
- ۶
Arabic-indic numbring: (same above but is a bit diffrent)
- ١
- ٢
- ٣
- ٤
- ٥
- ٦
Code:
<ol><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li></ol> <ol style="list-style-type:-moz-persian; list-style-type:persian;"><li>۱</li><li>۲</li><li>۳</li><li>۴</li><li>۵</li><li>۶</li></ol> <ol style="list-style-type:-moz-arabic-indic; list-style-type:arabic-indic;"><li>١</li><li>٢</li><li>٣</li><li>٤</li><li>٥</li><li>٦</li></ol>
Thanks
Interesting feature, but I think it should depend on the locale users have set. Any opinions if this should be a core feature or that it should be added with an extension (UserLangCSS)? Niklas?
It will be better if this option added in core's language supports(I think both CSS3 and Javascript modification is needed for that).
for example users in our wiki must using this ۱۲۳۴... number, but when they used # for making numbered list(before my patch), their result was 1. 2. 3. 4. .... I think this feature is needed for all persian mediawiki wikis.(specialy when result of {{formatnum:123}} is ۱۲۳ in this wikis!)
seems there is not a good javascript way, without converting ol tag to other thing! curently I found a javascript code that converted "ol" to "span" for showing numbers correctly! so CSS3 is only remaining way for this job.
I think ability of modifying a CSS for translators may sufficient in this case. (mediawiki:localtrans.css or something else)
For now it's easier to add them manually in the core stylesheets (probably restricted just to content with suitable language code).
adding on this? MediaWiki:Common.css/fa, MediaWiki:Common.css/mzn, MediaWiki:Common.css/glk and MediaWiki:Common.css/ckb
Waiting for Niklas with a final recommendation, but the mentioned CSS pages are exported, so please *DO NOT CHANGE THOSE*.
Well I had ideas like have items like these in shared.css:
lang[fa] ol { list-style-type: -moz-persian; list-style-type: persian; }
lang[..] ...
Or alternatively including them with the generated dynamic css. Is there a list of languages codes and which list-style they would like to use?
AryehGregor> Nikerabbit, the CSS :lang() selector is probably supported by all UAs that support funny numbering schemes, so rules like li:lang(fa) { list-style-type: persian } in shared.css seem like the best way to do it.
@Nike: User:Ebraminio/number seems good for now.
Added the following rules for testing:
/* Localised ordered list numbering for some languages */
ol:lang(bcc) li,
ol:lang(bqi) li,
ol:lang(fa) li,
ol:lang(glk) li,
ol:lang(kk-arab) li,
ol:lang(mzn) li {
list-style-type: -moz-persian;
list-style-type: persian;
}
ol:lang(ckb-arab) li {
list-style-type: -moz-arabic-indic;
list-style-type: arabic-indic;
}
great, this code working well for me. i had not knowledge about this selector. why you don't put it for other languages that i listed? I exported that data from mediawiki localization codes.
Just testing if there any unseen problems with it. How did you come up with ckb-arab? There doesn't seem to be such language?