BearND has submitted this change and it was merged.

Change subject: Make sure Arabic wikipedia is classified as RTL
......................................................................


Make sure Arabic wikipedia is classified as RTL

Sorting order was wrong and hence the binary search
skipped right past it.

Bug: 64420
Change-Id: Ie658fc193303784cde9a82ce47fe8259271c67da
---
M wikipedia/src/main/java/org/wikipedia/Utils.java
1 file changed, 11 insertions(+), 11 deletions(-)

Approvals:
  BearND: Verified; Looks good to me, approved



diff --git a/wikipedia/src/main/java/org/wikipedia/Utils.java 
b/wikipedia/src/main/java/org/wikipedia/Utils.java
index a5a72a3..6f55a9d 100644
--- a/wikipedia/src/main/java/org/wikipedia/Utils.java
+++ b/wikipedia/src/main/java/org/wikipedia/Utils.java
@@ -266,9 +266,19 @@
      * Ensure that this is always sorted alphabetically.
      */
     private static final String[] RTL_LANGS = {
-            "arc", "arz", "ar", "bcc", "bqi", "ckb", "dv", "fa", "glk", "ha", 
"he",
+            "ar", "arc", "arz", "bcc", "bqi", "ckb", "dv", "fa", "glk", "ha", 
"he",
             "khw", "ks", "mzn", "pnb", "ps", "sd", "ug", "ur", "yi"
     };
+
+    /**
+     * Returns true if the given wiki language is to be displayed RTL.
+     *
+     * @param lang Wiki code for the language to check for directionality
+     * @return true if it is RTL, false if LTR
+     */
+    public static boolean isLangRTL(String lang) {
+        return Arrays.binarySearch(RTL_LANGS, lang, null) >= 0;
+    }
 
     /**
      * Setup directionality for both UI and content elements in a webview.
@@ -294,16 +304,6 @@
             throw new RuntimeException(e);
         }
         bridge.sendMessage("setDirectionality", payload);
-    }
-
-    /**
-     * Returns true if the given wiki language is to be displayed RTL.
-     *
-     * @param lang Wiki code for the language to check for directionality
-     * @return true if it is RTL, false if LTR
-     */
-    public static boolean isLangRTL(String lang) {
-        return Arrays.binarySearch(RTL_LANGS, lang, null) >= 0;
     }
 
     /**

-- 
To view, visit https://gerrit.wikimedia.org/r/135730
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie658fc193303784cde9a82ce47fe8259271c67da
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Yuvipanda <yuvipa...@gmail.com>
Gerrit-Reviewer: BearND <bsitzm...@wikimedia.org>
Gerrit-Reviewer: Brion VIBBER <br...@wikimedia.org>
Gerrit-Reviewer: Dbrant <dbr...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to