Find the direction of a language using its locale identifier?

前端 未结 1 366
迷失自我
迷失自我 2021-01-25 14:40

Does ICU (php Intl extension) provides a way to detect the direction of a language (rtl/ltr) ?

1条回答
  •  盖世英雄少女心
    2021-01-25 14:59

    Direction is a script data. A language can use many scripts and a script can be used by many languages, so I'm not sure you can map a language to a direction.

    Even if you could, PHP provides no way to get these informations. However you can try icanboogie/cldr to see if CLDR data would be of any use (after all most languages use only one script).


    You can find here a mapping between languages and scripts and here scripts data which include direction.

    0 讨论(0)
提交回复
热议问题