CSS Customization and numbering system

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. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6

Persian numbring:

  1. ۱
  2. ۲
  3. ۳
  4. ۴
  5. ۵
  6. ۶

Arabic-indic numbring: (same above but is a bit diffrent)

  1. ١
  2. ٢
  3. ٣
  4. ٤
  5. ٥
  6. ٦

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

ebraminiotalk15:27, 16 August 2010

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?

Siebrand15:58, 16 August 2010

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!)

ebraminiotalk16:46, 16 August 2010
 

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)

ebraminiotalk17:35, 16 August 2010
Edited by another user.
Last edit: 19:55, 16 August 2010

For now it's easier to add them manually in the core stylesheets (probably restricted just to content with suitable language code).

Nike18:44, 16 August 2010
ebraminiotalk09:42, 17 August 2010

Waiting for Niklas with a final recommendation, but the mentioned CSS pages are exported, so please *DO NOT CHANGE THOSE*.

Siebrand12:06, 17 August 2010

yes i know!!! that was a question!

ebraminiotalk13:17, 17 August 2010
 

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?

Nike15:59, 31 August 2010

I have not that list, but we must see which languages use other number type (output of {{formatnum:123}}), I know fa, mzn, glk must use persian, and ckb must use arabic-indic. also we can see mediawiki sources ($digitTransformTable part) for that.

ebraminiotalk00:27, 3 September 2010
 
 

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.

Nike16:38, 31 August 2010
 
 
 
 

@Nike: User:Ebraminio/number seems good for now.

ebraminiotalk09:19, 3 September 2010
Edited by another user.
Last edit: 21:04, 13 September 2010

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;
}
Nike14:40, 13 September 2010

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.

ebraminiotalk20:45, 13 September 2010

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?

Nike14:54, 15 September 2010

Not anymore, but it was still there a few weeks ago.

Siebrand15:10, 15 September 2010
 

yes, please change ckb-arab to ckb,

if you want test your css code, you can test that on this page with this CSS:

ol:lang(ckb) li {
	list-style-type: decimal
}

this will turn over ۱۲۳۴۵... to 12345... (and this confirm that your CSS is working great:) )

ebraminiotalk07:09, 17 September 2010