[ 
https://issues.apache.org/jira/browse/WICKET-6943?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17474248#comment-17474248
 ] 

ASF GitHub Bot commented on WICKET-6943:
----------------------------------------

solomax commented on a change in pull request #488:
URL: https://github.com/apache/wicket/pull/488#discussion_r782714873



##########
File path: wicket-core/src/main/java/org/apache/wicket/Session.java
##########
@@ -184,6 +195,36 @@ public static Session get()
                }
        }
 
+       /**
+        * Check if a BCP 47 / III language code indicates an RTL language, i.e.
+        * either: - a language code explicitly specifying one of the 
right-to-left
+        * scripts, e.g. "az-Arab", or
+        * <p>
+        * - a language code specifying one of the languages normally written 
in a
+        * right-to-left script, e.g. "fa" (Farsi), except ones explicitly
+        * specifying Latin or Cyrillic script (which are the usual LTR
+        * alternatives).
+        * <p>
+        * <a href="http://www.unicode.org/iso15924/iso15924-num.html";>
+        * The list of right-to-left scripts appears in the 100-199 range 
in</a>, of which Arabic and
+        * Hebrew are by far the most widely used. We also recognize Thaana, 
N'Ko,
+        * and Tifinagh, which also have significant modern usage. The rest 
(Syriac,
+        * Samaritan, Mandaic, etc.) seem to have extremely limited or no modern
+        * usage and are not recognized. The languages usually written in a
+        * right-to-left script are taken as those with 
+        * <a 
href="http://www.iana.org/assignments/language-subtag-registry";>Suppress-Script</a>:
+        * Hebr|Arab|Thaa|Nkoo|Tfng, as well as
+        * Sindhi (sd) and Uyghur (ug). The presence of other subtags of the
+        * language code, e.g. regions like EG (Egypt), is ignored.
+        *
+        * @param locale - locale to check
+        * @return <code>true</code> in case passed locale is right-to-left
+        */
+       public static boolean isRtlLanguage(final Locale locale) {

Review comment:
       @martin-g can this method be made public? We are using it for utility 
purposes :)
   Another possible use: `in-memory` rendering using different locale




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@wicket.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> There should be ability to check if current session's locale is RTL
> -------------------------------------------------------------------
>
>                 Key: WICKET-6943
>                 URL: https://issues.apache.org/jira/browse/WICKET-6943
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-core
>    Affects Versions: 9.7.0
>            Reporter: Maxim Solodovnik
>            Assignee: Maxim Solodovnik
>            Priority: Major
>             Fix For: 10.0.0, 9.8.0
>
>
> Currently there is no common way to determine if current session's locale is 
> RTL or not
> it would be useful to add common way to determine locale's direction



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to