From 2c43ed179eed063bf48c8de318091446aa5057f8 Mon Sep 17 00:00:00 2001
From: "Tadashi G. Takaoka" <takaoka@google.com>
Date: Fri, 17 Jun 2011 22:04:16 +0900
Subject: [PATCH] Support Croatian keyboard
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Basically Croatian keyboard is QWERTZ layout with extra letters such
as č, ć, đ, ž and š.  This change just introduces Croatian keyboard
subtype and QWERTZ layout which has the extra letters as popup mini
keyboard of base letter.

It might be great if we could have dedidated table layout.

Bug: 4309160
Change-Id: I0fc227295defa56029ca06e406f73833b992be0e
---
 .../res/values-hr/donottranslate-altchars.xml | 27 ++++++++++++++++++
 java/res/values/strings.xml                   |  2 ++
 java/res/xml-hr/kbd_qwerty.xml                | 28 +++++++++++++++++++
 java/res/xml/method.xml                       |  7 ++++-
 4 files changed, 63 insertions(+), 1 deletion(-)
 create mode 100644 java/res/values-hr/donottranslate-altchars.xml
 create mode 100644 java/res/xml-hr/kbd_qwerty.xml

diff --git a/java/res/values-hr/donottranslate-altchars.xml b/java/res/values-hr/donottranslate-altchars.xml
new file mode 100644
index 0000000000..d0c9d40496
--- /dev/null
+++ b/java/res/values-hr/donottranslate-altchars.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2011, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="alternates_for_s">š,ś,ß</string>
+    <string name="alternates_for_n">ñ,ń</string>
+    <string name="alternates_for_y"></string>
+    <string name="alternates_for_z">6,ž,ź,ż</string>
+    <string name="alternates_for_c">č,ć,ç</string>
+    <string name="alternates_for_d">Ä‘</string>
+</resources>
diff --git a/java/res/values/strings.xml b/java/res/values/strings.xml
index 2093f64616..93da137568 100644
--- a/java/res/values/strings.xml
+++ b/java/res/values/strings.xml
@@ -266,6 +266,8 @@
     <string name="subtype_mode_fr_CA_keyboard">French (Canada) Keyboard</string>
     <!-- Description for French (Switzerland) keyboard subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_fr_CH_keyboard">French (Switzerland) Keyboard</string>
+    <!-- Description for Croatian keyboard subtype [CHAR LIMIT=35] -->
+    <string name="subtype_mode_hr_keyboard">Croatian Keyboard</string>
     <!-- Description for Hungarian keyboard subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_hu_keyboard">Hungarian Keyboard</string>
     <!-- Description for Hebrew keyboard subtype [CHAR LIMIT=35] -->
diff --git a/java/res/xml-hr/kbd_qwerty.xml b/java/res/xml-hr/kbd_qwerty.xml
new file mode 100644
index 0000000000..ca92e86a78
--- /dev/null
+++ b/java/res/xml-hr/kbd_qwerty.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2011, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<Keyboard
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyboardLocale="hr"
+>
+    <!-- TODO: Dedicated Croatian layout especially for tablet. -->
+    <include
+        latin:keyboardLayout="@xml/kbd_rows_qwertz" />
+</Keyboard>
diff --git a/java/res/xml/method.xml b/java/res/xml/method.xml
index 61fd1ce99a..9c416170de 100644
--- a/java/res/xml/method.xml
+++ b/java/res/xml/method.xml
@@ -20,7 +20,7 @@
 <!-- The attributes in this XML file provide configuration information -->
 <!-- for the Input Method Manager. -->
 
-<!-- Keyboard: en_US, en_GB, ar, cs, da, de, es, es_US, fi, fr, fr_CA, fr_CH, hu, it, iw, nb, nl, pl, pt, ru, sr, sv -->
+<!-- Keyboard: en_US, en_GB, ar, cs, da, de, es, es_US, fi, fr, fr_CA, fr_CH, hr, hu, it, iw, nb, nl, pl, pt, ru, sr, sv -->
 <!-- Voice: af, cs, da, de, en, es, fr, it, ja, ko, nl, pl, pt, ru, tr, yue, zh, zu -->
 <!-- TODO: use <lang>_keyboard icon instead of a common keyboard icon. -->
 <!-- TODO: use <lang>_mic icon instead of a common mic icon. -->
@@ -116,6 +116,11 @@
             android:imeSubtypeLocale="fr_CH"
             android:imeSubtypeMode="keyboard"
     />
+    <subtype android:icon="@drawable/ic_subtype_keyboard"
+            android:label="@string/subtype_mode_hr_keyboard"
+            android:imeSubtypeLocale="hr"
+            android:imeSubtypeMode="keyboard"
+    />
     <subtype android:icon="@drawable/ic_subtype_keyboard"
             android:label="@string/subtype_mode_hu_keyboard"
             android:imeSubtypeLocale="hu"
-- 
GitLab