使用语言环境标识符找到语言的方向? [英] Find the direction of a language using its locale identifier?

查看:67
本文介绍了使用语言环境标识符找到语言的方向?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ICU(php Intl扩展)是否提供一种检测语言方向(rtl/ltr)的方法?

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

推荐答案

方向是脚本数据.一种语言可以使用许多脚本,而一种脚本可以被多种语言使用,所以我不确定您可以将一种语言映射到一个方向.

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.

即使可以,PHP也无法提供获取这些信息的方法.但是,您可以尝试 icanboogie/cldr 来查看CLDR数据是否会有用(毕竟,大多数语言仅使用一个脚本).

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.

这篇关于使用语言环境标识符找到语言的方向?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆