aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/dicttool/Android.mk (renamed from tools/makedict/Android.mk)13
-rw-r--r--tools/dicttool/etc/Android.mk (renamed from tools/makedict/etc/Android.mk)4
-rwxr-xr-xtools/dicttool/etc/dicttool_aosp (renamed from tools/makedict/etc/makedict)5
-rwxr-xr-xtools/dicttool/etc/makedict_aosp18
-rw-r--r--tools/dicttool/etc/manifest.txt1
-rw-r--r--tools/dicttool/src/android/inputmethod/latin/dicttool/AdditionalCommandList.java22
-rw-r--r--tools/dicttool/src/android/inputmethod/latin/dicttool/CommandList.java26
-rw-r--r--tools/dicttool/src/android/inputmethod/latin/dicttool/Compress.java98
-rw-r--r--tools/dicttool/src/android/inputmethod/latin/dicttool/DictionaryMaker.java (renamed from tools/makedict/src/com/android/inputmethod/latin/makedict/DictionaryMaker.java)94
-rw-r--r--tools/dicttool/src/android/inputmethod/latin/dicttool/Dicttool.java94
-rw-r--r--tools/dicttool/src/android/inputmethod/latin/dicttool/Info.java36
-rw-r--r--tools/dicttool/src/android/inputmethod/latin/dicttool/Makedict.java40
-rw-r--r--tools/dicttool/src/android/inputmethod/latin/dicttool/MakedictLog.java (renamed from tools/makedict/src/com/android/inputmethod/latin/makedict/MakedictLog.java)0
-rw-r--r--tools/dicttool/src/android/inputmethod/latin/dicttool/XmlDictInputOutput.java (renamed from tools/makedict/src/com/android/inputmethod/latin/makedict/XmlDictInputOutput.java)59
-rw-r--r--tools/dicttool/tests/com/android/inputmethod/latin/makedict/BinaryDictInputOutputTest.java (renamed from tools/makedict/tests/com/android/inputmethod/latin/BinaryDictInputOutputTest.java)10
-rwxr-xr-xtools/dicttool/tests/etc/test-dicttool.sh16
-rw-r--r--tools/makedict/etc/manifest.txt1
-rw-r--r--tools/maketext/res/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.tmpl9
-rw-r--r--tools/maketext/res/values-af/donottranslate-more-keys.xml69
-rw-r--r--tools/maketext/res/values-be/donottranslate-more-keys.xml8
-rw-r--r--tools/maketext/res/values-eo/donottranslate-more-keys.xml146
-rw-r--r--tools/maketext/res/values-es/donottranslate-more-keys.xml12
-rw-r--r--tools/maketext/res/values-ky/donottranslate-more-keys.xml8
-rw-r--r--tools/maketext/res/values-ru/donottranslate-more-keys.xml8
-rw-r--r--tools/maketext/res/values-sr/donottranslate-more-keys.xml19
-rw-r--r--tools/maketext/res/values-sw/donottranslate-more-keys.xml65
-rw-r--r--tools/maketext/res/values-tl/donottranslate-more-keys.xml70
-rw-r--r--tools/maketext/res/values-uk/donottranslate-more-keys.xml8
-rw-r--r--tools/maketext/res/values-zu/donottranslate-more-keys.xml64
-rw-r--r--tools/maketext/res/values/donottranslate-more-keys.xml14
-rw-r--r--tools/maketext/src/com/android/inputmethod/latin/maketext/JarUtils.java9
-rw-r--r--tools/maketext/src/com/android/inputmethod/latin/maketext/LabelText.java2
-rw-r--r--tools/maketext/src/com/android/inputmethod/latin/maketext/MoreKeysResources.java2
33 files changed, 951 insertions, 99 deletions
diff --git a/tools/makedict/Android.mk b/tools/dicttool/Android.mk
index 7b5dee2ce..5bd836a01 100644
--- a/tools/makedict/Android.mk
+++ b/tools/dicttool/Android.mk
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2011 The Android Open Source Project
+# Copyright (C) 2012 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.
@@ -16,15 +16,18 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
-MAKEDICT_CORE_SOURCE_DIRECTORY := ../../java/src/com/android/inputmethod/latin/makedict
+LATINIME_CORE_SOURCE_DIRECTORY := ../../java/src/com/android/inputmethod/latin
+MAKEDICT_CORE_SOURCE_DIRECTORY := $(LATINIME_CORE_SOURCE_DIRECTORY)/makedict
LOCAL_MAIN_SRC_FILES := $(call all-java-files-under,$(MAKEDICT_CORE_SOURCE_DIRECTORY))
LOCAL_TOOL_SRC_FILES := $(call all-java-files-under,src)
LOCAL_SRC_FILES := $(LOCAL_TOOL_SRC_FILES) \
- $(filter-out $(addprefix %, $(LOCAL_TOOL_SRC_FILES)), $(LOCAL_MAIN_SRC_FILES))
-LOCAL_SRC_FILES += $(call all-java-files-under,tests)
+ $(filter-out $(addprefix %/, $(notdir $(LOCAL_TOOL_SRC_FILES))), $(LOCAL_MAIN_SRC_FILES)) \
+ $(call all-java-files-under,tests) \
+ $(LATINIME_CORE_SOURCE_DIRECTORY)/Constants.java
+
LOCAL_JAR_MANIFEST := etc/manifest.txt
-LOCAL_MODULE := makedict
+LOCAL_MODULE := dicttool_aosp
LOCAL_JAVA_LIBRARIES := junit
include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/tools/makedict/etc/Android.mk b/tools/dicttool/etc/Android.mk
index 1b7d7cf0e..0c611b7e9 100644
--- a/tools/makedict/etc/Android.mk
+++ b/tools/dicttool/etc/Android.mk
@@ -1,4 +1,4 @@
-# Copyright (C) 2011 The Android Open Source Project
+# Copyright (C) 2012 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.
@@ -15,5 +15,5 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
-LOCAL_PREBUILT_EXECUTABLES := makedict
+LOCAL_PREBUILT_EXECUTABLES := dicttool_aosp makedict_aosp
include $(BUILD_HOST_PREBUILT)
diff --git a/tools/makedict/etc/makedict b/tools/dicttool/etc/dicttool_aosp
index 7c1c02e85..a4879a279 100755
--- a/tools/makedict/etc/makedict
+++ b/tools/dicttool/etc/dicttool_aosp
@@ -33,7 +33,7 @@ progdir=`pwd`
prog="${progdir}"/`basename "${prog}"`
cd "${oldwd}"
-jarfile=makedict.jar
+jarfile=dicttool_aosp.jar
frameworkdir="$progdir"
if [ ! -r "$frameworkdir/$jarfile" ]
then
@@ -58,6 +58,5 @@ else
jarpath="$frameworkdir/$jarfile"
fi
-# need to use "java.ext.dirs" because "-jar" causes classpath to be ignored
# might need more memory, e.g. -Xmx128M
-exec java -ea -Djava.ext.dirs="$frameworkdir" -jar "$jarpath" "$@"
+exec java -ea -jar "$jarpath" "$@"
diff --git a/tools/dicttool/etc/makedict_aosp b/tools/dicttool/etc/makedict_aosp
new file mode 100755
index 000000000..095c50538
--- /dev/null
+++ b/tools/dicttool/etc/makedict_aosp
@@ -0,0 +1,18 @@
+#!/bin/sh
+# Copyright (C) 2012, 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.
+
+# Dicttool supports making the dictionary using the 'makedict' command and
+# the same arguments that the old 'makedict' command used to accept.
+dicttool_aosp makedict $@
diff --git a/tools/dicttool/etc/manifest.txt b/tools/dicttool/etc/manifest.txt
new file mode 100644
index 000000000..67c85214c
--- /dev/null
+++ b/tools/dicttool/etc/manifest.txt
@@ -0,0 +1 @@
+Main-Class: com.android.inputmethod.latin.dicttool.Dicttool
diff --git a/tools/dicttool/src/android/inputmethod/latin/dicttool/AdditionalCommandList.java b/tools/dicttool/src/android/inputmethod/latin/dicttool/AdditionalCommandList.java
new file mode 100644
index 000000000..8d4eb751b
--- /dev/null
+++ b/tools/dicttool/src/android/inputmethod/latin/dicttool/AdditionalCommandList.java
@@ -0,0 +1,22 @@
+/**
+ * Copyright (C) 2012 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.
+ */
+
+package com.android.inputmethod.latin.dicttool;
+
+public class AdditionalCommandList {
+ public static void populate() {
+ }
+}
diff --git a/tools/dicttool/src/android/inputmethod/latin/dicttool/CommandList.java b/tools/dicttool/src/android/inputmethod/latin/dicttool/CommandList.java
new file mode 100644
index 000000000..d16b069fe
--- /dev/null
+++ b/tools/dicttool/src/android/inputmethod/latin/dicttool/CommandList.java
@@ -0,0 +1,26 @@
+/**
+ * Copyright (C) 2012 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.
+ */
+
+package com.android.inputmethod.latin.dicttool;
+
+public class CommandList {
+ public static void populate() {
+ Dicttool.addCommand("info", Info.class);
+ Dicttool.addCommand("compress", Compress.Compressor.class);
+ Dicttool.addCommand("uncompress", Compress.Uncompressor.class);
+ Dicttool.addCommand("makedict", Makedict.class);
+ }
+}
diff --git a/tools/dicttool/src/android/inputmethod/latin/dicttool/Compress.java b/tools/dicttool/src/android/inputmethod/latin/dicttool/Compress.java
new file mode 100644
index 000000000..3cb0a12c4
--- /dev/null
+++ b/tools/dicttool/src/android/inputmethod/latin/dicttool/Compress.java
@@ -0,0 +1,98 @@
+/**
+ * Copyright (C) 2012 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.
+ */
+
+package com.android.inputmethod.latin.dicttool;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.zip.GZIPInputStream;
+import java.util.zip.GZIPOutputStream;
+
+public class Compress {
+
+ private static OutputStream getCompressedStream(final OutputStream out)
+ throws java.io.IOException {
+ return new GZIPOutputStream(out);
+ }
+
+ private static InputStream getUncompressedStream(final InputStream in) throws IOException {
+ return new GZIPInputStream(in);
+ }
+
+ public static void copy(final InputStream input, final OutputStream output) throws IOException {
+ final byte[] buffer = new byte[1000];
+ for (int readBytes = input.read(buffer); readBytes >= 0; readBytes = input.read(buffer))
+ output.write(buffer, 0, readBytes);
+ input.close();
+ output.close();
+ }
+
+ static public class Compressor extends Dicttool.Command {
+ public static final String COMMAND = "compress";
+ public static final String STDIN_OR_STDOUT = "-";
+
+ public Compressor() {
+ }
+
+ public String getHelp() {
+ return COMMAND + " <src_filename> <dst_filename>: "
+ + "Compresses a file using gzip compression";
+ }
+
+ public void run() throws IOException {
+ if (mArgs.length > 2) {
+ throw new RuntimeException("Too many arguments for command " + COMMAND);
+ }
+ final String inFilename = mArgs.length >= 1 ? mArgs[0] : STDIN_OR_STDOUT;
+ final String outFilename = mArgs.length >= 2 ? mArgs[1] : STDIN_OR_STDOUT;
+ final InputStream input = inFilename.equals(STDIN_OR_STDOUT) ? System.in
+ : new FileInputStream(new File(inFilename));
+ final OutputStream output = outFilename.equals(STDIN_OR_STDOUT) ? System.out
+ : new FileOutputStream(new File(outFilename));
+ copy(input, new GZIPOutputStream(output));
+ }
+ }
+
+ static public class Uncompressor extends Dicttool.Command {
+ public static final String COMMAND = "uncompress";
+ public static final String STDIN_OR_STDOUT = "-";
+
+ public Uncompressor() {
+ }
+
+ public String getHelp() {
+ return COMMAND + " <src_filename> <dst_filename>: "
+ + "Uncompresses a file compressed with gzip compression";
+ }
+
+ public void run() throws IOException {
+ if (mArgs.length > 2) {
+ throw new RuntimeException("Too many arguments for command " + COMMAND);
+ }
+ final String inFilename = mArgs.length >= 1 ? mArgs[0] : STDIN_OR_STDOUT;
+ final String outFilename = mArgs.length >= 2 ? mArgs[1] : STDIN_OR_STDOUT;
+ final InputStream input = inFilename.equals(STDIN_OR_STDOUT) ? System.in
+ : new FileInputStream(new File(inFilename));
+ final OutputStream output = outFilename.equals(STDIN_OR_STDOUT) ? System.out
+ : new FileOutputStream(new File(outFilename));
+ copy(new GZIPInputStream(input), output);
+ }
+ }
+}
diff --git a/tools/makedict/src/com/android/inputmethod/latin/makedict/DictionaryMaker.java b/tools/dicttool/src/android/inputmethod/latin/dicttool/DictionaryMaker.java
index 5e3921573..4f8874985 100644
--- a/tools/makedict/src/com/android/inputmethod/latin/makedict/DictionaryMaker.java
+++ b/tools/dicttool/src/android/inputmethod/latin/dicttool/DictionaryMaker.java
@@ -14,7 +14,13 @@
* the License.
*/
-package com.android.inputmethod.latin.makedict;
+package com.android.inputmethod.latin.dicttool;
+
+import com.android.inputmethod.latin.makedict.BinaryDictInputOutput;
+import com.android.inputmethod.latin.makedict.FormatSpec;
+import com.android.inputmethod.latin.makedict.FusionDictionary;
+import com.android.inputmethod.latin.makedict.MakedictLog;
+import com.android.inputmethod.latin.makedict.UnsupportedFormatException;
import java.io.File;
import java.io.FileInputStream;
@@ -22,7 +28,8 @@ import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
-import java.io.RandomAccessFile;
+import java.nio.ByteBuffer;
+import java.nio.channels.FileChannel;
import java.util.Arrays;
import java.util.LinkedList;
@@ -36,40 +43,35 @@ import org.xml.sax.SAXException;
public class DictionaryMaker {
static class Arguments {
- private final static String OPTION_VERSION_2 = "-2";
- private final static String OPTION_INPUT_SOURCE = "-s";
- private final static String OPTION_INPUT_BIGRAM_XML = "-b";
- private final static String OPTION_INPUT_SHORTCUT_XML = "-c";
- private final static String OPTION_OUTPUT_BINARY = "-d";
- private final static String OPTION_OUTPUT_BINARY_FORMAT_VERSION_1 = "-d1";
- private final static String OPTION_OUTPUT_XML = "-x";
- private final static String OPTION_HELP = "-h";
+ private static final String OPTION_VERSION_1 = "-1";
+ private static final String OPTION_VERSION_2 = "-2";
+ private static final String OPTION_VERSION_3 = "-3";
+ private static final String OPTION_INPUT_SOURCE = "-s";
+ private static final String OPTION_INPUT_BIGRAM_XML = "-b";
+ private static final String OPTION_INPUT_SHORTCUT_XML = "-c";
+ private static final String OPTION_OUTPUT_BINARY = "-d";
+ private static final String OPTION_OUTPUT_XML = "-x";
+ private static final String OPTION_HELP = "-h";
public final String mInputBinary;
public final String mInputUnigramXml;
public final String mInputShortcutXml;
public final String mInputBigramXml;
public final String mOutputBinary;
- public final String mOutputBinaryFormat1;
public final String mOutputXml;
+ public final int mOutputBinaryFormatVersion;
private void checkIntegrity() throws IOException {
checkHasExactlyOneInput();
checkHasAtLeastOneOutput();
checkNotSameFile(mInputBinary, mOutputBinary);
- checkNotSameFile(mInputBinary, mOutputBinaryFormat1);
checkNotSameFile(mInputBinary, mOutputXml);
checkNotSameFile(mInputUnigramXml, mOutputBinary);
- checkNotSameFile(mInputUnigramXml, mOutputBinaryFormat1);
checkNotSameFile(mInputUnigramXml, mOutputXml);
checkNotSameFile(mInputShortcutXml, mOutputBinary);
- checkNotSameFile(mInputShortcutXml, mOutputBinaryFormat1);
checkNotSameFile(mInputShortcutXml, mOutputXml);
checkNotSameFile(mInputBigramXml, mOutputBinary);
- checkNotSameFile(mInputBigramXml, mOutputBinaryFormat1);
checkNotSameFile(mInputBigramXml, mOutputXml);
- checkNotSameFile(mOutputBinary, mOutputBinaryFormat1);
checkNotSameFile(mOutputBinary, mOutputXml);
- checkNotSameFile(mOutputBinaryFormat1, mOutputXml);
}
private void checkHasExactlyOneInput() {
@@ -84,7 +86,7 @@ public class DictionaryMaker {
}
private void checkHasAtLeastOneOutput() {
- if (null == mOutputBinary && null == mOutputBinaryFormat1 && null == mOutputXml) {
+ if (null == mOutputBinary && null == mOutputXml) {
throw new RuntimeException("No output specified");
}
}
@@ -102,19 +104,23 @@ public class DictionaryMaker {
}
private void displayHelp() {
- MakedictLog.i("Usage: makedict "
- + "[-s <unigrams.xml> [-b <bigrams.xml>] [-c <shortcuts.xml>] "
- + "| -s <binary input>] [-d <binary output format version 2>] "
- + "[-d1 <binary output format version 1>] [-x <xml output>] [-2]\n"
+ MakedictLog.i(getHelp());
+ }
+
+ public static String getHelp() {
+ return "Usage: makedict "
+ + "[-s <unigrams.xml> [-b <bigrams.xml>] [-c <shortcuts_and_whitelist.xml>] "
+ + "| [-s <binary input>] [-d <binary output>] [-x <xml output>] "
+ + "[-1] [-2] [-3]\n"
+ "\n"
+ " Converts a source dictionary file to one or several outputs.\n"
+ " Source can be an XML file, with an optional XML bigrams file, or a\n"
+ " binary dictionary file.\n"
- + " Binary version 1 (Ice Cream Sandwich), 2 (Jelly Bean) and XML outputs\n"
+ + " Binary version 1 (Ice Cream Sandwich), 2 (Jelly Bean), 3 and XML outputs\n"
+ " are supported. All three can be output at the same time, but the same\n"
+ " output format cannot be specified several times. The behavior is\n"
+ " unspecified if the same file is specified for input and output, or for\n"
- + " several outputs.");
+ + " several outputs.";
}
public Arguments(String[] argsArray) throws IOException {
@@ -127,8 +133,8 @@ public class DictionaryMaker {
String inputShortcutXml = null;
String inputBigramXml = null;
String outputBinary = null;
- String outputBinaryFormat1 = null;
String outputXml = null;
+ int outputBinaryFormatVersion = 2; // the default version is 2.
while (!args.isEmpty()) {
final String arg = args.get(0);
@@ -136,6 +142,10 @@ public class DictionaryMaker {
if (arg.charAt(0) == '-') {
if (OPTION_VERSION_2.equals(arg)) {
// Do nothing, this is the default
+ } else if (OPTION_VERSION_3.equals(arg)) {
+ outputBinaryFormatVersion = 3;
+ } else if (OPTION_VERSION_1.equals(arg)) {
+ outputBinaryFormatVersion = 1;
} else if (OPTION_HELP.equals(arg)) {
displayHelp();
} else {
@@ -158,8 +168,6 @@ public class DictionaryMaker {
inputBigramXml = filename;
} else if (OPTION_OUTPUT_BINARY.equals(arg)) {
outputBinary = filename;
- } else if (OPTION_OUTPUT_BINARY_FORMAT_VERSION_1.equals(arg)) {
- outputBinaryFormat1 = filename;
} else if (OPTION_OUTPUT_XML.equals(arg)) {
outputXml = filename;
} else {
@@ -186,8 +194,8 @@ public class DictionaryMaker {
mInputShortcutXml = inputShortcutXml;
mInputBigramXml = inputBigramXml;
mOutputBinary = outputBinary;
- mOutputBinaryFormat1 = outputBinaryFormat1;
mOutputXml = outputXml;
+ mOutputBinaryFormatVersion = outputBinaryFormatVersion;
checkIntegrity();
}
}
@@ -229,15 +237,31 @@ public class DictionaryMaker {
*/
private static FusionDictionary readBinaryFile(final String binaryFilename)
throws FileNotFoundException, IOException, UnsupportedFormatException {
- final RandomAccessFile inputFile = new RandomAccessFile(binaryFilename, "r");
- return BinaryDictInputOutput.readDictionaryBinary(inputFile, null);
+ FileInputStream inStream = null;
+
+ try {
+ final File file = new File(binaryFilename);
+ inStream = new FileInputStream(file);
+ final ByteBuffer buffer = inStream.getChannel().map(
+ FileChannel.MapMode.READ_ONLY, 0, file.length());
+ return BinaryDictInputOutput.readDictionaryBinary(
+ new BinaryDictInputOutput.ByteBufferWrapper(buffer), null);
+ } finally {
+ if (inStream != null) {
+ try {
+ inStream.close();
+ } catch (IOException e) {
+ // do nothing
+ }
+ }
+ }
}
/**
* Read a dictionary from a unigram XML file, and optionally a bigram XML file.
*
* @param unigramXmlFilename the name of the unigram XML file. May not be null.
- * @param shortcutXmlFilename the name of the shortcut XML file, or null if there is none.
+ * @param shortcutXmlFilename the name of the shortcut/whitelist XML file, or null if none.
* @param bigramXmlFilename the name of the bigram XML file. Pass null if there are no bigrams.
* @return the read dictionary.
* @throws FileNotFoundException if one of the files can't be found
@@ -269,10 +293,7 @@ public class DictionaryMaker {
throws FileNotFoundException, IOException, UnsupportedFormatException,
IllegalArgumentException {
if (null != args.mOutputBinary) {
- writeBinaryDictionary(args.mOutputBinary, dict, 2);
- }
- if (null != args.mOutputBinaryFormat1) {
- writeBinaryDictionary(args.mOutputBinaryFormat1, dict, 1);
+ writeBinaryDictionary(args.mOutputBinary, dict, args.mOutputBinaryFormatVersion);
}
if (null != args.mOutputXml) {
writeXmlDictionary(args.mOutputXml, dict);
@@ -292,8 +313,9 @@ public class DictionaryMaker {
final FusionDictionary dict, final int version)
throws FileNotFoundException, IOException, UnsupportedFormatException {
final File outputFile = new File(outputFilename);
+ final FormatSpec.FormatOptions formatOptions = new FormatSpec.FormatOptions(version);
BinaryDictInputOutput.writeDictionaryBinary(new FileOutputStream(outputFilename), dict,
- version);
+ formatOptions);
}
/**
diff --git a/tools/dicttool/src/android/inputmethod/latin/dicttool/Dicttool.java b/tools/dicttool/src/android/inputmethod/latin/dicttool/Dicttool.java
new file mode 100644
index 000000000..bf417fb5a
--- /dev/null
+++ b/tools/dicttool/src/android/inputmethod/latin/dicttool/Dicttool.java
@@ -0,0 +1,94 @@
+/**
+ * Copyright (C) 2012 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.
+ */
+
+package com.android.inputmethod.latin.dicttool;
+
+import java.util.Arrays;
+import java.util.HashMap;
+
+public class Dicttool {
+
+ public static abstract class Command {
+ protected String[] mArgs;
+ public void setArgs(String[] args) throws IllegalArgumentException {
+ mArgs = args;
+ }
+ abstract public String getHelp();
+ abstract public void run() throws Exception;
+ }
+ static HashMap<String, Class<? extends Command>> sCommands =
+ new HashMap<String, Class<? extends Command>>();
+ static {
+ CommandList.populate();
+ AdditionalCommandList.populate();
+ }
+ public static void addCommand(final String commandName, final Class<? extends Command> cls) {
+ sCommands.put(commandName, cls);
+ }
+
+ private static Command getCommandInstance(final String commandName) {
+ try {
+ return sCommands.get(commandName).newInstance();
+ } catch (InstantiationException e) {
+ throw new RuntimeException(commandName + " is not installed");
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(commandName + " is not installed");
+ }
+ }
+
+ private static void help() {
+ System.out.println("Syntax: dicttool <command [arguments]>\nAvailable commands:\n");
+ for (final String commandName : sCommands.keySet()) {
+ System.out.println("*** " + commandName);
+ System.out.println(getCommandInstance(commandName).getHelp());
+ System.out.println("");
+ }
+ }
+
+ private static boolean isCommand(final String commandName) {
+ return sCommands.containsKey(commandName);
+ }
+
+ private Command getCommand(final String[] arguments) {
+ final String commandName = arguments[0];
+ if (!isCommand(commandName)) {
+ throw new RuntimeException("Unknown command : " + commandName);
+ }
+ final Command command = getCommandInstance(commandName);
+ final String[] argsArray = Arrays.copyOfRange(arguments, 1, arguments.length);
+ command.setArgs(argsArray);
+ return command;
+ }
+
+ private void execute(final String[] arguments) {
+ final Command command = getCommand(arguments);
+ try {
+ command.run();
+ } catch (Exception e) {
+ System.out.println("Exception while processing command "
+ + command.getClass().getSimpleName() + " : " + e);
+ return;
+ }
+ }
+
+ public static void main(final String[] arguments) {
+ if (0 == arguments.length) {
+ help();
+ return;
+ }
+ new Dicttool().execute(arguments);
+ }
+}
diff --git a/tools/dicttool/src/android/inputmethod/latin/dicttool/Info.java b/tools/dicttool/src/android/inputmethod/latin/dicttool/Info.java
new file mode 100644
index 000000000..e59261706
--- /dev/null
+++ b/tools/dicttool/src/android/inputmethod/latin/dicttool/Info.java
@@ -0,0 +1,36 @@
+/**
+ * Copyright (C) 2012 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.
+ */
+
+package com.android.inputmethod.latin.dicttool;
+
+public class Info extends Dicttool.Command {
+ public static final String COMMAND = "info";
+
+ public Info() {
+ }
+
+ public String getHelp() {
+ return "info <filename>: prints various information about a dictionary file";
+ }
+
+ public void run() {
+ // TODO: implement this
+ if (mArgs.length < 1) {
+ throw new RuntimeException("Not enough arguments for command " + COMMAND);
+ }
+ System.out.println("Not implemented yet");
+ }
+}
diff --git a/tools/dicttool/src/android/inputmethod/latin/dicttool/Makedict.java b/tools/dicttool/src/android/inputmethod/latin/dicttool/Makedict.java
new file mode 100644
index 000000000..c004cfbe4
--- /dev/null
+++ b/tools/dicttool/src/android/inputmethod/latin/dicttool/Makedict.java
@@ -0,0 +1,40 @@
+/**
+ * Copyright (C) 2012 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.
+ */
+
+package com.android.inputmethod.latin.dicttool;
+
+import com.android.inputmethod.latin.makedict.UnsupportedFormatException;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import javax.xml.parsers.ParserConfigurationException;
+import org.xml.sax.SAXException;
+
+public class Makedict extends Dicttool.Command {
+ public static final String COMMAND = "makedict";
+
+ public Makedict() {
+ }
+
+ public String getHelp() {
+ return DictionaryMaker.Arguments.getHelp();
+ }
+
+ public void run() throws FileNotFoundException, IOException, ParserConfigurationException,
+ SAXException, UnsupportedFormatException {
+ DictionaryMaker.main(mArgs);
+ }
+}
diff --git a/tools/makedict/src/com/android/inputmethod/latin/makedict/MakedictLog.java b/tools/dicttool/src/android/inputmethod/latin/dicttool/MakedictLog.java
index 7eccff2b4..7eccff2b4 100644
--- a/tools/makedict/src/com/android/inputmethod/latin/makedict/MakedictLog.java
+++ b/tools/dicttool/src/android/inputmethod/latin/dicttool/MakedictLog.java
diff --git a/tools/makedict/src/com/android/inputmethod/latin/makedict/XmlDictInputOutput.java b/tools/dicttool/src/android/inputmethod/latin/dicttool/XmlDictInputOutput.java
index 52f124dfb..c31cd724a 100644
--- a/tools/makedict/src/com/android/inputmethod/latin/makedict/XmlDictInputOutput.java
+++ b/tools/dicttool/src/android/inputmethod/latin/dicttool/XmlDictInputOutput.java
@@ -14,11 +14,13 @@
* the License.
*/
-package com.android.inputmethod.latin.makedict;
+package com.android.inputmethod.latin.dicttool;
+import com.android.inputmethod.latin.makedict.FusionDictionary;
import com.android.inputmethod.latin.makedict.FusionDictionary.DictionaryOptions;
import com.android.inputmethod.latin.makedict.FusionDictionary.Node;
import com.android.inputmethod.latin.makedict.FusionDictionary.WeightedString;
+import com.android.inputmethod.latin.makedict.Word;
import java.io.IOException;
import java.io.InputStream;
@@ -48,6 +50,7 @@ public class XmlDictInputOutput {
private static final String SHORTCUT_TAG = "shortcut";
private static final String FREQUENCY_ATTR = "f";
private static final String WORD_ATTR = "word";
+ private static final String NOT_A_WORD_ATTR = "not_a_word";
private static final int SHORTCUT_ONLY_DEFAULT_FREQ = 1;
@@ -88,6 +91,10 @@ public class XmlDictInputOutput {
public FusionDictionary getFinalDictionary() {
final FusionDictionary dict = mDictionary;
+ for (final String shortcutOnly : mShortcutsMap.keySet()) {
+ if (dict.hasWord(shortcutOnly)) continue;
+ dict.add(shortcutOnly, 0, mShortcutsMap.get(shortcutOnly), true /* isNotAWord */);
+ }
mDictionary = null;
mShortcutsMap.clear();
mWord = "";
@@ -138,7 +145,7 @@ public class XmlDictInputOutput {
@Override
public void endElement(String uri, String localName, String qName) {
if (WORD == mState) {
- mDictionary.add(mWord, mFreq, mShortcutsMap.get(mWord));
+ mDictionary.add(mWord, mFreq, mShortcutsMap.get(mWord), false /* isNotAWord */);
mState = START;
}
}
@@ -177,7 +184,7 @@ public class XmlDictInputOutput {
mSrc = attrs.getValue(uri, SRC_ATTRIBUTE);
} else if (DST_TAG.equals(localName)) {
String dst = attrs.getValue(uri, DST_ATTRIBUTE);
- int freq = Integer.parseInt(attrs.getValue(uri, DST_FREQ));
+ int freq = getValueFromFreqString(attrs.getValue(uri, DST_FREQ));
WeightedString bigram = new WeightedString(dst, freq / XML_TO_MEMORY_RATIO);
ArrayList<WeightedString> bigramList = mAssocMap.get(mSrc);
if (null == bigramList) bigramList = new ArrayList<WeightedString>();
@@ -186,6 +193,10 @@ public class XmlDictInputOutput {
}
}
+ protected int getValueFromFreqString(final String freqString) {
+ return Integer.parseInt(freqString);
+ }
+
// This may return an empty map, but will never return null.
public HashMap<String, ArrayList<WeightedString>> getAssocMap() {
return mAssocMap;
@@ -214,22 +225,40 @@ public class XmlDictInputOutput {
}
/**
- * SAX handler for a shortcut XML file.
+ * SAX handler for a shortcut & whitelist XML file.
*/
- static private class ShortcutHandler extends AssociativeListHandler {
+ static private class ShortcutAndWhitelistHandler extends AssociativeListHandler {
private final static String ENTRY_TAG = "entry";
private final static String ENTRY_ATTRIBUTE = "shortcut";
private final static String TARGET_TAG = "target";
private final static String REPLACEMENT_ATTRIBUTE = "replacement";
private final static String TARGET_PRIORITY_ATTRIBUTE = "priority";
+ private final static String WHITELIST_MARKER = "whitelist";
+ private final static int WHITELIST_FREQ_VALUE = 15;
+ private final static int MIN_FREQ = 0;
+ private final static int MAX_FREQ = 14;
- public ShortcutHandler() {
+ public ShortcutAndWhitelistHandler() {
super(ENTRY_TAG, ENTRY_ATTRIBUTE, TARGET_TAG, REPLACEMENT_ATTRIBUTE,
TARGET_PRIORITY_ATTRIBUTE);
}
+ @Override
+ protected int getValueFromFreqString(final String freqString) {
+ if (WHITELIST_MARKER.equals(freqString)) {
+ return WHITELIST_FREQ_VALUE;
+ } else {
+ final int intValue = super.getValueFromFreqString(freqString);
+ if (intValue < MIN_FREQ || intValue > MAX_FREQ) {
+ throw new RuntimeException("Shortcut freq out of range. Accepted range is "
+ + MIN_FREQ + ".." + MAX_FREQ);
+ }
+ return intValue;
+ }
+ }
+
// As per getAssocMap(), this never returns null.
- public HashMap<String, ArrayList<WeightedString>> getShortcutMap() {
+ public HashMap<String, ArrayList<WeightedString>> getShortcutAndWhitelistMap() {
return getAssocMap();
}
}
@@ -241,7 +270,7 @@ public class XmlDictInputOutput {
* representation.
*
* @param unigrams the file to read the data from.
- * @param shortcuts the file to read the shortcuts from, or null.
+ * @param shortcuts the file to read the shortcuts & whitelist from, or null.
* @param bigrams the file to read the bigrams from, or null.
* @return the in-memory representation of the dictionary.
*/
@@ -254,11 +283,12 @@ public class XmlDictInputOutput {
final BigramHandler bigramHandler = new BigramHandler();
if (null != bigrams) parser.parse(bigrams, bigramHandler);
- final ShortcutHandler shortcutHandler = new ShortcutHandler();
- if (null != shortcuts) parser.parse(shortcuts, shortcutHandler);
+ final ShortcutAndWhitelistHandler shortcutAndWhitelistHandler =
+ new ShortcutAndWhitelistHandler();
+ if (null != shortcuts) parser.parse(shortcuts, shortcutAndWhitelistHandler);
final UnigramHandler unigramHandler =
- new UnigramHandler(shortcutHandler.getShortcutMap());
+ new UnigramHandler(shortcutAndWhitelistHandler.getShortcutAndWhitelistMap());
parser.parse(unigrams, unigramHandler);
final FusionDictionary dict = unigramHandler.getFinalDictionary();
final HashMap<String, ArrayList<WeightedString>> bigramMap = bigramHandler.getBigramMap();
@@ -278,7 +308,7 @@ public class XmlDictInputOutput {
*
* This method reads data from the parser and creates a new FusionDictionary with it.
* The format parsed by this method is the format used before Ice Cream Sandwich,
- * which has no support for bigrams or shortcuts.
+ * which has no support for bigrams or shortcuts/whitelist.
* It is important to note that this method expects the parser to have already eaten
* the first, all-encompassing tag.
*
@@ -289,7 +319,7 @@ public class XmlDictInputOutput {
/**
* Writes a dictionary to an XML file.
*
- * The output format is the "second" format, which supports bigrams and shortcuts.
+ * The output format is the "second" format, which supports bigrams and shortcuts/whitelist.
*
* @param destination a destination stream to write to.
* @param dict the dictionary to write.
@@ -316,7 +346,8 @@ public class XmlDictInputOutput {
destination.write("<!-- Warning: there is no code to read this format yet. -->\n");
for (Word word : set) {
destination.write(" <" + WORD_TAG + " " + WORD_ATTR + "=\"" + word.mWord + "\" "
- + FREQUENCY_ATTR + "=\"" + word.mFrequency + "\">");
+ + FREQUENCY_ATTR + "=\"" + word.mFrequency
+ + (word.mIsNotAWord ? "\" " + NOT_A_WORD_ATTR + "=\"true" : "") + "\">");
if (null != word.mShortcutTargets) {
destination.write("\n");
for (WeightedString target : word.mShortcutTargets) {
diff --git a/tools/makedict/tests/com/android/inputmethod/latin/BinaryDictInputOutputTest.java b/tools/dicttool/tests/com/android/inputmethod/latin/makedict/BinaryDictInputOutputTest.java
index 24042f120..88589b815 100644
--- a/tools/makedict/tests/com/android/inputmethod/latin/BinaryDictInputOutputTest.java
+++ b/tools/dicttool/tests/com/android/inputmethod/latin/makedict/BinaryDictInputOutputTest.java
@@ -43,11 +43,11 @@ public class BinaryDictInputOutputTest extends TestCase {
final FusionDictionary dict = new FusionDictionary(new Node(),
new DictionaryOptions(new HashMap<String, String>(),
false /* germanUmlautProcessing */, false /* frenchLigatureProcessing */));
- dict.add("foo", 1, null);
- dict.add("fta", 1, null);
- dict.add("ftb", 1, null);
- dict.add("bar", 1, null);
- dict.add("fool", 1, null);
+ dict.add("foo", 1, null, false /* isNotAWord */);
+ dict.add("fta", 1, null, false /* isNotAWord */);
+ dict.add("ftb", 1, null, false /* isNotAWord */);
+ dict.add("bar", 1, null, false /* isNotAWord */);
+ dict.add("fool", 1, null, false /* isNotAWord */);
final ArrayList<Node> result = BinaryDictInputOutput.flattenTree(dict.mRoot);
assertEquals(4, result.size());
while (!result.isEmpty()) {
diff --git a/tools/dicttool/tests/etc/test-dicttool.sh b/tools/dicttool/tests/etc/test-dicttool.sh
new file mode 100755
index 000000000..8834611cd
--- /dev/null
+++ b/tools/dicttool/tests/etc/test-dicttool.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+# Copyright 2012, 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.
+
+java -classpath ${ANDROID_HOST_OUT}/framework/junit.jar:${ANDROID_HOST_OUT}/../common/obj/JAVA_LIBRARIES/dicttool_intermediates/classes junit.textui.TestRunner com.android.inputmethod.latin.makedict.BinaryDictInputOutputTest
diff --git a/tools/makedict/etc/manifest.txt b/tools/makedict/etc/manifest.txt
deleted file mode 100644
index 4f085e7c8..000000000
--- a/tools/makedict/etc/manifest.txt
+++ /dev/null
@@ -1 +0,0 @@
-Main-Class: com.android.inputmethod.latin.makedict.DictionaryMaker
diff --git a/tools/maketext/res/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.tmpl b/tools/maketext/res/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.tmpl
index f6c84eaf2..774094cd7 100644
--- a/tools/maketext/res/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.tmpl
+++ b/tools/maketext/res/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.tmpl
@@ -19,6 +19,7 @@ package com.android.inputmethod.keyboard.internal;
import android.content.Context;
import android.content.res.Resources;
+import com.android.inputmethod.latin.CollectionUtils;
import com.android.inputmethod.latin.R;
import java.util.HashMap;
@@ -45,14 +46,12 @@ import java.util.HashMap;
*/
public final class KeyboardTextsSet {
// Language to texts map.
- private static final HashMap<String, String[]> sLocaleToTextsMap =
- new HashMap<String, String[]>();
- private static final HashMap<String, Integer> sNameToIdsMap =
- new HashMap<String, Integer>();
+ private static final HashMap<String, String[]> sLocaleToTextsMap = CollectionUtils.newHashMap();
+ private static final HashMap<String, Integer> sNameToIdsMap = CollectionUtils.newHashMap();
private String[] mTexts;
// Resource name to text map.
- private HashMap<String, String> mResourceNameToTextsMap = new HashMap<String, String>();
+ private HashMap<String, String> mResourceNameToTextsMap = CollectionUtils.newHashMap();
public void setLanguage(final String language) {
mTexts = sLocaleToTextsMap.get(language);
diff --git a/tools/maketext/res/values-af/donottranslate-more-keys.xml b/tools/maketext/res/values-af/donottranslate-more-keys.xml
new file mode 100644
index 000000000..ee96f442d
--- /dev/null
+++ b/tools/maketext/res/values-af/donottranslate-more-keys.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2012, 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">
+ <!-- This is the same as Dutch except more keys of y and demoting vowels with diaeresis. -->
+ <!-- U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
+ U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX
+ U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS
+ U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
+ U+00E6: "æ" LATIN SMALL LETTER AE
+ U+00E3: "ã" LATIN SMALL LETTER A WITH TILDE
+ U+00E5: "å" LATIN SMALL LETTER A WITH RING ABOVE
+ U+0101: "ā" LATIN SMALL LETTER A WITH MACRON -->
+ <string name="more_keys_for_a">&#x00E1;,&#x00E2;,&#x00E4;,&#x00E0;,&#x00E6;,&#x00E3;,&#x00E5;,&#x0101;</string>
+ <!-- U+00E9: "é" LATIN SMALL LETTER E WITH ACUTE
+ U+00E8: "è" LATIN SMALL LETTER E WITH GRAVE
+ U+00EA: "ê" LATIN SMALL LETTER E WITH CIRCUMFLEX
+ U+00EB: "ë" LATIN SMALL LETTER E WITH DIAERESIS
+ U+0119: "ę" LATIN SMALL LETTER E WITH OGONEK
+ U+0117: "ė" LATIN SMALL LETTER E WITH DOT ABOVE
+ U+0113: "ē" LATIN SMALL LETTER E WITH MACRON -->
+ <string name="more_keys_for_e">&#x00E9;,&#x00E8;,&#x00EA;,&#x00EB;,&#x0119;,&#x0117;,&#x0113;</string>
+ <!-- U+00ED: "í" LATIN SMALL LETTER I WITH ACUTE
+ U+00EC: "ì" LATIN SMALL LETTER I WITH GRAVE
+ U+00EF: "ï" LATIN SMALL LETTER I WITH DIAERESIS
+ U+00EE: "î" LATIN SMALL LETTER I WITH CIRCUMFLEX
+ U+012F: "į" LATIN SMALL LETTER I WITH OGONEK
+ U+012B: "ī" LATIN SMALL LETTER I WITH MACRON
+ U+0133: "ij" LATIN SMALL LIGATURE IJ -->
+ <string name="more_keys_for_i">&#x00ED;,&#x00EC;,&#x00EF;,&#x00EE;,&#x012F;,&#x012B;,&#x0133;</string>
+ <!-- U+00F3: "ó" LATIN SMALL LETTER O WITH ACUTE
+ U+00F4: "ô" LATIN SMALL LETTER O WITH CIRCUMFLEX
+ U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS
+ U+00F2: "ò" LATIN SMALL LETTER O WITH GRAVE
+ U+00F5: "õ" LATIN SMALL LETTER O WITH TILDE
+ U+0153: "œ" LATIN SMALL LIGATURE OE
+ U+00F8: "ø" LATIN SMALL LETTER O WITH STROKE
+ U+014D: "ō" LATIN SMALL LETTER O WITH MACRON -->
+ <string name="more_keys_for_o">&#x00F3;,&#x00F4;,&#x00F6;,&#x00F2;,&#x00F5;,&#x0153;,&#x00F8;,&#x014D;</string>
+ <!-- U+00FA: "ú" LATIN SMALL LETTER U WITH ACUTE
+ U+00FB: "û" LATIN SMALL LETTER U WITH CIRCUMFLEX
+ U+00FC: "ü" LATIN SMALL LETTER U WITH DIAERESIS
+ U+00F9: "ù" LATIN SMALL LETTER U WITH GRAVE
+ U+016B: "ū" LATIN SMALL LETTER U WITH MACRON -->
+ <string name="more_keys_for_u">&#x00FA;,&#x00FB;,&#x00FC;,&#x00F9;,&#x016B;</string>
+ <!-- U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE
+ U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE -->
+ <string name="more_keys_for_n">&#x00F1;,&#x0144;</string>
+ <string name="more_keys_for_y">&#x00FD;,&#x0177;,&#x00FF;,&#x0133;</string>
+ <!-- U+00FD: "ý" LATIN SMALL LETTER Y WITH ACUTE
+ U+0133: "ij" LATIN SMALL LIGATURE IJ -->
+ <string name="more_keys_for_y">&#x00FD;,&#x0133;</string>
+</resources>
diff --git a/tools/maketext/res/values-be/donottranslate-more-keys.xml b/tools/maketext/res/values-be/donottranslate-more-keys.xml
index 835553a1f..a2056e932 100644
--- a/tools/maketext/res/values-be/donottranslate-more-keys.xml
+++ b/tools/maketext/res/values-be/donottranslate-more-keys.xml
@@ -20,12 +20,16 @@
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- U+045E: "ў" CYRILLIC SMALL LETTER SHORT U -->
<string name="keylabel_for_east_slavic_row1_9">&#x045E;</string>
+ <!-- U+0451: "ё" CYRILLIC SMALL LETTER IO -->
+ <string name="keylabel_for_east_slavic_row1_12">&#x0451;</string>
<!-- U+044B: "ы" CYRILLIC SMALL LETTER YERU -->
<string name="keylabel_for_east_slavic_row2_1">&#x044B;</string>
+ <!-- U+044D: "э" CYRILLIC SMALL LETTER E -->
+ <string name="keylabel_for_east_slavic_row2_11">&#x044D;</string>
<!-- U+0456: "і" CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I -->
<string name="keylabel_for_east_slavic_row3_5">&#x0456;</string>
- <!-- U+044A: "ъ" CYRILLIC SMALL LETTER HARD SIGN -->
- <string name="more_keys_for_cyrillic_ha">&#x044A;</string>
+ <!-- U+0451: "ё" CYRILLIC SMALL LETTER IO -->
+ <string name="more_keys_for_cyrillic_ie">&#x0451;</string>
<!-- U+044A: "ъ" CYRILLIC SMALL LETTER HARD SIGN -->
<string name="more_keys_for_cyrillic_soft_sign">&#x044A;</string>
</resources>
diff --git a/tools/maketext/res/values-eo/donottranslate-more-keys.xml b/tools/maketext/res/values-eo/donottranslate-more-keys.xml
new file mode 100644
index 000000000..e929869e2
--- /dev/null
+++ b/tools/maketext/res/values-eo/donottranslate-more-keys.xml
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2012, 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">
+ <!-- U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
+ U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
+ U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX
+ U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS
+ U+00E6: "æ" LATIN SMALL LETTER AE
+ U+00E3: "ã" LATIN SMALL LETTER A WITH TILDE
+ U+00E5: "å" LATIN SMALL LETTER A WITH RING ABOVE
+ U+0101: "ā" LATIN SMALL LETTER A WITH MACRON
+ U+0103: "ă" LATIN SMALL LETTER A WITH BREVE
+ U+0105: "ą" LATIN SMALL LETTER A WITH OGONEK
+ U+00AA: "ª" FEMININE ORDINAL INDICATOR -->
+ <string name="more_keys_for_a">&#x00E1;,&#x00E0;,&#x00E2;,&#x00E4;,&#x00E6;,&#x00E3;,&#x00E5;,&#x0101;,&#x0103;,&#x0105;,&#x00AA;</string>
+ <!-- U+00E9: "é" LATIN SMALL LETTER E WITH ACUTE
+ U+011B: "ě" LATIN SMALL LETTER E WITH CARON
+ U+00E8: "è" LATIN SMALL LETTER E WITH GRAVE
+ U+00EA: "ê" LATIN SMALL LETTER E WITH CIRCUMFLEX
+ U+00EB: "ë" LATIN SMALL LETTER E WITH DIAERESIS
+ U+0119: "ę" LATIN SMALL LETTER E WITH OGONEK
+ U+0117: "ė" LATIN SMALL LETTER E WITH DOT ABOVE
+ U+0113: "ē" LATIN SMALL LETTER E WITH MACRON -->
+ <string name="more_keys_for_e">&#x00E9;,&#x011B;,&#x00E8;,&#x00EA;,&#x00EB;,&#x0119;,&#x0117;,&#x0113;</string>
+ <!-- U+00ED: "í" LATIN SMALL LETTER I WITH ACUTE
+ U+00EE: "î" LATIN SMALL LETTER I WITH CIRCUMFLEX
+ U+00EF: "ï" LATIN SMALL LETTER I WITH DIAERESIS
+ U+0129: "ĩ" LATIN SMALL LETTER I WITH TILDE
+ U+00EC: "ì" LATIN SMALL LETTER I WITH GRAVE
+ U+012F: "į" LATIN SMALL LETTER I WITH OGONEK
+ U+012B: "ī" LATIN SMALL LETTER I WITH MACRON
+ U+0131: "ı" LATIN SMALL LETTER DOTLESS I
+ U+0133: "ij" LATIN SMALL LIGATURE IJ -->
+ <string name="more_keys_for_i">&#x00ED;,&#x00EE;,&#x00EF;,&#x0129;,&#x00EC;,&#x012F;,&#x012B;,&#x0131;,&#x0133;</string>
+ <!-- U+00F3: "ó" LATIN SMALL LETTER O WITH ACUTE
+ U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS
+ U+00F4: "ô" LATIN SMALL LETTER O WITH CIRCUMFLEX
+ U+00F2: "ò" LATIN SMALL LETTER O WITH GRAVE
+ U+00F5: "õ" LATIN SMALL LETTER O WITH TILDE
+ U+0153: "œ" LATIN SMALL LIGATURE OE
+ U+00F8: "ø" LATIN SMALL LETTER O WITH STROKE
+ U+014D: "ō" LATIN SMALL LETTER O WITH MACRON
+ U+0151: "ő" LATIN SMALL LETTER O WITH DOUBLE ACUTE
+ U+00BA: "º" MASCULINE ORDINAL INDICATOR -->
+ <string name="more_keys_for_o">&#x00F3;,&#x00F6;,&#x00F4;,&#x00F2;,&#x00F5;,&#x0153;,&#x00F8;,&#x014D;,&#x0151;,&#x00BA;</string>
+ <!-- U+00FA: "ú" LATIN SMALL LETTER U WITH ACUTE
+ U+016F: "ů" LATIN SMALL LETTER U WITH RING ABOVE
+ U+00FB: "û" LATIN SMALL LETTER U WITH CIRCUMFLEX
+ U+00FC: "ü" LATIN SMALL LETTER U WITH DIAERESIS
+ U+00F9: "ù" LATIN SMALL LETTER U WITH GRAVE
+ U+016B: "ū" LATIN SMALL LETTER U WITH MACRON
+ U+0169: "ũ" LATIN SMALL LETTER U WITH TILDE
+ U+0171: "ű" LATIN SMALL LETTER U WITH DOUBLE ACUTE
+ U+0173: "ų" LATIN SMALL LETTER U WITH OGONEK
+ U+00B5: "µ" MICRO SIGN -->
+ <string name="more_keys_for_u">&#x00FA;,&#x016F;,&#x00FB;,&#x00FC;,&#x00F9;,&#x016B;,&#x0169;,&#x0171;,&#x0173;,&#x00B5;</string>
+ <!-- U+00DF: "ß" LATIN SMALL LETTER SHARP S
+ U+0161: "š" LATIN SMALL LETTER S WITH CARON
+ U+015B: "ś" LATIN SMALL LETTER S WITH ACUTE
+ U+0219: "ș" LATIN SMALL LETTER S WITH COMMA BELOW
+ U+015F: "ş" LATIN SMALL LETTER S WITH CEDILLA -->
+ <string name="more_keys_for_s">&#x00DF;,&#x0161;,&#x015B;,&#x0219;,&#x015F;</string>
+ <!-- U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE
+ U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE
+ U+0146: "ņ" LATIN SMALL LETTER N WITH CEDILLA
+ U+0148: "ň" LATIN SMALL LETTER N WITH CARON
+ U+0149: "ʼn" LATIN SMALL LETTER N PRECEDED BY APOSTROPHE
+ U+014B: "ŋ" LATIN SMALL LETTER ENG -->
+ <string name="more_keys_for_n">&#x00F1;,&#x0144;,&#x0146;,&#x0148;,&#x0149;,&#x014B;</string>
+ <!-- U+0107: "ć" LATIN SMALL LETTER C WITH ACUTE
+ U+010D: "č" LATIN SMALL LETTER C WITH CARON
+ U+00E7: "ç" LATIN SMALL LETTER C WITH CEDILLA
+ U+010B: "ċ" LATIN SMALL LETTER C WITH DOT ABOVE -->
+ <string name="more_keys_for_c">&#x0107;,&#x010D;,&#x00E7;,&#x010B;</string>
+ <!-- U+00FD: "ý" LATIN SMALL LETTER Y WITH ACUTE
+ U+0177: "ŷ" LATIN SMALL LETTER Y WITH CIRCUMFLEX
+ U+00FF: "ÿ" LATIN SMALL LETTER Y WITH DIAERESIS
+ U+00FE: "þ" LATIN SMALL LETTER THORN -->
+ <string name="more_keys_for_y">y,&#x00FD;,&#x0177;,&#x00FF;,&#x00FE;</string>
+ <!-- U+00F0: "ð" LATIN SMALL LETTER ETH
+ U+010F: "ď" LATIN SMALL LETTER D WITH CARON
+ U+0111: "đ" LATIN SMALL LETTER D WITH STROKE -->
+ <string name="more_keys_for_d">&#x00F0;,&#x010F;,&#x0111;</string>
+ <!-- U+0159: "ř" LATIN SMALL LETTER R WITH CARON
+ U+0155: "ŕ" LATIN SMALL LETTER R WITH ACUTE
+ U+0157: "ŗ" LATIN SMALL LETTER R WITH CEDILLA -->
+ <string name="more_keys_for_r">&#x0159;,&#x0155;,&#x0157;</string>
+ <!-- U+0165: "ť" LATIN SMALL LETTER T WITH CARON
+ U+021B: "ț" LATIN SMALL LETTER T WITH COMMA BELOW
+ U+0163: "ţ" LATIN SMALL LETTER T WITH CEDILLA
+ U+0167: "ŧ" LATIN SMALL LETTER T WITH STROKE -->
+ <string name="more_keys_for_t">&#x0165;,&#x021B;,&#x0163;,&#x0167;</string>
+ <!-- U+017A: "ź" LATIN SMALL LETTER Z WITH ACUTE
+ U+017C: "ż" LATIN SMALL LETTER Z WITH DOT ABOVE
+ U+017E: "ž" LATIN SMALL LETTER Z WITH CARON -->
+ <string name="more_keys_for_z">&#x017A;,&#x017C;,&#x017E;</string>
+ <!-- U+0137: "ķ" LATIN SMALL LETTER K WITH CEDILLA
+ U+0138: "ĸ" LATIN SMALL LETTER KRA -->
+ <string name="more_keys_for_k">&#x0137;,&#x0138;</string>
+ <!-- U+013A: "ĺ" LATIN SMALL LETTER L WITH ACUTE
+ U+013C: "ļ" LATIN SMALL LETTER L WITH CEDILLA
+ U+013E: "ľ" LATIN SMALL LETTER L WITH CARON
+ U+0140: "ŀ" LATIN SMALL LETTER L WITH MIDDLE DOT
+ U+0142: "ł" LATIN SMALL LETTER L WITH STROKE -->
+ <string name="more_keys_for_l">&#x013A;,&#x013C;,&#x013E;,&#x0140;,&#x0142;</string>
+ <!-- U+011F: "ğ" LATIN SMALL LETTER G WITH BREVE
+ U+0121: "ġ" LATIN SMALL LETTER G WITH DOT ABOVE
+ U+0123: "ģ" LATIN SMALL LETTER G WITH CEDILLA -->
+ <string name="more_keys_for_g">&#x011F;,&#x0121;,&#x0123;</string>
+ <!-- U+0175: "ŵ" LATIN SMALL LETTER W WITH CIRCUMFLEX -->
+ <string name="more_keys_for_v">w,&#x0175;</string>
+ <!-- U+0125: "ĥ" LATIN SMALL LETTER H WITH CIRCUMFLEX
+ U+0127: "ħ" LATIN SMALL LETTER H WITH STROKE -->
+ <string name="more_keys_for_h">&#x0125;,&#x0127;</string>
+ <!-- U+0175: "ŵ" LATIN SMALL LETTER W WITH CIRCUMFLEX -->
+ <string name="more_keys_for_w">w,&#x0175;</string>
+ <string name="more_keys_for_q">q</string>
+ <string name="more_keys_for_x">x</string>
+ <!-- U+015D: "ŝ" LATIN SMALL LETTER S WITH CIRCUMFLEX -->
+ <string name="keylabel_for_q">&#x015D;</string>
+ <!-- U+011D: "ĝ" LATIN SMALL LETTER G WITH CIRCUMFLEX -->
+ <string name="keylabel_for_w">&#x011D;</string>
+ <!-- U+016D: "ŭ" LATIN SMALL LETTER U WITH BREVE -->
+ <string name="keylabel_for_y">&#x016D;</string>
+ <!-- U+0109: "ĉ" LATIN SMALL LETTER C WITH CIRCUMFLEX -->
+ <string name="keylabel_for_x">&#x0109;</string>
+ <!-- U+0135: "ĵ" LATIN SMALL LETTER J WITH CIRCUMFLEX -->
+ <string name="keylabel_for_spanish_row2_10">&#x0135;</string>
+</resources>
diff --git a/tools/maketext/res/values-es/donottranslate-more-keys.xml b/tools/maketext/res/values-es/donottranslate-more-keys.xml
index 2077af464..586dbade8 100644
--- a/tools/maketext/res/values-es/donottranslate-more-keys.xml
+++ b/tools/maketext/res/values-es/donottranslate-more-keys.xml
@@ -69,15 +69,9 @@
<string name="more_keys_for_c">&#x00E7;,&#x0107;,&#x010D;</string>
<!-- U+00A1: "¡" INVERTED EXCLAMATION MARK
U+00BF: "¿" INVERTED QUESTION MARK -->
- <string name="more_keys_for_punctuation">"!fixedColumnOrder!9,\",\',#,-,&#x00A1;,!,&#x00BF;,\\,,\?,\@,&amp;,\\%,+,;,:,/,(,)"</string>
- <string name="keyhintlabel_for_tablet_comma">&#x00A1;</string>
- <string name="more_keys_for_tablet_comma">"&#x00A1;,!"</string>
- <string name="keyhintlabel_for_tablet_period">&#x00BF;</string>
- <string name="more_keys_for_tablet_period">"&#x00BF;,\?"</string>
+ <string name="more_keys_for_punctuation">"!fixedColumnOrder!9,&#x00A1;,\",\',#,-,:,!,\\,,\?,&#x00BF;,\@,&amp;,\\%,+,;,/,(,)"</string>
<!-- U+00A1: "¡" INVERTED EXCLAMATION MARK -->
- <string name="keylabel_for_symbols_exclamation">"&#x00A1;"</string>
+ <string name="more_keys_for_tablet_comma">"!,&#x00A1;"</string>
<!-- U+00BF: "¿" INVERTED QUESTION MARK -->
- <string name="keylabel_for_symbols_question">"&#x00BF;"</string>
- <string name="more_keys_for_symbols_exclamation">"!"</string>
- <string name="more_keys_for_symbols_question">"\?"</string>
+ <string name="more_keys_for_tablet_period">"\?,&#x00BF;"</string>
</resources>
diff --git a/tools/maketext/res/values-ky/donottranslate-more-keys.xml b/tools/maketext/res/values-ky/donottranslate-more-keys.xml
index fd90248b2..a11ecf942 100644
--- a/tools/maketext/res/values-ky/donottranslate-more-keys.xml
+++ b/tools/maketext/res/values-ky/donottranslate-more-keys.xml
@@ -20,16 +20,20 @@
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- U+0449: "щ" CYRILLIC SMALL LETTER SHCHA -->
<string name="keylabel_for_east_slavic_row1_9">&#x0449;</string>
+ <!-- U+044A: "ъ" CYRILLIC SMALL LETTER HARD SIGN -->
+ <string name="keylabel_for_east_slavic_row1_12">&#x044A;</string>
<!-- U+044B: "ы" CYRILLIC SMALL LETTER YERU -->
<string name="keylabel_for_east_slavic_row2_1">&#x044B;</string>
+ <!-- U+044D: "э" CYRILLIC SMALL LETTER E -->
+ <string name="keylabel_for_east_slavic_row2_11">&#x044D;</string>
<!-- U+0438: "и" CYRILLIC SMALL LETTER I -->
<string name="keylabel_for_east_slavic_row3_5">&#x0438;</string>
<!-- U+04AF: "ү" CYRILLIC SMALL LETTER STRAIGHT U -->
<string name="more_keys_for_cyrillic_u">&#x04AF;</string>
+ <!-- U+0451: "ё" CYRILLIC SMALL LETTER IO -->
+ <string name="more_keys_for_cyrillic_ie">&#x0451;</string>
<!-- U+04A3: "ң" CYRILLIC SMALL LETTER EN WITH DESCENDER -->
<string name="more_keys_for_cyrillic_en">&#x04A3;</string>
- <!-- U+044A: "ъ" CYRILLIC SMALL LETTER HARD SIGN -->
- <string name="more_keys_for_cyrillic_ha">&#x044A;</string>
<!-- U+04E9: "ө" CYRILLIC SMALL LETTER BARRED O -->
<string name="more_keys_for_cyrillic_o">&#x04E9;</string>
<!-- U+044A: "ъ" CYRILLIC SMALL LETTER HARD SIGN -->
diff --git a/tools/maketext/res/values-ru/donottranslate-more-keys.xml b/tools/maketext/res/values-ru/donottranslate-more-keys.xml
index 0bb57074c..82bed784e 100644
--- a/tools/maketext/res/values-ru/donottranslate-more-keys.xml
+++ b/tools/maketext/res/values-ru/donottranslate-more-keys.xml
@@ -20,14 +20,16 @@
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- U+0449: "щ" CYRILLIC SMALL LETTER SHCHA -->
<string name="keylabel_for_east_slavic_row1_9">&#x0449;</string>
+ <!-- U+044A: "ъ" CYRILLIC SMALL LETTER HARD SIGN -->
+ <string name="keylabel_for_east_slavic_row1_12">&#x044A;</string>
<!-- U+044B: "ы" CYRILLIC SMALL LETTER YERU -->
<string name="keylabel_for_east_slavic_row2_1">&#x044B;</string>
+ <!-- U+044D: "э" CYRILLIC SMALL LETTER E -->
+ <string name="keylabel_for_east_slavic_row2_11">&#x044D;</string>
<!-- U+0438: "и" CYRILLIC SMALL LETTER I -->
<string name="keylabel_for_east_slavic_row3_5">&#x0438;</string>
<!-- U+0451: "ё" CYRILLIC SMALL LETTER IO -->
- <string name="more_keys_for_cyrillic_ye">&#x0451;</string>
- <!-- U+044A: "ъ" CYRILLIC SMALL LETTER HARD SIGN -->
- <string name="more_keys_for_cyrillic_ha">&#x044A;</string>
+ <string name="more_keys_for_cyrillic_ie">&#x0451;</string>
<!-- U+044A: "ъ" CYRILLIC SMALL LETTER HARD SIGN -->
<string name="more_keys_for_cyrillic_soft_sign">&#x044A;</string>
</resources>
diff --git a/tools/maketext/res/values-sr/donottranslate-more-keys.xml b/tools/maketext/res/values-sr/donottranslate-more-keys.xml
index e85d3d7a2..dcf0e857e 100644
--- a/tools/maketext/res/values-sr/donottranslate-more-keys.xml
+++ b/tools/maketext/res/values-sr/donottranslate-more-keys.xml
@@ -18,6 +18,24 @@
*/
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <!-- TODO: Move these to sr-Latn once we can handle IETF language tag with script name specified.
+ BEGIN: More keys definitions for Serbian (Latin)
+ U+0161: "š" LATIN SMALL LETTER S WITH CARON
+ U+00DF: "ß" LATIN SMALL LETTER SHARP S
+ U+015B: "ś" LATIN SMALL LETTER S WITH ACUTE
+ <string name="more_keys_for_s">&#x0161;,&#x00DF;,&#x015B;</string>
+ U+010D: "č" LATIN SMALL LETTER C WITH CARON
+ U+00E7: "ç" LATIN SMALL LETTER C WITH CEDILLA
+ U+0107: "ć" LATIN SMALL LETTER C WITH ACUTE
+ <string name="more_keys_for_c">&#x010D;,&#x00E7;,&#x0107;</string>
+ U+010F: "ď" LATIN SMALL LETTER D WITH CARON
+ <string name="more_keys_for_d">&#x010F;</string>
+ U+017E: "ž" LATIN SMALL LETTER Z WITH CARON
+ U+017A: "ź" LATIN SMALL LETTER Z WITH ACUTE
+ U+017C: "ż" LATIN SMALL LETTER Z WITH DOT ABOVE
+ <string name="more_keys_for_z">&#x017E;,&#x017A;,&#x017C;</string>
+ END: More keys definitions for Serbian (Latin) -->
+ <!-- BEGIN: More keys definitions for Serbian (Cyrillic) -->
<!-- U+0437: "з" CYRILLIC SMALL LETTER ZE -->
<string name="keylabel_for_south_slavic_row1_6">&#x0437;</string>
<!-- U+045B: "ћ" CYRILLIC SMALL LETTER TSHE -->
@@ -30,6 +48,7 @@
<string name="more_keys_for_cyrillic_ie">&#x0450;</string>
<!-- U+045D: "ѝ" CYRILLIC SMALL LETTER I WITH GRAVE -->
<string name="more_keys_for_cyrillic_i">&#x045D;</string>
+ <!-- END: More keys definitions for Serbian (Cyrillic) -->
<!-- U+2018: "‘" LEFT SINGLE QUOTATION MARK
U+2019: "’" RIGHT SINGLE QUOTATION MARK
U+201A: "‚" SINGLE LOW-9 QUOTATION MARK
diff --git a/tools/maketext/res/values-sw/donottranslate-more-keys.xml b/tools/maketext/res/values-sw/donottranslate-more-keys.xml
new file mode 100644
index 000000000..968a80c1c
--- /dev/null
+++ b/tools/maketext/res/values-sw/donottranslate-more-keys.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2012, 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">
+ <!-- This is the same as English except more_keys_for_g. -->
+ <!-- U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
+ U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
+ U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX
+ U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS
+ U+00E6: "æ" LATIN SMALL LETTER AE
+ U+00E3: "ã" LATIN SMALL LETTER A WITH TILDE
+ U+00E5: "å" LATIN SMALL LETTER A WITH RING ABOVE
+ U+0101: "ā" LATIN SMALL LETTER A WITH MACRON -->
+ <string name="more_keys_for_a">&#x00E0;,&#x00E1;,&#x00E2;,&#x00E4;,&#x00E6;,&#x00E3;,&#x00E5;,&#x0101;</string>
+ <!-- U+00E8: "è" LATIN SMALL LETTER E WITH GRAVE
+ U+00E9: "é" LATIN SMALL LETTER E WITH ACUTE
+ U+00EA: "ê" LATIN SMALL LETTER E WITH CIRCUMFLEX
+ U+00EB: "ë" LATIN SMALL LETTER E WITH DIAERESIS
+ U+0113: "ē" LATIN SMALL LETTER E WITH MACRON -->
+ <string name="more_keys_for_e">&#x00E8;,&#x00E9;,&#x00EA;,&#x00EB;,&#x0113;</string>
+ <!-- U+00EE: "î" LATIN SMALL LETTER I WITH CIRCUMFLEX
+ U+00EF: "ï" LATIN SMALL LETTER I WITH DIAERESIS
+ U+00ED: "í" LATIN SMALL LETTER I WITH ACUTE
+ U+012B: "ī" LATIN SMALL LETTER I WITH MACRON
+ U+00EC: "ì" LATIN SMALL LETTER I WITH GRAVE -->
+ <string name="more_keys_for_i">&#x00EE;,&#x00EF;,&#x00ED;,&#x012B;,&#x00EC;</string>
+ <!-- U+00F4: "ô" LATIN SMALL LETTER O WITH CIRCUMFLEX
+ U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS
+ U+00F2: "ò" LATIN SMALL LETTER O WITH GRAVE
+ U+00F3: "ó" LATIN SMALL LETTER O WITH ACUTE
+ U+0153: "œ" LATIN SMALL LIGATURE OE
+ U+00F8: "ø" LATIN SMALL LETTER O WITH STROKE
+ U+014D: "ō" LATIN SMALL LETTER O WITH MACRON
+ U+00F5: "õ" LATIN SMALL LETTER O WITH TILDE -->
+ <string name="more_keys_for_o">&#x00F4;,&#x00F6;,&#x00F2;,&#x00F3;,&#x0153;,&#x00F8;,&#x014D;,&#x00F5;</string>
+ <!-- U+00FB: "û" LATIN SMALL LETTER U WITH CIRCUMFLEX
+ U+00FC: "ü" LATIN SMALL LETTER U WITH DIAERESIS
+ U+00F9: "ù" LATIN SMALL LETTER U WITH GRAVE
+ U+00FA: "ú" LATIN SMALL LETTER U WITH ACUTE
+ U+016B: "ū" LATIN SMALL LETTER U WITH MACRON -->
+ <string name="more_keys_for_u">&#x00FB;,&#x00FC;,&#x00F9;,&#x00FA;,&#x016B;</string>
+ <!-- U+00DF: "ß" LATIN SMALL LETTER SHARP S -->
+ <string name="more_keys_for_s">&#x00DF;</string>
+ <!-- U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE -->
+ <string name="more_keys_for_n">&#x00F1;</string>
+ <!-- U+00E7: "ç" LATIN SMALL LETTER C WITH CEDILLA -->
+ <string name="more_keys_for_c">&#x00E7;</string>
+ <string name="more_keys_for_g">g\'</string>
+</resources>
diff --git a/tools/maketext/res/values-tl/donottranslate-more-keys.xml b/tools/maketext/res/values-tl/donottranslate-more-keys.xml
new file mode 100644
index 000000000..383d55ccf
--- /dev/null
+++ b/tools/maketext/res/values-tl/donottranslate-more-keys.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2012, 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">
+ <!-- U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
+ U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
+ U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS
+ U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX
+ U+00E3: "ã" LATIN SMALL LETTER A WITH TILDE
+ U+00E5: "å" LATIN SMALL LETTER A WITH RING ABOVE
+ U+0105: "ą" LATIN SMALL LETTER A WITH OGONEK
+ U+00E6: "æ" LATIN SMALL LETTER AE
+ U+0101: "ā" LATIN SMALL LETTER A WITH MACRON
+ U+00AA: "ª" FEMININE ORDINAL INDICATOR -->
+ <string name="more_keys_for_a">&#x00E1;,&#x00E0;,&#x00E4;,&#x00E2;,&#x00E3;,&#x00E5;,&#x0105;,&#x00E6;,&#x0101;,&#x00AA;</string>
+ <!-- U+00E9: "é" LATIN SMALL LETTER E WITH ACUTE
+ U+00E8: "è" LATIN SMALL LETTER E WITH GRAVE
+ U+00EB: "ë" LATIN SMALL LETTER E WITH DIAERESIS
+ U+00EA: "ê" LATIN SMALL LETTER E WITH CIRCUMFLEX
+ U+0119: "ę" LATIN SMALL LETTER E WITH OGONEK
+ U+0117: "ė" LATIN SMALL LETTER E WITH DOT ABOVE
+ U+0113: "ē" LATIN SMALL LETTER E WITH MACRON -->
+ <string name="more_keys_for_e">&#x00E9;,&#x00E8;,&#x00EB;,&#x00EA;,&#x0119;,&#x0117;,&#x0113;</string>
+ <!-- U+00ED: "í" LATIN SMALL LETTER I WITH ACUTE
+ U+00EF: "ï" LATIN SMALL LETTER I WITH DIAERESIS
+ U+00EC: "ì" LATIN SMALL LETTER I WITH GRAVE
+ U+00EE: "î" LATIN SMALL LETTER I WITH CIRCUMFLEX
+ U+012F: "į" LATIN SMALL LETTER I WITH OGONEK
+ U+012B: "ī" LATIN SMALL LETTER I WITH MACRON -->
+ <string name="more_keys_for_i">&#x00ED;,&#x00EF;,&#x00EC;,&#x00EE;,&#x012F;,&#x012B;</string>
+ <!-- U+00F3: "ó" LATIN SMALL LETTER O WITH ACUTE
+ U+00F2: "ò" LATIN SMALL LETTER O WITH GRAVE
+ U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS
+ U+00F4: "ô" LATIN SMALL LETTER O WITH CIRCUMFLEX
+ U+00F5: "õ" LATIN SMALL LETTER O WITH TILDE
+ U+00F8: "ø" LATIN SMALL LETTER O WITH STROKE
+ U+0153: "œ" LATIN SMALL LIGATURE OE
+ U+014D: "ō" LATIN SMALL LETTER O WITH MACRON
+ U+00BA: "º" MASCULINE ORDINAL INDICATOR -->
+ <string name="more_keys_for_o">&#x00F3;,&#x00F2;,&#x00F6;,&#x00F4;,&#x00F5;,&#x00F8;,&#x0153;,&#x014D;,&#x00BA;</string>
+ <!-- U+00FA: "ú" LATIN SMALL LETTER U WITH ACUTE
+ U+00FC: "ü" LATIN SMALL LETTER U WITH DIAERESIS
+ U+00F9: "ù" LATIN SMALL LETTER U WITH GRAVE
+ U+00FB: "û" LATIN SMALL LETTER U WITH CIRCUMFLEX
+ U+016B: "ū" LATIN SMALL LETTER U WITH MACRON -->
+ <string name="more_keys_for_u">&#x00FA;,&#x00FC;,&#x00F9;,&#x00FB;,&#x016B;</string>
+ <!-- U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE
+ U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE -->
+ <string name="more_keys_for_n">&#x00F1;,&#x0144;</string>
+ <!-- U+00E7: "ç" LATIN SMALL LETTER C WITH CEDILLA
+ U+0107: "ć" LATIN SMALL LETTER C WITH ACUTE
+ U+010D: "č" LATIN SMALL LETTER C WITH CARON -->
+ <string name="more_keys_for_c">&#x00E7;,&#x0107;,&#x010D;</string>
+</resources>
diff --git a/tools/maketext/res/values-uk/donottranslate-more-keys.xml b/tools/maketext/res/values-uk/donottranslate-more-keys.xml
index 32397049a..6d4b5f9e1 100644
--- a/tools/maketext/res/values-uk/donottranslate-more-keys.xml
+++ b/tools/maketext/res/values-uk/donottranslate-more-keys.xml
@@ -20,12 +20,16 @@
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- U+0449: "щ" CYRILLIC SMALL LETTER SHCHA -->
<string name="keylabel_for_east_slavic_row1_9">&#x0449;</string>
+ <!-- U+0457: "ї" CYRILLIC SMALL LETTER YI -->
+ <string name="keylabel_for_east_slavic_row1_12">&#x0457;</string>
<!-- U+0456: "і" CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I -->
<string name="keylabel_for_east_slavic_row2_1">&#x0456;</string>
+ <!-- U+0454: "є" CYRILLIC SMALL LETTER UKRAINIAN IE -->
+ <string name="keylabel_for_east_slavic_row2_11">&#x0454;</string>
<!-- U+0438: "и" CYRILLIC SMALL LETTER I -->
<string name="keylabel_for_east_slavic_row3_5">&#x0438;</string>
- <!-- U+044A: "ъ" CYRILLIC SMALL LETTER HARD SIGN -->
- <string name="more_keys_for_cyrillic_ha">&#x044A;</string>
+ <!-- U+0491: "ґ" CYRILLIC SMALL LETTER GHE WITH UPTURN -->
+ <string name="more_keys_for_cyrillic_ghe">&#x0491;</string>
<!-- U+0457: "ї" CYRILLIC SMALL LETTER YI -->
<string name="more_keys_for_east_slavic_row2_1">&#x0457;</string>
<!-- U+044A: "ъ" CYRILLIC SMALL LETTER HARD SIGN -->
diff --git a/tools/maketext/res/values-zu/donottranslate-more-keys.xml b/tools/maketext/res/values-zu/donottranslate-more-keys.xml
new file mode 100644
index 000000000..191791530
--- /dev/null
+++ b/tools/maketext/res/values-zu/donottranslate-more-keys.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2012, 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">
+ <!-- This is the same as English -->
+ <!-- U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
+ U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
+ U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX
+ U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS
+ U+00E6: "æ" LATIN SMALL LETTER AE
+ U+00E3: "ã" LATIN SMALL LETTER A WITH TILDE
+ U+00E5: "å" LATIN SMALL LETTER A WITH RING ABOVE
+ U+0101: "ā" LATIN SMALL LETTER A WITH MACRON -->
+ <string name="more_keys_for_a">&#x00E0;,&#x00E1;,&#x00E2;,&#x00E4;,&#x00E6;,&#x00E3;,&#x00E5;,&#x0101;</string>
+ <!-- U+00E8: "è" LATIN SMALL LETTER E WITH GRAVE
+ U+00E9: "é" LATIN SMALL LETTER E WITH ACUTE
+ U+00EA: "ê" LATIN SMALL LETTER E WITH CIRCUMFLEX
+ U+00EB: "ë" LATIN SMALL LETTER E WITH DIAERESIS
+ U+0113: "ē" LATIN SMALL LETTER E WITH MACRON -->
+ <string name="more_keys_for_e">&#x00E8;,&#x00E9;,&#x00EA;,&#x00EB;,&#x0113;</string>
+ <!-- U+00EE: "î" LATIN SMALL LETTER I WITH CIRCUMFLEX
+ U+00EF: "ï" LATIN SMALL LETTER I WITH DIAERESIS
+ U+00ED: "í" LATIN SMALL LETTER I WITH ACUTE
+ U+012B: "ī" LATIN SMALL LETTER I WITH MACRON
+ U+00EC: "ì" LATIN SMALL LETTER I WITH GRAVE -->
+ <string name="more_keys_for_i">&#x00EE;,&#x00EF;,&#x00ED;,&#x012B;,&#x00EC;</string>
+ <!-- U+00F4: "ô" LATIN SMALL LETTER O WITH CIRCUMFLEX
+ U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS
+ U+00F2: "ò" LATIN SMALL LETTER O WITH GRAVE
+ U+00F3: "ó" LATIN SMALL LETTER O WITH ACUTE
+ U+0153: "œ" LATIN SMALL LIGATURE OE
+ U+00F8: "ø" LATIN SMALL LETTER O WITH STROKE
+ U+014D: "ō" LATIN SMALL LETTER O WITH MACRON
+ U+00F5: "õ" LATIN SMALL LETTER O WITH TILDE -->
+ <string name="more_keys_for_o">&#x00F4;,&#x00F6;,&#x00F2;,&#x00F3;,&#x0153;,&#x00F8;,&#x014D;,&#x00F5;</string>
+ <!-- U+00FB: "û" LATIN SMALL LETTER U WITH CIRCUMFLEX
+ U+00FC: "ü" LATIN SMALL LETTER U WITH DIAERESIS
+ U+00F9: "ù" LATIN SMALL LETTER U WITH GRAVE
+ U+00FA: "ú" LATIN SMALL LETTER U WITH ACUTE
+ U+016B: "ū" LATIN SMALL LETTER U WITH MACRON -->
+ <string name="more_keys_for_u">&#x00FB;,&#x00FC;,&#x00F9;,&#x00FA;,&#x016B;</string>
+ <!-- U+00DF: "ß" LATIN SMALL LETTER SHARP S -->
+ <string name="more_keys_for_s">&#x00DF;</string>
+ <!-- U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE -->
+ <string name="more_keys_for_n">&#x00F1;</string>
+ <!-- U+00E7: "ç" LATIN SMALL LETTER C WITH CEDILLA -->
+ <string name="more_keys_for_c">&#x00E7;</string>
+</resources>
diff --git a/tools/maketext/res/values/donottranslate-more-keys.xml b/tools/maketext/res/values/donottranslate-more-keys.xml
index 922b42d1b..4d7100b8c 100644
--- a/tools/maketext/res/values/donottranslate-more-keys.xml
+++ b/tools/maketext/res/values/donottranslate-more-keys.xml
@@ -44,12 +44,13 @@
<string name="more_keys_for_nordic_row2_10"></string>
<string name="more_keys_for_nordic_row2_11"></string>
<string name="keylabel_for_east_slavic_row1_9"></string>
+ <string name="keylabel_for_east_slavic_row1_12"></string>
<string name="keylabel_for_east_slavic_row2_1"></string>
+ <string name="keylabel_for_east_slavic_row2_11"></string>
<string name="keylabel_for_east_slavic_row3_5"></string>
<string name="more_keys_for_cyrillic_u"></string>
- <string name="more_keys_for_cyrillic_ye"></string>
<string name="more_keys_for_cyrillic_en"></string>
- <string name="more_keys_for_cyrillic_ha"></string>
+ <string name="more_keys_for_cyrillic_ghe"></string>
<string name="more_keys_for_east_slavic_row2_1"></string>
<string name="more_keys_for_cyrillic_o"></string>
<string name="more_keys_for_cyrillic_soft_sign"></string>
@@ -158,7 +159,6 @@
<string name="more_keys_for_symbols_0">&#x207F;,&#x2205;</string>
<string name="keylabel_for_comma">,</string>
<string name="more_keys_for_comma"></string>
- <string name="keylabel_for_symbols_exclamation">!</string>
<string name="keylabel_for_symbols_question">\?</string>
<string name="keylabel_for_symbols_semicolon">;</string>
<string name="keylabel_for_symbols_percent">%</string>
@@ -177,6 +177,14 @@
<string name="keylabel_for_apostrophe">\'</string>
<string name="keyhintlabel_for_apostrophe">\"</string>
<string name="more_keys_for_apostrophe">\"</string>
+ <string name="more_keys_for_q"></string>
+ <string name="more_keys_for_x"></string>
+ <string name="keylabel_for_q">q</string>
+ <string name="keylabel_for_w">w</string>
+ <string name="keylabel_for_y">y</string>
+ <string name="keylabel_for_x">x</string>
+ <!-- U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE -->
+ <string name="keylabel_for_spanish_row2_10">&#x00F1;</string>
<string name="more_keys_for_am_pm">!fixedColumnOrder!2,!hasLabels!,\@string/label_time_am,\@string/label_time_pm</string>
<string name="settings_as_more_key">!icon/settings_key|!code/key_settings</string>
<string name="shortcut_as_more_key">!icon/shortcut_key|!code/key_shortcut</string>
diff --git a/tools/maketext/src/com/android/inputmethod/latin/maketext/JarUtils.java b/tools/maketext/src/com/android/inputmethod/latin/maketext/JarUtils.java
index 366d73e20..6d6bc0ea6 100644
--- a/tools/maketext/src/com/android/inputmethod/latin/maketext/JarUtils.java
+++ b/tools/maketext/src/com/android/inputmethod/latin/maketext/JarUtils.java
@@ -26,15 +26,14 @@ import java.util.Enumeration;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
-public class JarUtils {
- private static final String MANIFEST = "META-INF/MANIFEST.MF";
-
+public final class JarUtils {
private JarUtils() {
// This utility class is not publicly instantiable.
}
- public static JarFile getJarFile(final ClassLoader loader) {
- final URL resUrl = loader.getResource(MANIFEST);
+ public static JarFile getJarFile(final Class<?> mainClass) {
+ final String mainClassPath = "/" + mainClass.getName().replace('.', '/') + ".class";
+ final URL resUrl = mainClass.getResource(mainClassPath);
if (!resUrl.getProtocol().equals("jar")) {
throw new RuntimeException("Should run as jar");
}
diff --git a/tools/maketext/src/com/android/inputmethod/latin/maketext/LabelText.java b/tools/maketext/src/com/android/inputmethod/latin/maketext/LabelText.java
index a5abcf1c1..4a9236962 100644
--- a/tools/maketext/src/com/android/inputmethod/latin/maketext/LabelText.java
+++ b/tools/maketext/src/com/android/inputmethod/latin/maketext/LabelText.java
@@ -58,7 +58,7 @@ public class LabelText {
public static void main(final String[] args) {
final Options options = new Options(args);
- final JarFile jar = JarUtils.getJarFile(LabelText.class.getClassLoader());
+ final JarFile jar = JarUtils.getJarFile(LabelText.class);
final MoreKeysResources resources = new MoreKeysResources(jar);
resources.writeToJava(options.mJava);
}
diff --git a/tools/maketext/src/com/android/inputmethod/latin/maketext/MoreKeysResources.java b/tools/maketext/src/com/android/inputmethod/latin/maketext/MoreKeysResources.java
index a4835932b..37ac0d006 100644
--- a/tools/maketext/src/com/android/inputmethod/latin/maketext/MoreKeysResources.java
+++ b/tools/maketext/src/com/android/inputmethod/latin/maketext/MoreKeysResources.java
@@ -100,7 +100,7 @@ public class MoreKeysResources {
final File outputFile = new File(outPackage,
JAVA_TEMPLATE.replace(".tmpl", ".java"));
outPackage.mkdirs();
- ps = new PrintStream(outputFile);
+ ps = new PrintStream(outputFile, "UTF-8");
}
lnr = new LineNumberReader(new InputStreamReader(JarUtils.openResource(template)));
inflateTemplate(lnr, ps);