有没有办法在Java中检测RTL语言? [英] Is there any way to detect an RTL language in Java?

查看:403
本文介绍了有没有办法在Java中检测RTL语言?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要能够检测用户正在查看的当前语言是否是阿拉伯语的RTL(从右到左)语言。

I need to be able to detect whether the current language my user is viewing is an RTL (Right To Left) language like Arabic.

目前我'我只是根据系统属性user.language中的语言代码检测到这一点,但必须有更好的方法。

At the moment I'm just detecting this based on the language code from the system property user.language, but there must be a better way.

推荐答案

ComponentOrientation.getOrientation(new Locale(System.getProperty("user.language"))).isLeftToRight();  




  • 资源

    • Resource
    • 这篇关于有没有办法在Java中检测RTL语言?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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