Add Arabic layout (#314)

* add arabic keyboard
* use unicode values for special characters
* add alternate layout
* use arabic numbers
This commit is contained in:
Mostafa Ayesh 2023-03-11 10:54:20 -05:00 committed by GitHub
parent 6aaa497393
commit ce51df6f5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 93 additions and 0 deletions

View File

@ -32,6 +32,8 @@
<item>devanagari_2</item>
<item>he_il_1452_1</item>
<item>he_il_1452_2</item>
<item>ar_pc</item>
<item>ar_alt</item>
<item>custom</item>
</string-array>
<string-array name="pref_layout_entries">
@ -66,6 +68,8 @@
<item>देवनागरी (हिंदी)-2</item>
<item>Hebrew SI-1452-1</item>
<item>Hebrew SI-1452-2</item>
<item>Arabic PC</item>
<item>Arabic ALT</item>
<item>@string/pref_layout_e_custom</item>
</string-array>
<string-array name="pref_accents_entries">

42
res/xml/ar_alt.xml Normal file
View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<keyboard>
<row>
<key key0="ض" key2="١" key3="`" key4="esc"/>
<key key0="ص" key2="٢" key3="\@"/>
<key key0="ث" key2="٣" key3="\#"/>
<key key0="ق" key2="٤" key3="$"/>
<key key0="ف" key2="٥" key3="%"/>
<key key0="غ" key2="٦" key3="^"/>
<key key0="ع" key2="٧" key3="&amp;"/>
<key key0="ه" key2="٨" key3="*"/>
<key key0="خ" key2="٩" key3="("/>
<key key0="ح" key2="٠" key3=")"/>
<key key0="ج"/>
</row>
<row>
<key key0="ش" key4="tab"/>
<key key0="س"/>
<key key0="ي"/>
<key key0="ب"/>
<key key0="ل"/>
<key key0="ا" key1="أ"/>
<key key0="ت"/>
<key key0="ن"/>
<key key0="م"/>
<key key0="ك"/>
<key key0="ط"/>
</row>
<row>
<key key0="ذ"/>
<key key0="ء"/>
<key key0="ؤ" key1="{"/>
<key key0="ر" key1="}"/>
<key key0="ى" key1="ئ"/>
<key key0="ة"/>
<key key0="و" key3=","/>
<key key0="ز" key3="."/>
<key key0="ظ" key3="&#1567;"/>
<key key0="د"/>
<key width="1.0" key0="backspace" key2="delete"/>
</row>
</keyboard>

44
res/xml/ar_pc.xml Normal file
View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<keyboard>
<row>
<key key0="ض" key1="&#1614;" key2="١" key3="`" key4="esc"/>
<key key0="ص" key1="&#1611;" key2="٢" key3="\@"/>
<key key0="ث" key1="&#1615;" key2="٣" key3="\#" key4="loc €"/>
<key key0="ق" key1="&#1612;" key2="٤" key3="$" key4="loc £"/>
<key key0="ف" key1="&#1604;&#1573;" key2="٥" key3="%"/>
<key key0="غ" key1="&#1573;" key2="٦" key3="^"/>
<key key0="ع" key1="&#8216;" key2="٧" key3="&amp;"/>
<key key0="ه" key1="&#0247;" key2="٨" key3="*"/>
<key key0="خ" key1="&#0215;" key2="٩" key3="("/>
<key key0="ح" key1="&#1563;" key2="٠" key3=")"/>
<key key0="ج" key1="&gt;" key2="-" key3="_"/>
<key key0="د" key1="&lt;" key2="=" key3="ذ"/>
<!-- <key key0="ذ" key1="&#1617;" key3="\\" key4="|"/> -->
</row>
<row>
<key shift="0.5" key0="ش" key1="&#1616;" key4="tab"/>
<key key0="س" key1="&#1613;"/>
<key key0="ي" key1="["/>
<key key0="ب" key1="]"/>
<key key0="ل" key1="&#1604;&#1571;"/>
<key key0="ا" key1="أ"/>
<key key0="ت" key1="ـ"/>
<key key0="ن" key1="&#1548;"/>
<key key0="م" key1="/"/>
<key key0="ك" key1=":"/>
<key key0="ط" key1="&quot;"/>
</row>
<row>
<key shift="0.5" key0="ئ" key1="~"/>
<key key0="ء" key1="&#1618;"/>
<key key0="ؤ" key1="{"/>
<key key0="ر" key1="}"/>
<key key0="لا" key1="&#1604;&#1570;"/>
<key key0="ى" key1="&#1570;"/>
<key key0="ة" key1="&#8217;"/>
<key key0="و" key1=","/>
<key key0="ز" key1="."/>
<key key0="ظ" key1="&#1567;"/>
<key width="1.5" key0="backspace" key2="delete"/>
</row>
</keyboard>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<input-method xmlns:android="http://schemas.android.com/apk/res/android" android:settingsActivity="juloo.keyboard2.SettingsActivity" android:supportsSwitchingToNextInputMethod="true">
<subtype android:label="%s" android:languageTag="ar" android:imeSubtypeLocale="ar" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=ar_pc"/>
<subtype android:label="%s" android:languageTag="be" android:imeSubtypeLocale="be_BY" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=ru_jcuken,extra_keys=ґ|є|і|ї|ў"/>
<subtype android:label="%s" android:languageTag="bg" android:imeSubtypeLocale="bg_BG" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=bgph1,extra_keys=€"/>
<subtype android:label="%s" android:languageTag="bn" android:imeSubtypeLocale="bn_BD" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty,extra_keys=৳"/>

View File

@ -372,6 +372,8 @@ final class Config
case "ru_jcuken": id = R.xml.local_ru_jcuken; break;
case "he_il_1452_1": id = R.xml.he_il_1452_1; break;
case "he_il_1452_2": id = R.xml.he_il_1452_2; break;
case "ar_pc": id = R.xml.ar_pc; break;
case "ar_alt": id = R.xml.ar_alt; break;
}
return KeyboardData.load(res, id);
}