Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to localize decimal numbers of an ordered lists?

Is there a way to display decimal numbers of an ordered list in language of the Website? For example I have an ordered list in a Farsi language Website (<html lang="fa">), but decimal numbers before each list item appear in English instead of in Farsi!

Markup example of an ordered list in Farsi:

<ol dir="rtl">
    <li>کتابهای زیادی در شصت و سه درصد گذشته</li>
    <li>چاپگرها و متون بلکه روزنامه و مجله</li>
    <li>لورم ایپسوم متن ساختگی با تولید سادگی</li>
</ol>

https://codepen.io/smohadjer/pen/GBQVgr

like image 466
smohadjer Avatar asked Oct 21 '25 15:10

smohadjer


1 Answers

You are probably looking for "list-style: arabic-indic;".

You can see all available styles here: https://mdn.github.io/css-examples/counter-style-demo/

There is also a draft spec to create your own symbols for numbered lists, but it is only supported in the latest Firefox so far. See https://developer.mozilla.org/en-US/docs/Web/CSS/@counter-style

Also a better reference for the list-style-type CSS attribute can be found here: https://developer.mozilla.org/en-US/docs/Web/CSS/list-style-type

like image 142
nuVoid Avatar answered Oct 23 '25 06:10

nuVoid



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!