From d5956ed8914a9eb1a0ddcc064e5238e0d9e24467 Mon Sep 17 00:00:00 2001 From: Helium314 Date: Sun, 28 Jan 2024 18:16:48 +0100 Subject: [PATCH] remove unused tools for old xml layout style, update readme --- README.md | 16 +- tools/layout_converter.py | 111 ------- tools/make-keyboard-text/build.gradle | 23 -- .../tools/ArrayInitializerFormatter.java | 93 ------ .../inputmethod/keyboard/tools/JarUtils.java | 106 ------- .../keyboard/tools/LocaleUtils.java | 156 ---------- .../keyboard/tools/MakeKeyboardText.java | 54 ---- .../keyboard/tools/MoreKeysResources.java | 256 ---------------- .../keyboard/tools/StringResource.java | 18 -- .../keyboard/tools/StringResourceMap.java | 147 ---------- .../keyboard/internal/KeyboardTextsTable.tmpl | 101 ------- .../values-af/donottranslate-more-keys.xml | 54 ---- .../values-ar/donottranslate-more-keys.xml | 118 -------- .../values-az/donottranslate-more-keys.xml | 56 ---- .../values-be/donottranslate-more-keys.xml | 26 -- .../values-bg/donottranslate-more-keys.xml | 14 - .../donottranslate-more-keys.xml | 52 ---- .../donottranslate-more-keys.xml | 14 - .../values-ca/donottranslate-more-keys.xml | 64 ---- .../values-cs/donottranslate-more-keys.xml | 77 ----- .../values-da/donottranslate-more-keys.xml | 65 ----- .../donottranslate-more-keys.xml | 60 ---- .../values-de/donottranslate-more-keys.xml | 62 ---- .../values-el/donottranslate-more-keys.xml | 12 - .../values-en/donottranslate-more-keys.xml | 49 ---- .../values-eo/donottranslate-more-keys.xml | 132 --------- .../values-es/donottranslate-more-keys.xml | 59 ---- .../values-et/donottranslate-more-keys.xml | 101 ------- .../values-eu/donottranslate-more-keys.xml | 56 ---- .../values-fa/donottranslate-more-keys.xml | 124 -------- .../values-fi/donottranslate-more-keys.xml | 45 --- .../values-fr/donottranslate-more-keys.xml | 66 ----- .../values-gl/donottranslate-more-keys.xml | 56 ---- .../donottranslate-more-keys.xml | 17 -- .../values-hi/donottranslate-more-keys.xml | 51 ---- .../values-hr/donottranslate-more-keys.xml | 28 -- .../values-hu/donottranslate-more-keys.xml | 25 -- .../values-hy/donottranslate-more-keys.xml | 49 ---- .../values-is/donottranslate-more-keys.xml | 55 ---- .../values-it/donottranslate-more-keys.xml | 62 ---- .../values-iw/donottranslate-more-keys.xml | 43 --- .../values-ka/donottranslate-more-keys.xml | 14 - .../values-kk/donottranslate-more-keys.xml | 41 --- .../values-km/donottranslate-more-keys.xml | 14 - .../values-kn/donottranslate-more-keys.xml | 14 - .../values-ko/donottranslate-more-keys.xml | 13 - .../values-ky/donottranslate-more-keys.xml | 30 -- .../values-lo/donottranslate-more-keys.xml | 14 - .../values-lt/donottranslate-more-keys.xml | 94 ------ .../values-lv/donottranslate-more-keys.xml | 93 ------ .../values-mk/donottranslate-more-keys.xml | 26 -- .../values-ml/donottranslate-more-keys.xml | 12 - .../values-mn/donottranslate-more-keys.xml | 14 - .../values-mr/donottranslate-more-keys.xml | 46 --- .../values-my/donottranslate-more-keys.xml | 21 -- .../values-nb/donottranslate-more-keys.xml | 51 ---- .../values-ne/donottranslate-more-keys.xml | 51 ---- .../values-nl/donottranslate-more-keys.xml | 54 ---- .../values-pl/donottranslate-more-keys.xml | 53 ---- .../values-pt/donottranslate-more-keys.xml | 51 ---- .../values-rm/donottranslate-more-keys.xml | 15 - .../values-ro/donottranslate-more-keys.xml | 33 --- .../values-ru/donottranslate-more-keys.xml | 26 -- .../values-si/donottranslate-more-keys.xml | 13 - .../values-sk/donottranslate-more-keys.xml | 96 ------ .../values-sl/donottranslate-more-keys.xml | 20 -- .../donottranslate-more-keys.xml | 28 -- .../values-sr/donottranslate-more-keys.xml | 47 --- .../values-sv/donottranslate-more-keys.xml | 85 ------ .../values-sw/donottranslate-more-keys.xml | 51 ---- .../donottranslate-more-keys.xml | 14 - .../donottranslate-more-keys.xml | 14 - .../donottranslate-more-keys.xml | 12 - .../values-te/donottranslate-more-keys.xml | 14 - .../values-th/donottranslate-more-keys.xml | 14 - .../values-tl/donottranslate-more-keys.xml | 56 ---- .../values-tr/donottranslate-more-keys.xml | 55 ---- .../values-uk/donottranslate-more-keys.xml | 30 -- .../values-ur/donottranslate-more-keys.xml | 79 ----- .../values-uz/donottranslate-more-keys.xml | 56 ---- .../values-vi/donottranslate-more-keys.xml | 83 ------ .../values-zu/donottranslate-more-keys.xml | 50 ---- .../values-zz/donottranslate-more-keys.xml | 125 -------- .../values/donottranslate-more-keys.xml | 263 ----------------- tools/morekeys_reader.py | 276 ------------------ 85 files changed, 8 insertions(+), 5026 deletions(-) delete mode 100644 tools/layout_converter.py delete mode 100644 tools/make-keyboard-text/build.gradle delete mode 100644 tools/make-keyboard-text/src/main/java/com/android/inputmethod/keyboard/tools/ArrayInitializerFormatter.java delete mode 100644 tools/make-keyboard-text/src/main/java/com/android/inputmethod/keyboard/tools/JarUtils.java delete mode 100644 tools/make-keyboard-text/src/main/java/com/android/inputmethod/keyboard/tools/LocaleUtils.java delete mode 100644 tools/make-keyboard-text/src/main/java/com/android/inputmethod/keyboard/tools/MakeKeyboardText.java delete mode 100644 tools/make-keyboard-text/src/main/java/com/android/inputmethod/keyboard/tools/MoreKeysResources.java delete mode 100644 tools/make-keyboard-text/src/main/java/com/android/inputmethod/keyboard/tools/StringResource.java delete mode 100644 tools/make-keyboard-text/src/main/java/com/android/inputmethod/keyboard/tools/StringResourceMap.java delete mode 100644 tools/make-keyboard-text/src/main/resources/org/dslul/openboard/inputmethod/keyboard/internal/KeyboardTextsTable.tmpl delete mode 100644 tools/make-keyboard-text/src/main/resources/values-af/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-ar/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-az/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-be/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-bg/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-bn-rBD/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-bn-rIN/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-ca/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-cs/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-da/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-de-rDE/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-de/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-el/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-en/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-eo/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-es/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-et/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-eu/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-fa/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-fi/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-fr/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-gl/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-hi-rZZ/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-hi/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-hr/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-hu/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-hy/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-is/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-it/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-iw/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-ka/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-kk/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-km/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-kn/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-ko/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-ky/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-lo/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-lt/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-lv/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-mk/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-ml/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-mn/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-mr/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-my/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-nb/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-ne/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-nl/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-pl/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-pt/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-rm/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-ro/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-ru/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-si/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-sk/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-sl/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-sr-rZZ/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-sr/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-sv/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-sw/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-ta-rIN/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-ta-rLK/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-ta-rSG/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-te/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-th/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-tl/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-tr/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-uk/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-ur/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-uz/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-vi/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-zu/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values-zz/donottranslate-more-keys.xml delete mode 100644 tools/make-keyboard-text/src/main/resources/values/donottranslate-more-keys.xml delete mode 100644 tools/morekeys_reader.py diff --git a/README.md b/README.md index ac57d0f3..f95d66b9 100644 --- a/README.md +++ b/README.md @@ -53,18 +53,18 @@ Features that may go unnoticed, and further potentially useful information * In the event of an application crash, you will be prompted whether you want the crash logs when you open the Settings. * When using multilingual typing, space bar will show an confidence value used for determining the currenly used language. * Suggestions will have some tiny numbers on top showing some internal score and source dictionary (can be disabled) -* For users doing manual backups with root access: Starting at Android 7, the shared preferences file is not in the default location, because the app is using [device protected storage](https://developer.android.com/reference/android/content/Context#createDeviceProtectedStorageContext()). This is necessary so the settings can be read before the device is unlocked, e.g. at boot. The file is located in `/data/user_de/0/package_id/shared_prefs/`, though this may depend on the device and Android version. +* For users doing manual backups with root access: Starting at Android 7, some files and the main shared preferences file are not in the default location, because the app is using [device protected storage](https://developer.android.com/reference/android/content/Context#createDeviceProtectedStorageContext()). This is necessary so the settings and layout files can be read before the device is unlocked, e.g. at boot. The files are usually located in `/data/user_de/0//`, though the location may depend on the device and Android version. -# Contribution ❤ +# Contributing ❤ ## Issue reporting Whether you encountered a bug, or want to see a new feature in OpenBoard, you can contribute to the project by opening a new issue [here](https://github.com/openboard-team/openboard/issues). Your help is always welcome! Before opening a new issue, be sure to check the following: - - **Does the issue already exist ?** Make sure a similar issue has not been reported by browsing [existing issues](https://github.com/Helium314/openboard/issues). Please search open and closed issues. - - **Is the issue still relevant ?** Make sure your issue is not already fixed in the latest version of OpenBoard. - - **Did you use the issue template ?** It is important to make life of our kind contributors easier by avoiding issues that miss key informations to their resolution. + - **Does the issue already exist?** Make sure a similar issue has not been reported by browsing [existing issues](https://github.com/Helium314/openboard/issues). Please search open and closed issues. + - **Is the issue still relevant?** Make sure your issue is not already fixed in the latest version of OpenBoard. + - **Did you use the issue template?** It is important to make life of our kind contributors easier by avoiding issues that miss key informations to their resolution. ## Translation Currently there is no simple way of translating the app, but it's coming soon... @@ -78,13 +78,13 @@ IMPORTANT: The package will be renamed soon. To avoid merge conflicts, please do ### Getting started -OpenBoard project is based on Gradle and Android Gradle Plugin. To get started, you'll just need to install [Android Studio](https://developer.android.com/studio), and import project 'from Version Control / Git / Github' by providing this git repository [URL](https://github.com/openboard-team/openboard) (or git SSH [URL](git@github.com:openboard-team/openboard.git)). +OpenBoard project is based on Gradle and Android Gradle Plugin. To get started, you'll just need to install [Android Studio](https://developer.android.com/studio), and import project 'from Version Control / Git / Github' by providing this git repository [URL](https://github.com/Helium314/openboard) (or git SSH [URL](git@github.com:Helium314/openboard.git)). -Once everything got setted up correctly, you're ready to go ! +Once everything got setted up correctly, you're ready to go! ### Guidelines -OpenBoard is a complex application, when contributing, you must take a step back and make sure your contribution : +OpenBoard is a complex application, when contributing, you must take a step back and make sure your contribution: - **Uses already in-place mechanism and take advantage of them**. In other terms, does not reinvent the wheel or uses shortcuts that could alter the consistency of the existing code. - **Has the lowest footprint possible**. OpenBoard code has been written by android experts (AOSP/Google engineers). It has been tested and runned on millions of devices. Thus, **existing code will always be safer than new code**. The less we alter existing code, the more OpenBoard will stay stable. Especially in the input logic scope. - **Does not bring any non-free code or proprietary binary blobs**. This also applies to code/binaries with unknown licenses. Make sure you do not introduce any closed-source library from Google. diff --git a/tools/layout_converter.py b/tools/layout_converter.py deleted file mode 100644 index e8d71018..00000000 --- a/tools/layout_converter.py +++ /dev/null @@ -1,111 +0,0 @@ -import pathlib -import re - - -def simple(files): - mk = [] - kss = [] - for file in files: - with open(file) as f: - ks = [] - waiting_for_morekeys = None - for line in f: - if "moreKeys" in line and waiting_for_morekeys is not None: - r = re.findall(r"&#x\w{4};", line) - for x in r: - replacement = x.replace(";", "").replace("&#x", "\\u").encode().decode('unicode-escape') - line = line.replace(x, replacement) - line = line.split("\"")[1] - mk.append(waiting_for_morekeys + " " + line.replace(",", " ")) - waiting_for_morekeys = None - if "keySpec" in line: - r = re.findall(r"&#x\w{4};", line) - if len(r) != 1: - print("something wrong") - c = r[0].replace(";", "").replace("&#x", "\\u").encode().decode('unicode-escape') - print(c) - ks.append(c) - waiting_for_morekeys = c - print("") - kss.append(ks) - print("[morekeys]\n") - print("\n".join(mk)) - - -def shift(files): - mk = [] - kss = [] - kss_shift = [] - for index, file in enumerate(files): - with open(file) as f: - shift = False - ks = [] - ks_shift = [] - waiting_for_morekeys = None - for line in f: - if "alphabetManualShifted|alphabetShiftLocked|alphabetShiftLockShifted" in line: - shift = True - if "" in line: - shift = False - if "keySpec" in line: - l = line.split("\"")[1] - r = re.findall(r"&#x\w{4};", line) - for x in r: - replacement = x.replace(";", "").replace("&#x", "\\u").encode().decode('unicode-escape') - l = l.replace(x, replacement) - r = re.findall(r"&#\w{4};", line) - for x in r: - replacement = int(x.replace(";", "").replace("&#", "")) - l = l.replace(x, chr(replacement)) - c = l - if shift: - ks_shift.append(c) - else: - ks.append(c) - waiting_for_morekeys = c - if "moreKeys" in line and waiting_for_morekeys is not None: - l = line.split("\"")[1] - r = re.findall(r"&#x\w{4};", line) - for x in r: - replacement = x.replace(";", "").replace("&#x", "\\u").encode().decode('unicode-escape') - l = l.replace(x, replacement) - r = re.findall(r"&#\w{4};", l) - for x in r: - replacement = int(x.replace(";", "").replace("&#", "")) - l = l.replace(x, chr(replacement)) - mk.append(waiting_for_morekeys + " " + l.replace(",", " ")) - waiting_for_morekeys = None - if "/>" in line: - waiting_for_morekeys = None - kss.append(ks) - kss_shift.append(ks_shift) - if len(ks) != len(ks_shift): - print(f"dammit, {len(ks)}, {len(ks_shift)}") - print("[") - for i, ks in enumerate(kss): - print(" [") - for j, k in enumerate(ks): - print(" { \"$\": \"shift_state_selector\",") - print(" \"manualOrLocked\": { \"label\": \"" + kss_shift[i][j] + "\" },") - print(" \"default\": { \"label\": \"" + k + "\" }") - print(" },") - print(" ],") - print("]\n") - print("[morekeys]\n") - print("\n".join(mk)) - -# select layout, run and copy the text for layout and moreKeys (for locale_key_texts) -# note that additionalMoreKeys are ignored, these are often symbols (will change to be determined automatically at some point), and numbers (already determined automatically) -# json layouts have additional commas in the end of arrays, should be removed manually -d = pathlib.Path("../app/src/main/res/xml/") -files = [] -for f in d.iterdir(): - if f.name.startswith("rowkeys") and "unijoy" in f.name and ("left" in f.name or "right" in f.name): - files.append(f) - -# shift for layouts where all keys change when shifted (alphabetManualShifted|alphabetShiftLocked|alphabetShiftLockShifted) -# ignores extra attributes like labelFlags -shift(files) - -# simple for layouts that have no case switch -#simple(files) diff --git a/tools/make-keyboard-text/build.gradle b/tools/make-keyboard-text/build.gradle deleted file mode 100644 index b6af733b..00000000 --- a/tools/make-keyboard-text/build.gradle +++ /dev/null @@ -1,23 +0,0 @@ -apply plugin: 'java' - -version 'unspecified' - -jar { - manifest { - attributes["Main-Class"] = 'com.android.inputmethod.keyboard.tools.MakeKeyboardText' - } -} - -tasks.register('makeText', JavaExec) { - dependsOn['jar'] - mainClass = '-jar' - args jar.archiveFile.get() - args '-java' - args project.rootProject.project('app').projectDir.path + File.separator + 'src' + - File.separator + 'main' + File.separator + 'java' -} - -java { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 -} diff --git a/tools/make-keyboard-text/src/main/java/com/android/inputmethod/keyboard/tools/ArrayInitializerFormatter.java b/tools/make-keyboard-text/src/main/java/com/android/inputmethod/keyboard/tools/ArrayInitializerFormatter.java deleted file mode 100644 index ed020e47..00000000 --- a/tools/make-keyboard-text/src/main/java/com/android/inputmethod/keyboard/tools/ArrayInitializerFormatter.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.android.inputmethod.keyboard.tools; - -import java.io.PrintStream; - -public class ArrayInitializerFormatter { - private final PrintStream mOut; - private final int mMaxWidth; - private final String mIndent; - // String resource names array; indexed by {@link #CurrentIndex} and - // {@link #mStartIndexOfBuffer}. - private final String[] mResourceNames; - - private int mCurrentIndex = 0; - private String mLastElement; - private final StringBuilder mBuffer = new StringBuilder(); - private int mBufferedLen; - private int mStartIndexOfBuffer = Integer.MIN_VALUE; - - public ArrayInitializerFormatter(final PrintStream out, final int width, final String indent, - final String[] resourceNames) { - mOut = out; - mMaxWidth = width - indent.length(); - mIndent = indent; - mResourceNames = resourceNames; - } - - public int getCurrentIndex() { - return mCurrentIndex; - } - - public void flush() { - if (mBuffer.length() == 0) { - return; - } - final int lastIndex = mCurrentIndex - 1; - if (mStartIndexOfBuffer == lastIndex) { - mOut.format("%s/* %s */ %s\n", - mIndent, mResourceNames[mStartIndexOfBuffer], mBuffer); - } else if (mStartIndexOfBuffer == lastIndex - 1) { - final String startElement = mBuffer.toString() - .substring(0, mBuffer.length() - mLastElement.length()) - .trim(); - mOut.format("%s/* %s */ %s\n" - + "%s/* %s */ %s\n", - mIndent, mResourceNames[mStartIndexOfBuffer], startElement, - mIndent, mResourceNames[lastIndex], mLastElement); - } else { - mOut.format("%s/* %s ~ */\n" - + "%s%s\n" - + "%s/* ~ %s */\n", - mIndent, mResourceNames[mStartIndexOfBuffer], - mIndent, mBuffer, - mIndent, mResourceNames[lastIndex]); - } - mBuffer.setLength(0); - mBufferedLen = 0; - } - - public void outCommentLines(final String lines) { - flush(); - mOut.print(lines); - mLastElement = null; - } - - public void outElement(final String element) { - if (!element.equals(mLastElement)) { - flush(); - mStartIndexOfBuffer = mCurrentIndex; - } - final int nextLen = mBufferedLen + " ".length() + element.length(); - if (mBufferedLen != 0 && nextLen < mMaxWidth) { - // Element can fit in the current line. - mBuffer.append(' '); - mBuffer.append(element); - mBufferedLen = nextLen; - } else { - // Element should be on the next line. - if (mBufferedLen != 0) { - mBuffer.append('\n'); - mBuffer.append(mIndent); - } - mBuffer.append(element); - mBufferedLen = element.length(); - } - mCurrentIndex++; - mLastElement = element; - } -} diff --git a/tools/make-keyboard-text/src/main/java/com/android/inputmethod/keyboard/tools/JarUtils.java b/tools/make-keyboard-text/src/main/java/com/android/inputmethod/keyboard/tools/JarUtils.java deleted file mode 100644 index 1b5ec9ca..00000000 --- a/tools/make-keyboard-text/src/main/java/com/android/inputmethod/keyboard/tools/JarUtils.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.android.inputmethod.keyboard.tools; - -import java.io.Closeable; -import java.io.IOException; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; -import java.net.URL; -import java.net.URLDecoder; -import java.util.ArrayList; -import java.util.Enumeration; -import java.util.Locale; -import java.util.jar.JarEntry; -import java.util.jar.JarFile; - -public final class JarUtils { - private JarUtils() { - // This utility class is not publicly instantiable. - } - - 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 and not as " + resUrl.getProtocol()); - } - final String path = resUrl.getPath(); - if (!path.startsWith("file:")) { - throw new RuntimeException("Unknown jar path: " + path); - } - final String jarPath = path.substring("file:".length(), path.indexOf('!')); - try { - return new JarFile(URLDecoder.decode(jarPath, "UTF-8")); - } catch (UnsupportedEncodingException e) { - } catch (IOException e) { - } - return null; - } - - public static InputStream openResource(final String name) { - return JarUtils.class.getResourceAsStream("/" + name); - } - - public interface JarFilter { - public boolean accept(String dirName, String name); - } - - public static ArrayList getEntryNameListing(final JarFile jar, final JarFilter filter) { - final ArrayList result = new ArrayList<>(); - final Enumeration entries = jar.entries(); - while (entries.hasMoreElements()) { - final JarEntry entry = entries.nextElement(); - final String path = entry.getName(); - final int pos = path.lastIndexOf('/'); - final String dirName = (pos >= 0) ? path.substring(0, pos) : ""; - final String name = (pos >= 0) ? path.substring(pos + 1) : path; - if (filter.accept(dirName, name)) { - result.add(path); - } - } - return result; - } - - public static ArrayList getEntryNameListing(final JarFile jar, - final String filterName) { - return getEntryNameListing(jar, new JarFilter() { - @Override - public boolean accept(final String dirName, final String name) { - return name.equals(filterName); - } - }); - } - - // The locale is taken from string resource jar entry name (values-/) - // or {@link LocaleUtils#DEFAULT_LOCALE} for the default string resource - // directory (values/). - public static Locale getLocaleFromEntryName(final String jarEntryName) { - final String dirName = jarEntryName.substring(0, jarEntryName.lastIndexOf('/')); - final int pos = dirName.lastIndexOf('/'); - final String parentName = (pos >= 0) ? dirName.substring(pos + 1) : dirName; - final int localePos = parentName.indexOf('-'); - if (localePos < 0) { - // Default resource name. - return LocaleUtils.DEFAULT_LOCALE; - } - final String localeStr = parentName.substring(localePos + 1); - final int regionPos = localeStr.indexOf("-r"); - if (regionPos < 0) { - return LocaleUtils.constructLocaleFromString(localeStr); - } - return LocaleUtils.constructLocaleFromString(localeStr.replace("-r", "_")); - } - - public static void close(final Closeable stream) { - try { - if (stream != null) { - stream.close(); - } - } catch (IOException e) { - } - } -} diff --git a/tools/make-keyboard-text/src/main/java/com/android/inputmethod/keyboard/tools/LocaleUtils.java b/tools/make-keyboard-text/src/main/java/com/android/inputmethod/keyboard/tools/LocaleUtils.java deleted file mode 100644 index 9f6ac13f..00000000 --- a/tools/make-keyboard-text/src/main/java/com/android/inputmethod/keyboard/tools/LocaleUtils.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright (C) 2013 The Android Open Source Project - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.android.inputmethod.keyboard.tools; - -import java.util.HashMap; -import java.util.Locale; - -/** - * A class to help with handling Locales in string form. - * - * This is a subset of com/android/inputmethod/latin/utils/LocaleUtils.java in order to use - * for the make-keyboard-text tool. - */ -public final class LocaleUtils { - public static final Locale DEFAULT_LOCALE = Locale.ROOT; - private static final String DEFAULT_LOCALE_CODE = "DEFAULT"; - public static final String NO_LANGUAGE_LOCALE_CODE = "zz"; - public static final String NO_LANGUAGE_LOCALE_DISPLAY_NAME = "Alphabet"; - - private LocaleUtils() { - // Intentional empty constructor for utility class. - } - - private static final HashMap sLocaleCache = new HashMap<>(); - - private static final int INDEX_LANGUAGE = 0; - private static final int INDEX_SCRIPT = 1; - private static final int INDEX_REGION = 2; - private static final int ELEMENT_LIMIT = INDEX_REGION + 1; - - /** - * Creates a locale from a string specification. - * - * Locale string is: language(_script)?(_region)? - * where: language := [a-zA-Z]{2,3} - * script := [a-zA-Z]{4} - * region := [a-zA-Z]{2,3}|[0-9]{3} - */ - public static Locale constructLocaleFromString(final String localeStr) { - if (localeStr == null) { - return null; - } - synchronized (sLocaleCache) { - if (sLocaleCache.containsKey(localeStr)) { - return sLocaleCache.get(localeStr); - } - boolean hasRegion = false; - final Locale.Builder builder = new Locale.Builder(); - final String[] localeElements = localeStr.split("_", ELEMENT_LIMIT); - if (localeElements.length > INDEX_LANGUAGE) { - final String text = localeElements[INDEX_LANGUAGE]; - if (isValidLanguage(text)) { - builder.setLanguage(text); - } else { - throw new RuntimeException("Unknown locale format: " + localeStr); - } - } - if (localeElements.length > INDEX_SCRIPT) { - final String text = localeElements[INDEX_SCRIPT]; - if (isValidScript(text)) { - builder.setScript(text); - } else if (isValidRegion(text)) { - builder.setRegion(text); - hasRegion = true; - } else { - throw new RuntimeException("Unknown locale format: " + localeStr); - } - } - if (localeElements.length > INDEX_REGION) { - final String text = localeElements[INDEX_REGION]; - if (!hasRegion && isValidRegion(text)) { - builder.setRegion(text); - } else { - throw new RuntimeException("Unknown locale format: " + localeStr); - } - } - final Locale locale = builder.build(); - sLocaleCache.put(localeStr, locale); - return locale; - } - } - - private static final int MIN_LENGTH_OF_LANGUAGE = 2; - private static final int MAX_LENGTH_OF_LANGUAGE = 2; - private static final int LENGTH_OF_SCRIPT = 4; - private static final int MIN_LENGTH_OF_REGION = 2; - private static final int MAX_LENGTH_OF_REGION = 2; - private static final int LENGTH_OF_AREA_CODE = 3; - - private static boolean isValidLanguage(final String text) { - return isAlphabetSequence(text, MIN_LENGTH_OF_LANGUAGE, MAX_LENGTH_OF_LANGUAGE); - } - - private static boolean isValidScript(final String text) { - return isAlphabetSequence(text, LENGTH_OF_SCRIPT, LENGTH_OF_SCRIPT); - } - - private static boolean isValidRegion(final String text) { - return isAlphabetSequence(text, MIN_LENGTH_OF_REGION, MAX_LENGTH_OF_REGION) - || isDigitSequence(text, LENGTH_OF_AREA_CODE, LENGTH_OF_AREA_CODE); - } - - private static boolean isAlphabetSequence(final String text, final int lower, final int upper) { - final int length = text.length(); - if (length < lower || length > upper) { - return false; - } - for (int index = 0; index < length; index++) { - if (!isAsciiAlphabet(text.charAt(index))) { - return false; - } - } - return true; - } - - private static boolean isDigitSequence(final String text, final int lower, final int upper) { - final int length = text.length(); - if (length < lower || length > upper) { - return false; - } - for (int index = 0; index < length; ++index) { - if (!isAsciiDigit(text.charAt(index))) { - return false; - } - } - return true; - } - - private static boolean isAsciiAlphabet(char c) { - return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); - } - - private static boolean isAsciiDigit(char c) { - return c >= '0' && c <= '9'; - } - - public static String getLocaleCode(final Locale locale) { - if (locale == DEFAULT_LOCALE) { - return DEFAULT_LOCALE_CODE; - } - return locale.toString(); - } - - public static String getLocaleDisplayName(final Locale locale) { - if (locale == DEFAULT_LOCALE) { - return DEFAULT_LOCALE_CODE; - } - if (locale.getLanguage().equals(NO_LANGUAGE_LOCALE_CODE)) { - return NO_LANGUAGE_LOCALE_DISPLAY_NAME; - } - return locale.getDisplayName(Locale.ENGLISH); - } -} diff --git a/tools/make-keyboard-text/src/main/java/com/android/inputmethod/keyboard/tools/MakeKeyboardText.java b/tools/make-keyboard-text/src/main/java/com/android/inputmethod/keyboard/tools/MakeKeyboardText.java deleted file mode 100644 index 1a6d4e0d..00000000 --- a/tools/make-keyboard-text/src/main/java/com/android/inputmethod/keyboard/tools/MakeKeyboardText.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.android.inputmethod.keyboard.tools; - -import java.util.Arrays; -import java.util.LinkedList; -import java.util.NoSuchElementException; -import java.util.jar.JarFile; - -public class MakeKeyboardText { - static class Options { - private static final String OPTION_JAVA = "-java"; - - public final String mJava; - - public static void usage(String message) { - if (message != null) { - System.err.println(message); - } - System.err.println("usage: make-keyboard-text " + OPTION_JAVA + " "); - System.exit(1); - } - - public Options(final String[] argsArray) { - final LinkedList args = new LinkedList<>(Arrays.asList(argsArray)); - String arg = null; - String java = null; - try { - while (!args.isEmpty()) { - arg = args.removeFirst(); - if (arg.equals(OPTION_JAVA)) { - java = args.removeFirst(); - } else { - usage("Unknown option: " + arg); - } - } - } catch (NoSuchElementException e) { - usage("Option " + arg + " needs argument"); - } - - mJava = java; - } - } - - public static void main(final String[] args) { - final Options options = new Options(args); - final JarFile jar = JarUtils.getJarFile(MakeKeyboardText.class); - final MoreKeysResources resources = new MoreKeysResources(jar); - resources.writeToJava(options.mJava); - } -} diff --git a/tools/make-keyboard-text/src/main/java/com/android/inputmethod/keyboard/tools/MoreKeysResources.java b/tools/make-keyboard-text/src/main/java/com/android/inputmethod/keyboard/tools/MoreKeysResources.java deleted file mode 100644 index 618cd82b..00000000 --- a/tools/make-keyboard-text/src/main/java/com/android/inputmethod/keyboard/tools/MoreKeysResources.java +++ /dev/null @@ -1,256 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * modified - * SPDX-License-Identifier: Apache-2.0 AND GPL-3.0-only - */ - -package com.android.inputmethod.keyboard.tools; - -import java.io.File; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.LineNumberReader; -import java.io.PrintStream; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.Locale; -import java.util.TreeMap; -import java.util.jar.JarFile; - -public class MoreKeysResources { - private static final String TEXT_RESOURCE_NAME = "donottranslate-more-keys.xml"; - - private static final String JAVA_TEMPLATE = "KeyboardTextsTable.tmpl"; - private static final String MARK_NAMES = "@NAMES@"; - private static final String MARK_DEFAULT_TEXTS = "@DEFAULT_TEXTS@"; - private static final String MARK_TEXTS = "@TEXTS@"; - private static final String TEXTS_ARRAY_NAME_PREFIX = "TEXTS_"; - private static final String MARK_LOCALES_AND_TEXTS = "@LOCALES_AND_TEXTS@"; - private static final String EMPTY_STRING_VAR = "EMPTY"; - - private final JarFile mJar; - // String resources maps sorted by its language. The language is determined from the jar entry - // name by calling {@link JarUtils#getLocaleFromEntryName(String)}. - private final TreeMap mResourcesMap = new TreeMap<>(); - // Default string resources map. - private final StringResourceMap mDefaultResourceMap; - // Histogram of string resource names. This is used to sort {@link #mSortedResourceNames}. - private final HashMap mNameHistogram = new HashMap<>(); - // Sorted string resource names array; Descending order of histogram count. - // The string resource name is specified as an attribute "name" in string resource files. - // The string resource can be accessed by specifying name "!text/" - // via {@link KeyboardTextsSet#getText(String)}. - private final String[] mSortedResourceNames; - - public MoreKeysResources(final JarFile jar) { - mJar = jar; - final ArrayList resourceEntryNames = JarUtils.getEntryNameListing( - jar, TEXT_RESOURCE_NAME); - for (final String entryName : resourceEntryNames) { - final StringResourceMap resMap = new StringResourceMap(entryName); - mResourcesMap.put(LocaleUtils.getLocaleCode(resMap.mLocale), resMap); - } - mDefaultResourceMap = mResourcesMap.get( - LocaleUtils.getLocaleCode(LocaleUtils.DEFAULT_LOCALE)); - - // Initialize name histogram and names list. - final HashMap nameHistogram = mNameHistogram; - final ArrayList resourceNamesList = new ArrayList<>(); - for (final StringResource res : mDefaultResourceMap.getResources()) { - nameHistogram.put(res.mName, 0); // Initialize histogram value. - resourceNamesList.add(res.mName); - } - // Make name histogram. - for (final String locale : mResourcesMap.keySet()) { - final StringResourceMap resMap = mResourcesMap.get(locale); - if (resMap == mDefaultResourceMap) continue; - for (final StringResource res : resMap.getResources()) { - if (!mDefaultResourceMap.contains(res.mName)) { - throw new RuntimeException(res.mName + " in " + locale - + " doesn't have default resource"); - } - final int histogramValue = nameHistogram.get(res.mName); - nameHistogram.put(res.mName, histogramValue + 1); - } - } - // Sort names list. - Collections.sort(resourceNamesList, new Comparator() { - @Override - public int compare(final String leftName, final String rightName) { - final int leftCount = nameHistogram.get(leftName); - final int rightCount = nameHistogram.get(rightName); - // Descending order of histogram count. - if (leftCount > rightCount) return -1; - if (leftCount < rightCount) return 1; - // TODO: Add further criteria to order the same histogram value names to be able to - // minimize footprints of string resources arrays. - return 0; - } - }); - mSortedResourceNames = resourceNamesList.toArray(new String[resourceNamesList.size()]); - } - - public void writeToJava(final String outDir) { - final ArrayList list = JarUtils.getEntryNameListing(mJar, JAVA_TEMPLATE); - if (list.isEmpty()) { - throw new RuntimeException("Can't find java template " + JAVA_TEMPLATE); - } - if (list.size() > 1) { - throw new RuntimeException("Found multiple java template " + JAVA_TEMPLATE); - } - final String template = list.get(0); - final String javaPackage = template.substring(0, template.lastIndexOf('/')); - PrintStream ps = null; - LineNumberReader lnr = null; - try { - if (outDir == null) { - ps = System.out; - } else { - final File outPackage = new File(outDir, javaPackage); - final File outputFile = new File(outPackage, - JAVA_TEMPLATE.replace(".tmpl", ".java")); - outPackage.mkdirs(); - ps = new PrintStream(outputFile, "UTF-8"); - } - lnr = new LineNumberReader(new InputStreamReader(JarUtils.openResource(template))); - inflateTemplate(lnr, ps); - } catch (IOException e) { - throw new RuntimeException(e); - } finally { - JarUtils.close(lnr); - JarUtils.close(ps); - } - } - - private void inflateTemplate(final LineNumberReader in, final PrintStream out) - throws IOException { - String line; - while ((line = in.readLine()) != null) { - if (line.contains(MARK_NAMES)) { - dumpNames(out); - } else if (line.contains(MARK_DEFAULT_TEXTS)) { - dumpDefaultTexts(out); - } else if (line.contains(MARK_TEXTS)) { - dumpTexts(out); - } else if (line.contains(MARK_LOCALES_AND_TEXTS)) { - dumpLocalesMap(out); - } else { - out.println(line); - } - } - } - - private void dumpNames(final PrintStream out) { - final int namesCount = mSortedResourceNames.length; - for (int index = 0; index < namesCount; index++) { - final String name = mSortedResourceNames[index]; - final int histogramValue = mNameHistogram.get(name); - out.format(" /* %3d:%2d */ \"%s\",\n", index, histogramValue, name); - } - } - - private void dumpDefaultTexts(final PrintStream out) { - final int outputArraySize = dumpTextsInternal(out, mDefaultResourceMap); - mDefaultResourceMap.setOutputArraySize(outputArraySize); - } - - private static String getArrayNameForLocale(final Locale locale) { - return TEXTS_ARRAY_NAME_PREFIX + LocaleUtils.getLocaleCode(locale); - } - - private void dumpTexts(final PrintStream out) { - for (final StringResourceMap resMap : mResourcesMap.values()) { - final Locale locale = resMap.mLocale; - if (resMap == mDefaultResourceMap) continue; - out.format(" /* Locale %s: %s */\n", - locale, LocaleUtils.getLocaleDisplayName(locale)); - out.format(" private static final String[] " + getArrayNameForLocale(locale) - + " = {\n"); - final int outputArraySize = dumpTextsInternal(out, resMap); - resMap.setOutputArraySize(outputArraySize); - out.format(" };\n\n"); - } - } - - private void dumpLocalesMap(final PrintStream out) { - for (final StringResourceMap resMap : mResourcesMap.values()) { - final Locale locale = resMap.mLocale; - final String localeStr = LocaleUtils.getLocaleCode(locale); - if (localeStr.equals("he")) { - // android still uses iw, but with newer java versions iw ends up being converted to he - // to be safe, just use both locales - final String localeToDump = (locale == LocaleUtils.DEFAULT_LOCALE) - ? String.format("\"%s\"", localeStr) - : String.format("\"%s\"%s", "iw", " ".substring(localeStr.length())); - out.format(" %s, %-12s /* %3d/%3d %s */\n", - localeToDump, getArrayNameForLocale(locale) + ",", - resMap.getResources().size(), resMap.getOutputArraySize(), - LocaleUtils.getLocaleDisplayName(locale)); - } - final String localeToDump = (locale == LocaleUtils.DEFAULT_LOCALE) - ? String.format("\"%s\"", localeStr) - : String.format("\"%s\"%s", localeStr, " ".substring(localeStr.length())); - out.format(" %s, %-12s /* %3d/%3d %s */\n", - localeToDump, getArrayNameForLocale(locale) + ",", - resMap.getResources().size(), resMap.getOutputArraySize(), - LocaleUtils.getLocaleDisplayName(locale)); - } - } - - private int dumpTextsInternal(final PrintStream out, final StringResourceMap resMap) { - final ArrayInitializerFormatter formatter = - new ArrayInitializerFormatter(out, 100, " ", mSortedResourceNames); - int outputArraySize = 0; - boolean successiveNull = false; - final int namesCount = mSortedResourceNames.length; - for (int index = 0; index < namesCount; index++) { - final String name = mSortedResourceNames[index]; - final StringResource res = resMap.get(name); - if (res != null) { - // TODO: Check whether the resource value is equal to the default. - if (res.mComment != null) { - formatter.outCommentLines(addPrefix(" // ", res. mComment)); - } - final String escaped = escapeNonAscii(res.mValue); - if (escaped.length() == 0) { - formatter.outElement(EMPTY_STRING_VAR + ","); - } else { - formatter.outElement(String.format("\"%s\",", escaped)); - } - successiveNull = false; - outputArraySize = formatter.getCurrentIndex(); - } else { - formatter.outElement("null,"); - successiveNull = true; - } - } - if (!successiveNull) { - formatter.flush(); - } - return outputArraySize; - } - - private static String addPrefix(final String prefix, final String lines) { - final StringBuilder sb = new StringBuilder(); - for (final String line : lines.split("\n")) { - sb.append(prefix + line.trim() + "\n"); - } - return sb.toString(); - } - - private static String escapeNonAscii(final String text) { - final StringBuilder sb = new StringBuilder(); - final int length = text.length(); - for (int i = 0; i < length; i++) { - final char c = text.charAt(i); - if (c >= ' ' && c < 0x7f) { - sb.append(c); - } else { - sb.append(String.format("\\u%04X", (int)c)); - } - } - return sb.toString(); - } -} diff --git a/tools/make-keyboard-text/src/main/java/com/android/inputmethod/keyboard/tools/StringResource.java b/tools/make-keyboard-text/src/main/java/com/android/inputmethod/keyboard/tools/StringResource.java deleted file mode 100644 index a8724a3f..00000000 --- a/tools/make-keyboard-text/src/main/java/com/android/inputmethod/keyboard/tools/StringResource.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.android.inputmethod.keyboard.tools; - -public class StringResource { - public final String mName; - public final String mValue; - public final String mComment; - - public StringResource(final String name, final String value, final String comment) { - mName = name; - mValue = value; - mComment = comment; - } -} diff --git a/tools/make-keyboard-text/src/main/java/com/android/inputmethod/keyboard/tools/StringResourceMap.java b/tools/make-keyboard-text/src/main/java/com/android/inputmethod/keyboard/tools/StringResourceMap.java deleted file mode 100644 index cb080c7c..00000000 --- a/tools/make-keyboard-text/src/main/java/com/android/inputmethod/keyboard/tools/StringResourceMap.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.android.inputmethod.keyboard.tools; - -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; -import org.xml.sax.SAXParseException; -import org.xml.sax.ext.DefaultHandler2; - -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; - -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.parsers.SAXParser; -import javax.xml.parsers.SAXParserFactory; - -public class StringResourceMap { - // Locale of this string resource map. - public final Locale mLocale; - // String resource list. - private final List mResources; - // Name to string resource map. - private final Map mResourcesMap; - - // The length of String[] that is created from this {@link StringResourceMap}. The length is - // calculated in {@link MoreKeysResources#dumpTexts(OutputStream)} and recorded by - // {@link #setOutputArraySize(int)}. The recorded length is used as a part of comment by - // {@link MoreKeysResources#dumpLocaleMap(OutputStream)} via {@link #getOutputArraySize()}. - private int mOutputArraySize; - - public StringResourceMap(final String jarEntryName) { - mLocale = JarUtils.getLocaleFromEntryName(jarEntryName); - final StringResourceHandler handler = new StringResourceHandler(); - final SAXParserFactory factory = SAXParserFactory.newInstance(); - factory.setNamespaceAware(true); - final InputStream stream = JarUtils.openResource(jarEntryName); - try { - final SAXParser parser = factory.newSAXParser(); - // In order to get comment tag. - parser.setProperty("http://xml.org/sax/properties/lexical-handler", handler); - parser.parse(stream, handler); - } catch (ParserConfigurationException e) { - throw new RuntimeException(e.getMessage(), e); - } catch (SAXParseException e) { - throw new RuntimeException(e.getMessage() + " at line " + e.getLineNumber() - + ", column " + e.getColumnNumber(), e); - } catch (SAXException e) { - throw new RuntimeException(e.getMessage(), e); - } catch (IOException e) { - throw new RuntimeException(e.getMessage(), e); - } finally { - JarUtils.close(stream); - } - - mResources = Collections.unmodifiableList(handler.mResources); - final HashMap map = new HashMap<>(); - for (final StringResource res : mResources) { - map.put(res.mName, res); - } - mResourcesMap = map; - } - - public List getResources() { - return mResources; - } - - public boolean contains(final String name) { - return mResourcesMap.containsKey(name); - } - - public StringResource get(final String name) { - return mResourcesMap.get(name); - } - - public void setOutputArraySize(final int arraySize) { - mOutputArraySize = arraySize; - } - - public int getOutputArraySize() { - return mOutputArraySize; - } - - static class StringResourceHandler extends DefaultHandler2 { - private static final String TAG_RESOURCES = "resources"; - private static final String TAG_STRING = "string"; - private static final String ATTR_NAME = "name"; - - final ArrayList mResources = new ArrayList<>(); - - private String mName; - private final StringBuilder mValue = new StringBuilder(); - private final StringBuilder mComment = new StringBuilder(); - - private void init() { - mName = null; - mComment.setLength(0); - } - - @Override - public void comment(char[] ch, int start, int length) { - mComment.append(ch, start, length); - if (ch[start + length - 1] != '\n') { - mComment.append('\n'); - } - } - - @Override - public void startElement(String uri, String localName, String qName, Attributes attr) { - if (TAG_RESOURCES.equals(localName)) { - init(); - } else if (TAG_STRING.equals(localName)) { - mName = attr.getValue(ATTR_NAME); - mValue.setLength(0); - } - } - - @Override - public void characters(char[] ch, int start, int length) { - mValue.append(ch, start, length); - } - - @Override - public void endElement(String uri, String localName, String qName) throws SAXException { - if (TAG_STRING.equals(localName)) { - if (mName == null) - throw new SAXException(TAG_STRING + " doesn't have name"); - final String comment = mComment.length() > 0 ? mComment.toString() : null; - String value = mValue.toString(); - if (value.startsWith("\"") && value.endsWith("\"")) { - // Trim surroundings double quote. - value = value.substring(1, value.length() - 1); - } - mResources.add(new StringResource(mName, value, comment)); - init(); - } - } - } -} diff --git a/tools/make-keyboard-text/src/main/resources/org/dslul/openboard/inputmethod/keyboard/internal/KeyboardTextsTable.tmpl b/tools/make-keyboard-text/src/main/resources/org/dslul/openboard/inputmethod/keyboard/internal/KeyboardTextsTable.tmpl deleted file mode 100644 index 1f5fc544..00000000 --- a/tools/make-keyboard-text/src/main/resources/org/dslul/openboard/inputmethod/keyboard/internal/KeyboardTextsTable.tmpl +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * SPDX-License-Identifier: Apache-2.0 - */ - -package org.dslul.openboard.inputmethod.keyboard.internal; - -import java.util.HashMap; -import java.util.Locale; - -/** - * !!!!! DO NOT EDIT THIS FILE !!!!! - * - * This file is generated by tools/make-keyboard-text. The base template file is - * tools/make-keyboard-text/src/main/resources/org/dslul/openboard/inputmethod/keyboard/ - * internal/KeyboardTextsTable.tmpl - * - * This file must be updated when any text resources in keyboard layout files have been changed. - * These text resources are referred as "!text/" in keyboard XML definitions, - * and should be defined in - * tools/make-keyboard-text/src/main/resources/values-/donottranslate-more-keys.xml - * - * To update this file, please run the following commands. - * $ gradle :tools:make-keyboard-text:makeText - * - * The updated source file will be generated to the following path (this file). - * app/src/main/java/org/dslul/openboard/inputmethod/keyboard/internal/KeyboardTextsTable.java - * - */ -public final class KeyboardTextsTable { - // Name to index map. - private static final HashMap sNameToIndexesMap = new HashMap<>(); - // Locale to texts table map. - private static final HashMap sLocaleToTextsTableMap = new HashMap<>(); - // TODO: Remove this variable after debugging. - // Texts table to locale maps. - private static final HashMap sTextsTableToLocaleMap = new HashMap<>(); - - public static String getText(final String name, final String[] textsTable) { - final Integer indexObj = sNameToIndexesMap.get(name); - if (indexObj == null) { - throw new RuntimeException("Unknown text name=" + name + " locale=" - + sTextsTableToLocaleMap.get(textsTable)); - } - final int index = indexObj; - final String text = (index < textsTable.length) ? textsTable[index] : null; - if (text != null) { - return text; - } - // Validity check. - if (index >= 0 && index < TEXTS_DEFAULT.length) { - return TEXTS_DEFAULT[index]; - } - // Throw exception for debugging purpose. - throw new RuntimeException("Illegal index=" + index + " for name=" + name - + " locale=" + sTextsTableToLocaleMap.get(textsTable)); - } - - public static String[] getTextsTable(final Locale locale) { - final String localeKey = locale.toString(); - if (sLocaleToTextsTableMap.containsKey(localeKey)) { - return sLocaleToTextsTableMap.get(localeKey); - } - final String languageKey = locale.getLanguage(); - if (sLocaleToTextsTableMap.containsKey(languageKey)) { - return sLocaleToTextsTableMap.get(languageKey); - } - return TEXTS_DEFAULT; - } - - private static final String[] NAMES = { - // /* index:histogram */ "name", - /* @NAMES@ */ - }; - - private static final String EMPTY = ""; - - /* Default texts */ - private static final String[] TEXTS_DEFAULT = { - /* @DEFAULT_TEXTS@ */ - }; - - /* @TEXTS@ */ - private static final Object[] LOCALES_AND_TEXTS = { - // "locale", TEXT_ARRAY, /* numberOfNonNullText/lengthOf_TEXT_ARRAY localeName */ - /* @LOCALES_AND_TEXTS@ */ - }; - - static { - for (int index = 0; index < NAMES.length; index++) { - sNameToIndexesMap.put(NAMES[index], index); - } - - for (int i = 0; i < LOCALES_AND_TEXTS.length; i += 2) { - final String locale = (String)LOCALES_AND_TEXTS[i]; - final String[] textsTable = (String[])LOCALES_AND_TEXTS[i + 1]; - sLocaleToTextsTableMap.put(locale, textsTable); - sTextsTableToLocaleMap.put(textsTable, locale); - } - } -} \ No newline at end of file diff --git a/tools/make-keyboard-text/src/main/resources/values-af/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-af/donottranslate-more-keys.xml deleted file mode 100644 index 039c87c3..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-af/donottranslate-more-keys.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - á,â,ä,à,æ,ã,å,ā - - é,è,ê,ë,ę,ė,ē - - í,ì,ï,î,į,ī,ij - - ó,ô,ö,ò,õ,œ,ø,ō - - ú,û,ü,ù,ū - - ñ,ń - - ý,ij - diff --git a/tools/make-keyboard-text/src/main/resources/values-ar/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-ar/donottranslate-more-keys.xml deleted file mode 100644 index 9b85127d..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-ar/donottranslate-more-keys.xml +++ /dev/null @@ -1,118 +0,0 @@ - - - - - أ‌ب‌ج - - ١ - - ٢ - - ٣ - - ٤ - - ٥ - - ٦ - - ٧ - - ٨ - - ٩ - - ٠ - - ٣٢١؟ - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - 0,٫,٬ - - ، - - ّ - !text/morekeys_arabic_diacritics - ّ - !text/morekeys_arabic_diacritics - ؟ - ؛ - - ٪ - - ?,¿ - ; - - \\%,‰ - - "،" - "؟" - "!fixedColumnOrder!4,:,!,؟,؛,-,\",\'" - - - - ★,٭ - - - !fixedColumnOrder!4,﴾|﴿,!text/keyspecs_left_parenthesis_more_keys - !fixedColumnOrder!4,﴿|﴾,!text/keyspecs_right_parenthesis_more_keys - - (|) - )|( - [|] - ]|[ - {|} - }|{ - <|> - >|< - ≤|≥ - ≥|≤ - «|» - »|« - ‹|› - ›|‹ - - - - - "!fixedColumnOrder!7, ٕ|ٕ, ٔ|ٔ, ْ|ْ, ٍ|ٍ, ٌ|ٌ, ً|ً, ّ|ّ, ٖ|ٖ, ٰ|ٰ, ٓ|ٓ, ِ|ِ, ُ|ُ, َ|َ,ـــ|ـ" - diff --git a/tools/make-keyboard-text/src/main/resources/values-az/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-az/donottranslate-more-keys.xml deleted file mode 100644 index d59b275b..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-az/donottranslate-more-keys.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - â,ä,á - - ə,é - - ı,î,ï,ì,í,į,ī - - ö,ô,œ,ò,ó,õ,ø,ō - - ü,û,ù,ú,ū - - ş,ß,ś,š - - ğ - - ň,ñ - - ç,ć,č - - ý - - ž - diff --git a/tools/make-keyboard-text/src/main/resources/values-be/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-be/donottranslate-more-keys.xml deleted file mode 100644 index d02e711e..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-be/donottranslate-more-keys.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - ў - - ы - - э - - і - - ё - - ъ - - АБВ - !text/single_9qm_lqm - !text/double_9qm_lqm - diff --git a/tools/make-keyboard-text/src/main/resources/values-bg/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-bg/donottranslate-more-keys.xml deleted file mode 100644 index 0f287a9b..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-bg/donottranslate-more-keys.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - АБВ - - !text/double_9qm_lqm - diff --git a/tools/make-keyboard-text/src/main/resources/values-bn-rBD/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-bn-rBD/donottranslate-more-keys.xml deleted file mode 100644 index 844f80e6..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-bn-rBD/donottranslate-more-keys.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - কখগ - - - - - - - - - - - - - - - - - - - - - - - - ?১২৩ - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 0 - - - "!autoColumnOrder!8,\\,,॥,?,!,!icon/zwnj_key|\u200C,!icon/zwj_key|\u200D,#,@,!text/keyspec_left_parenthesis,!text/keyspec_right_parenthesis,/,;,:,-,+,\\%" - "!autoColumnOrder!8,\\,,॥,?,!,!icon/zwnj_key|\u200C,!icon/zwj_key|\u200D,#,@,!text/keyspec_left_parenthesis,!text/keyspec_right_parenthesis,/,;,:,-,+,\\%" - - diff --git a/tools/make-keyboard-text/src/main/resources/values-bn-rIN/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-bn-rIN/donottranslate-more-keys.xml deleted file mode 100644 index ecd85c81..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-bn-rIN/donottranslate-more-keys.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - কখগ - - - diff --git a/tools/make-keyboard-text/src/main/resources/values-ca/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-ca/donottranslate-more-keys.xml deleted file mode 100644 index 4f1c3dd5..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-ca/donottranslate-more-keys.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - à,á,ä,â,ã,å,ą,æ,ā,ª - - è,é,ë,ê,ę,ė,ē - - í,ï,ì,î,į,ī - - ò,ó,ö,ô,õ,ø,œ,ō,º - - ú,ü,ù,û,ū - - ñ,ń - - ç,ć,č - - l·l,ł - - "!autoColumnOrder!9,\\,,?,!,·,#,),(,/,;,',@,:,-,\",+,\\%,&" - "!autoColumnOrder!8,\\,,',·,#,),(,/,;,@,:,-,\",+,\\%,&" - - ç - diff --git a/tools/make-keyboard-text/src/main/resources/values-cs/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-cs/donottranslate-more-keys.xml deleted file mode 100644 index 1719dd25..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-cs/donottranslate-more-keys.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - á,à,â,ä,æ,ã,å,ā - - é,ě,è,ê,ë,ę,ė,ē - - í,î,ï,ì,į,ī - - ó,ö,ô,ò,õ,œ,ø,ō - - ú,ů,û,ü,ù,ū - - š,ß,ś - - ň,ñ,ń - - č,ç,ć - - ý,ÿ - - ď - - ř - - ť - - ž,ź,ż - !text/single_9qm_lqm - !text/double_9qm_lqm - !text/single_raqm_laqm - !text/double_raqm_laqm - diff --git a/tools/make-keyboard-text/src/main/resources/values-da/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-da/donottranslate-more-keys.xml deleted file mode 100644 index d96a2a41..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-da/donottranslate-more-keys.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - å,æ,á,ä,à,â,ã,ā - - é,ë - - í,ï - - ø,ö,ó,ô,ò,õ,œ,ō - - ú,ü,û,ù,ū - - ß,ś,š - - ñ,ń - - ý,ÿ - - ð - - ł - - å - - æ - - ø - - ä - - ö - !text/single_9qm_lqm - !text/double_9qm_lqm - !text/single_raqm_laqm - !text/double_raqm_laqm - diff --git a/tools/make-keyboard-text/src/main/resources/values-de-rDE/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-de-rDE/donottranslate-more-keys.xml deleted file mode 100644 index 47ae1b2b..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-de-rDE/donottranslate-more-keys.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - ä,â,à,á,æ,ã,å,ā - - é,è,ê,ë,ė - - ö,ô,ò,ó,õ,œ,ø,ō - - ü,û,ù,ú,ū - - ß,%,ẞ,ś,š - - ñ,ń - - ü - - è - - ö - - é - - ä - - à - !text/single_9qm_lqm - !text/double_9qm_lqm - !text/single_raqm_laqm - !text/double_raqm_laqm - diff --git a/tools/make-keyboard-text/src/main/resources/values-de/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-de/donottranslate-more-keys.xml deleted file mode 100644 index ae76bbd7..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-de/donottranslate-more-keys.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - ä,%,â,à,á,æ,ã,å,ā - - é,è,ê,ë,ė - - ö,%,ô,ò,ó,õ,œ,ø,ō - - ü,%,û,ù,ú,ū - - ß,%,ẞ,ś,š - - ñ,ń - - ü - - è - - ö - - é - - ä - - à - !text/single_9qm_lqm - !text/double_9qm_lqm - !text/single_raqm_laqm - !text/double_raqm_laqm - diff --git a/tools/make-keyboard-text/src/main/resources/values-el/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-el/donottranslate-more-keys.xml deleted file mode 100644 index cd6ef962..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-el/donottranslate-more-keys.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - ΑΒΓ - diff --git a/tools/make-keyboard-text/src/main/resources/values-en/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-en/donottranslate-more-keys.xml deleted file mode 100644 index 127ba087..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-en/donottranslate-more-keys.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - à,á,â,ä,æ,ã,å,ā - - é,è,ê,ë,ē - - í,î,ï,ī,ì - - ó,ô,ö,ò,œ,ø,ō,õ - - ú,û,ü,ù,ū - - ß - - ñ - - ç - diff --git a/tools/make-keyboard-text/src/main/resources/values-eo/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-eo/donottranslate-more-keys.xml deleted file mode 100644 index 0faaf5e2..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-eo/donottranslate-more-keys.xml +++ /dev/null @@ -1,132 +0,0 @@ - - - - - á,à,â,ä,æ,ã,å,ā,ă,ą,ª - - é,ě,è,ê,ë,ę,ė,ē - - í,î,ï,ĩ,ì,į,ī,ı,ij - - ó,ö,ô,ò,õ,œ,ø,ō,ő,º - - ú,ů,û,ü,ù,ū,ũ,ű,ų,µ - - ß,š,ś,ș,ş - - ñ,ń,ņ,ň,ʼn,ŋ - - ć,č,ç,ċ - - y,ý,ŷ,ÿ,þ - - ð,ď,đ - - ř,ŕ,ŗ - - ť,ț,ţ,ŧ - - ź,ż,ž - - ķ,ĸ - - ĺ,ļ,ľ,ŀ,ł - - ğ,ġ,ģ - - w,ŵ - - ĥ,ħ - - w,ŵ - q - x - - ŝ - - ĝ - - ŭ - - ĉ - - ĵ - diff --git a/tools/make-keyboard-text/src/main/resources/values-es/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-es/donottranslate-more-keys.xml deleted file mode 100644 index 1c4830fd..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-es/donottranslate-more-keys.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - á,à,ä,â,ã,å,ą,æ,ā,ª - - é,è,ë,ê,ę,ė,ē - - í,ï,ì,î,į,ī - - ó,ò,ö,ô,õ,ø,œ,ō,º - - ú,ü,ù,û,ū - - ñ,ń - - ç,ć,č - - "!autoColumnOrder!9,\\,,?,!,#,),(,/,;,¡,',@,:,-,\",+,\\%,&,¿" - diff --git a/tools/make-keyboard-text/src/main/resources/values-et/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-et/donottranslate-more-keys.xml deleted file mode 100644 index 46456c17..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-et/donottranslate-more-keys.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - ä,ā,à,á,â,ã,å,æ,ą - - ē,è,ė,é,ê,ë,ę,ě - - ī,ì,į,í,î,ï,ı - - ö,õ,ò,ó,ô,œ,ő,ø - - ü,ū,ų,ù,ú,û,ů,ű - - š,ß,ś,ş - - ņ,ñ,ń - - č,ç,ć - - ý,ÿ - - ď - - ŗ,ř,ŕ - - ţ,ť - - ž,ż,ź - - ķ - - ļ,ł,ĺ,ľ - - ģ,ğ - - ü - - ö - - ä - - õ - !text/single_9qm_lqm - !text/double_9qm_lqm - diff --git a/tools/make-keyboard-text/src/main/resources/values-eu/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-eu/donottranslate-more-keys.xml deleted file mode 100644 index 228ee6b2..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-eu/donottranslate-more-keys.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - á,à,ä,â,ã,å,ą,æ,ā,ª - - é,è,ë,ê,ę,ė,ē - - í,ï,ì,î,į,ī - - ó,ò,ö,ô,õ,ø,œ,ō,º - - ú,ü,ù,û,ū - - ñ,ń - - ç,ć,č - diff --git a/tools/make-keyboard-text/src/main/resources/values-fa/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-fa/donottranslate-more-keys.xml deleted file mode 100644 index 5e7dd739..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-fa/donottranslate-more-keys.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - ا‌ب‌پ - - ۱ - - ۲ - - ۳ - - ۴ - - ۵ - - ۶ - - ۷ - - ۸ - - ۹ - - ۰ - - ۳۲۱؟ - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - 0,٫,٬ - - ، - - ً - !text/morekeys_arabic_diacritics - ً - !text/morekeys_arabic_diacritics - ؟ - ؛ - - ٪ - - ?,¿ - ; - - \\%,‰ - - "،" - "؟" - "!fixedColumnOrder!4,:,!,؟,؛,-,!text/keyspec_left_double_angle_quote,!text/keyspec_right_double_angle_quote" - - - - - - ★,٭ - - - !fixedColumnOrder!4,﴾|﴿,!text/keyspecs_left_parenthesis_more_keys - !fixedColumnOrder!4,﴿|﴾,!text/keyspecs_right_parenthesis_more_keys - - !fixedColumnOrder!3,!text/keyspec_left_single_angle_quote,!text/keyspec_less_than_equal,!text/keyspec_less_than - !fixedColumnOrder!3,!text/keyspec_right_single_angle_quote,!text/keyspec_greater_than_equal,!text/keyspec_greater_than - (|) - )|( - [|] - ]|[ - {|} - }|{ - <|> - >|< - ≤|≥ - ≥|≤ - «|» - »|« - ‹|› - ›|‹ - - - - - "!fixedColumnOrder!7, ٕ|ٕ, ْ|ْ, ّ|ّ, ٌ|ٌ, ٍ|ٍ, ً|ً, ٔ|ٔ, ٖ|ٖ, ٰ|ٰ, ٓ|ٓ, ُ|ُ, ِ|ِ, َ|َ,ـــ|ـ" - diff --git a/tools/make-keyboard-text/src/main/resources/values-fi/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-fi/donottranslate-more-keys.xml deleted file mode 100644 index 9be1572c..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-fi/donottranslate-more-keys.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - ä,å,æ,à,á,â,ã,ā - - ö,ø,ô,ò,ó,õ,œ,ō - - ü - - š,ß,ś - - ž,ź,ż - - å - - ö - - ä - - ø - - æ - diff --git a/tools/make-keyboard-text/src/main/resources/values-fr/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-fr/donottranslate-more-keys.xml deleted file mode 100644 index d6907785..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-fr/donottranslate-more-keys.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - à,â,%,æ,á,ä,ã,å,ā,ª - - é,è,ê,ë,%,ę,ė,ē - - î,%,ï,ì,í,į,ī - - ô,œ,%,ö,ò,ó,õ,ø,ō,º - - ù,û,%,ü,ú,ū - - ç,%,ć,č - - %,ÿ - - è - - ü - - é - - ö - - à - - ä - diff --git a/tools/make-keyboard-text/src/main/resources/values-gl/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-gl/donottranslate-more-keys.xml deleted file mode 100644 index 228ee6b2..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-gl/donottranslate-more-keys.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - á,à,ä,â,ã,å,ą,æ,ā,ª - - é,è,ë,ê,ę,ė,ē - - í,ï,ì,î,į,ī - - ó,ò,ö,ô,õ,ø,œ,ō,º - - ú,ü,ù,û,ū - - ñ,ń - - ç,ć,č - diff --git a/tools/make-keyboard-text/src/main/resources/values-hi-rZZ/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-hi-rZZ/donottranslate-more-keys.xml deleted file mode 100644 index 48e2fa34..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-hi-rZZ/donottranslate-more-keys.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - Go - Send - Next - Done - Search - Prev - Pause - Wait - diff --git a/tools/make-keyboard-text/src/main/resources/values-hi/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-hi/donottranslate-more-keys.xml deleted file mode 100644 index af38719b..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-hi/donottranslate-more-keys.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - कखग - - - - - - - - - - - - - - - - - - - - - - ?१२३ - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 0 - - - - - - "!autoColumnOrder!9,\\,,.,?,!,#,),(,/,;,',@,:,-,\",+,\\%,&" - "!autoColumnOrder!8,\\,,.,',#,),(,/,;,@,:,-,\",+,\\%,&" - diff --git a/tools/make-keyboard-text/src/main/resources/values-hr/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-hr/donottranslate-more-keys.xml deleted file mode 100644 index 0084e48d..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-hr/donottranslate-more-keys.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - š,ś,ß - - ñ,ń - - ž,ź,ż - - č,ć,ç - - đ - !text/single_9qm_rqm - !text/double_9qm_rqm - !text/single_raqm_laqm - !text/double_raqm_laqm - diff --git a/tools/make-keyboard-text/src/main/resources/values-hu/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-hu/donottranslate-more-keys.xml deleted file mode 100644 index 2f9e0a64..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-hu/donottranslate-more-keys.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - á - - é - - í - - ó,ö,ő - - ú,ü,ű - !text/single_9qm_rqm - !text/double_9qm_rqm - !text/single_raqm_laqm - !text/double_raqm_laqm - diff --git a/tools/make-keyboard-text/src/main/resources/values-hy/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-hy/donottranslate-more-keys.xml deleted file mode 100644 index 111db0d2..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-hy/donottranslate-more-keys.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - ԱԲԳ - - "!autoColumnOrder!8,\\,,՞,՜,․,…,',=,/,՝,՛,֊,»,«,―,),(" - - ՞,¿ - - ՜,¡ - - - - , - , - - ։ - ։ - !text/morekeys_punctuation - diff --git a/tools/make-keyboard-text/src/main/resources/values-is/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-is/donottranslate-more-keys.xml deleted file mode 100644 index 3d729227..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-is/donottranslate-more-keys.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - á,ä,æ,å,à,â,ã,ā - - é,ë,è,ê,ę,ė,ē - - í,ï,î,ì,į,ī - - ó,ö,ô,ò,õ,œ,ø,ō - - ú,ü,û,ù,ū - - ý,ÿ - - ð - - þ - !text/single_9qm_lqm - !text/double_9qm_lqm - diff --git a/tools/make-keyboard-text/src/main/resources/values-it/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-it/donottranslate-more-keys.xml deleted file mode 100644 index a4502fa9..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-it/donottranslate-more-keys.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - à,á,â,ä,æ,ã,å,ā,ª - - è,é,ê,ë,ę,ė,ē,ə - - ì,í,î,ï,į,ī - - ò,ó,ô,ö,õ,œ,ø,ō,º - - ù,ú,û,ü,ū - - ü - - è - - ö - - é - - ä - - à - diff --git a/tools/make-keyboard-text/src/main/resources/values-iw/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-iw/donottranslate-more-keys.xml deleted file mode 100644 index 22bd045c..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-iw/donottranslate-more-keys.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - אבג - - - - ±,﬩ - - - (|) - )|( - [|] - ]|[ - {|} - }|{ - <|> - >|< - ≤|≥ - ≥|≤ - «|» - »|« - ‹|› - ›|‹ - !text/single_rqm_9qm - !text/double_rqm_9qm - - - diff --git a/tools/make-keyboard-text/src/main/resources/values-ka/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-ka/donottranslate-more-keys.xml deleted file mode 100644 index 57117b3b..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-ka/donottranslate-more-keys.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - აბგ - !text/single_9qm_lqm - !text/double_9qm_lqm - diff --git a/tools/make-keyboard-text/src/main/resources/values-kk/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-kk/donottranslate-more-keys.xml deleted file mode 100644 index c57beddd..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-kk/donottranslate-more-keys.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - щ - - ы - - э - - и - - ү,ұ - - қ - - ё - - ң - - ғ - - і - - ә - - ө - - һ - - ъ - - АБВ - diff --git a/tools/make-keyboard-text/src/main/resources/values-km/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-km/donottranslate-more-keys.xml deleted file mode 100644 index f91a5b06..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-km/donottranslate-more-keys.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - កខគ - - ៛,¢,£,€,¥,₱ - diff --git a/tools/make-keyboard-text/src/main/resources/values-kn/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-kn/donottranslate-more-keys.xml deleted file mode 100644 index 92485540..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-kn/donottranslate-more-keys.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - ಅಆಇ - - - diff --git a/tools/make-keyboard-text/src/main/resources/values-ko/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-ko/donottranslate-more-keys.xml deleted file mode 100644 index 5ff817c5..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-ko/donottranslate-more-keys.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - ㄱㄴㄷ - diff --git a/tools/make-keyboard-text/src/main/resources/values-ky/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-ky/donottranslate-more-keys.xml deleted file mode 100644 index 50e41223..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-ky/donottranslate-more-keys.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - щ - - ы - - э - - и - - ү - - ё - - ң - - ө - - ъ - - АБВ - diff --git a/tools/make-keyboard-text/src/main/resources/values-lo/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-lo/donottranslate-more-keys.xml deleted file mode 100644 index cbb65dcc..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-lo/donottranslate-more-keys.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - ກຂຄ - - - diff --git a/tools/make-keyboard-text/src/main/resources/values-lt/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-lt/donottranslate-more-keys.xml deleted file mode 100644 index 4bcbac02..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-lt/donottranslate-more-keys.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - ą,ä,ā,à,á,â,ã,å,æ - - ė,ę,ē,è,é,ê,ë,ě - - į,ī,ì,í,î,ï,ı - - ö,õ,ò,ó,ô,œ,ő,ø - - ū,ų,ü,ū,ù,ú,û,ů,ű - - š,ß,ś,ş - - ņ,ñ,ń - - č,ç,ć - - ý,ÿ - - ď - - ŗ,ř,ŕ - - ţ,ť - - ž,ż,ź - - ķ - - ļ,ł,ĺ,ľ - - ģ,ğ - !text/single_9qm_lqm - !text/double_9qm_lqm - diff --git a/tools/make-keyboard-text/src/main/resources/values-lv/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-lv/donottranslate-more-keys.xml deleted file mode 100644 index 4b985ed6..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-lv/donottranslate-more-keys.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - ā,à,á,â,ã,ä,å,æ,ą - - ē,ė,è,é,ê,ë,ę,ě - - ī,į,ì,í,î,ï,ı - - ò,ó,ô,õ,ö,œ,ő,ø - - ū,ų,ù,ú,û,ü,ů,ű - - š,ß,ś,ş - - ņ,ñ,ń - - č,ç,ć - - ý,ÿ - - ď - - ŗ,ř,ŕ - - ţ,ť - - ž,ż,ź - - ķ - - ļ,ł,ĺ,ľ - - ģ,ğ - !text/single_9qm_lqm - !text/double_9qm_lqm - diff --git a/tools/make-keyboard-text/src/main/resources/values-mk/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-mk/donottranslate-more-keys.xml deleted file mode 100644 index 065dd7cf..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-mk/donottranslate-more-keys.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - ѕ - - ќ - - з - - ѓ - - ѐ - - ѝ - - АБВ - !text/single_9qm_lqm - !text/double_9qm_lqm - diff --git a/tools/make-keyboard-text/src/main/resources/values-ml/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-ml/donottranslate-more-keys.xml deleted file mode 100644 index 17c29f3a..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-ml/donottranslate-more-keys.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/tools/make-keyboard-text/src/main/resources/values-mn/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-mn/donottranslate-more-keys.xml deleted file mode 100644 index ebe1c625..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-mn/donottranslate-more-keys.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - АБВ - - - diff --git a/tools/make-keyboard-text/src/main/resources/values-mr/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-mr/donottranslate-more-keys.xml deleted file mode 100644 index 2c0fd7ed..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-mr/donottranslate-more-keys.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - कखग - - - - - - - - - - - - - - - - - - - - - - ?१२३ - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 0 - - - diff --git a/tools/make-keyboard-text/src/main/resources/values-my/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-my/donottranslate-more-keys.xml deleted file mode 100644 index b80d7faa..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-my/donottranslate-more-keys.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - ကခဂ - - - "\\," - - - - "!autoColumnOrder!9,၊,.,?,!,#,),(,/,;,...,',@,:,-,\",+,\\%,&" - "!autoColumnOrder!8,.,',#,),(,/,;,@,...,:,-,\",+,\\%,&" - diff --git a/tools/make-keyboard-text/src/main/resources/values-nb/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-nb/donottranslate-more-keys.xml deleted file mode 100644 index 730526c1..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-nb/donottranslate-more-keys.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - å,æ,ä,à,á,â,ã,ā - - é,è,ê,ë,ę,ė,ē - - ø,ö,ô,ò,ó,õ,œ,ō - - ü,û,ù,ú,ū - - å - - ø - - æ - - ö - - ä - !text/single_9qm_rqm - !text/double_9qm_rqm - diff --git a/tools/make-keyboard-text/src/main/resources/values-ne/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-ne/donottranslate-more-keys.xml deleted file mode 100644 index 2311a7bd..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-ne/donottranslate-more-keys.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - कखग - - - - - - - - - - - - - - - - - - - - - - ?१२३ - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 0 - - रु. - - - - "!autoColumnOrder!9,.,\\,,?,!,#,),(,/,;,',@,:,-,\",+,\\%,&" - "!autoColumnOrder!8,.,\\,,',#,),(,/,;,@,:,-,\",+,\\%,&" - diff --git a/tools/make-keyboard-text/src/main/resources/values-nl/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-nl/donottranslate-more-keys.xml deleted file mode 100644 index 4a1f4da9..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-nl/donottranslate-more-keys.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - á,ä,â,à,æ,ã,å,ā - - é,ë,ê,è,ę,ė,ē - - í,ï,ì,î,į,ī,ij - - ó,ö,ô,ò,õ,œ,ø,ō - - ú,ü,û,ù,ū - - ñ,ń - - ij - !text/single_9qm_rqm - !text/double_9qm_rqm - diff --git a/tools/make-keyboard-text/src/main/resources/values-pl/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-pl/donottranslate-more-keys.xml deleted file mode 100644 index 8405ba73..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-pl/donottranslate-more-keys.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - ą,á,à,â,ä,æ,ã,å,ā - - ę,è,é,ê,ë,ė,ē - - ó,ö,ô,ò,õ,œ,ø,ō - - ś,ß,š - - ń,ñ - - ć,ç,č - - ż,ź,ž - - ł - !text/single_9qm_rqm - !text/double_9qm_rqm - diff --git a/tools/make-keyboard-text/src/main/resources/values-pt/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-pt/donottranslate-more-keys.xml deleted file mode 100644 index cae22e9b..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-pt/donottranslate-more-keys.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - á,ã,à,â,ä,å,æ,ª - - é,ê,è,ę,ė,ē,ë - - í,î,ì,ï,į,ī - - ó,õ,ô,ò,ö,œ,ø,ō,º - - ú,ü,ù,û,ū - - ç,č,ć - diff --git a/tools/make-keyboard-text/src/main/resources/values-rm/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-rm/donottranslate-more-keys.xml deleted file mode 100644 index 45787b26..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-rm/donottranslate-more-keys.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - ò,ó,ö,ô,õ,œ,ø - diff --git a/tools/make-keyboard-text/src/main/resources/values-ro/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-ro/donottranslate-more-keys.xml deleted file mode 100644 index b58b0811..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-ro/donottranslate-more-keys.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - ă,â,ã,à,á,ä,æ,å,ā - - î,ï,ì,í,į,ī - - ș,ß,ś,š - - ț - !text/single_9qm_rqm - !text/double_9qm_rqm - diff --git a/tools/make-keyboard-text/src/main/resources/values-ru/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-ru/donottranslate-more-keys.xml deleted file mode 100644 index 847131fe..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-ru/donottranslate-more-keys.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - щ - - ы - - э - - и - - ё - - ъ - - АБВ - !text/single_9qm_lqm - !text/double_9qm_lqm - diff --git a/tools/make-keyboard-text/src/main/resources/values-si/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-si/donottranslate-more-keys.xml deleted file mode 100644 index fdf8bc29..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-si/donottranslate-more-keys.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - අ,ආ - - රු - diff --git a/tools/make-keyboard-text/src/main/resources/values-sk/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-sk/donottranslate-more-keys.xml deleted file mode 100644 index f2a33a1b..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-sk/donottranslate-more-keys.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - - á,ä,ā,à,â,ã,å,æ,ą - - é,ě,ē,ė,è,ê,ë,ę - - í,ī,į,ì,î,ï,ı - - ô,ó,ö,ò,õ,œ,ő,ø - - ú,ů,ü,ū,ų,ù,û,ű - - š,ß,ś,ş - - ň,ņ,ñ,ń - - č,ç,ć - - ý,ÿ - - ď - - ŕ,ř,ŗ - - ť,ţ - - ž,ż,ź - - ķ - - ľ,ĺ,ļ,ł - - ģ,ğ - !text/single_9qm_lqm - !text/double_9qm_lqm - !text/single_raqm_laqm - !text/double_raqm_laqm - diff --git a/tools/make-keyboard-text/src/main/resources/values-sl/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-sl/donottranslate-more-keys.xml deleted file mode 100644 index e40a1e37..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-sl/donottranslate-more-keys.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - š - - č,ć - - đ - - ž - !text/single_9qm_lqm - !text/double_9qm_lqm - !text/single_raqm_laqm - !text/double_raqm_laqm - diff --git a/tools/make-keyboard-text/src/main/resources/values-sr-rZZ/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-sr-rZZ/donottranslate-more-keys.xml deleted file mode 100644 index e94ed2c6..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-sr-rZZ/donottranslate-more-keys.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - è - - ì - - š,% - - č,ć,% - - đ,% - - ž,% - "Idi" - "Šalji" - "Sled" - "Gotov" - "Traži" - "Preth" - "Pauza" - "Čekaj" - diff --git a/tools/make-keyboard-text/src/main/resources/values-sr/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-sr/donottranslate-more-keys.xml deleted file mode 100644 index d9c11b91..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-sr/donottranslate-more-keys.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - з - - ћ - - ѕ - - ђ - - ѐ - - ѝ - - - АБВ - !text/single_9qm_lqm - !text/double_9qm_lqm - !text/single_raqm_laqm - !text/double_raqm_laqm - diff --git a/tools/make-keyboard-text/src/main/resources/values-sv/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-sv/donottranslate-more-keys.xml deleted file mode 100644 index bf0ff015..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-sv/donottranslate-more-keys.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - - - ä,å,æ,á,à,â,ą,ã - - ç,ć,č - - ð,ď - - é,è,ê,ë,ę - - í,ì,î,ï - - ł - - ń,ñ,ň - - ö,ø,œ,ó,ò,ô,õ,ō - - ř - - ś,š,ş,ß - - ť,þ - - ü,ú,ù,û,ū - - ý,ÿ - - ź,ž,ż - - å - - ä - - æ - - ö - - ø,œ - !text/single_raqm_laqm - !text/double_raqm_laqm - diff --git a/tools/make-keyboard-text/src/main/resources/values-sw/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-sw/donottranslate-more-keys.xml deleted file mode 100644 index 61a24047..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-sw/donottranslate-more-keys.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - à,á,â,ä,æ,ã,å,ā - - è,é,ê,ë,ē - - î,ï,í,ī,ì - - ô,ö,ò,ó,œ,ø,ō,õ - - û,ü,ù,ú,ū - - ß - - ñ - - ç - g\' - diff --git a/tools/make-keyboard-text/src/main/resources/values-ta-rIN/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-ta-rIN/donottranslate-more-keys.xml deleted file mode 100644 index ee9aec50..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-ta-rIN/donottranslate-more-keys.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - தமிழ் - - - diff --git a/tools/make-keyboard-text/src/main/resources/values-ta-rLK/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-ta-rLK/donottranslate-more-keys.xml deleted file mode 100644 index 11f6b8c6..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-ta-rLK/donottranslate-more-keys.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - தமிழ் - - රු - diff --git a/tools/make-keyboard-text/src/main/resources/values-ta-rSG/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-ta-rSG/donottranslate-more-keys.xml deleted file mode 100644 index 6e8d7d40..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-ta-rSG/donottranslate-more-keys.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - தமிழ் - diff --git a/tools/make-keyboard-text/src/main/resources/values-te/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-te/donottranslate-more-keys.xml deleted file mode 100644 index e2b64c80..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-te/donottranslate-more-keys.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - అఆఇ - - - diff --git a/tools/make-keyboard-text/src/main/resources/values-th/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-th/donottranslate-more-keys.xml deleted file mode 100644 index 521a0eb7..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-th/donottranslate-more-keys.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - กขค - - ฿ - diff --git a/tools/make-keyboard-text/src/main/resources/values-tl/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-tl/donottranslate-more-keys.xml deleted file mode 100644 index b59bab6f..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-tl/donottranslate-more-keys.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - á,à,ä,â,ã,å,ą,æ,ā,ª - - é,è,ë,ê,ę,ė,ē - - í,ï,ì,î,į,ī - - ó,ò,ö,ô,õ,ø,œ,ō,º - - ú,ü,ù,û,ū - - ñ,ń - - ç,ć,č - diff --git a/tools/make-keyboard-text/src/main/resources/values-tr/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-tr/donottranslate-more-keys.xml deleted file mode 100644 index 2869b42e..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-tr/donottranslate-more-keys.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - â,ä,á - - ə,é - - ı,î,ï,ì,í,į,ī - - ö,ô,œ,ò,ó,õ,ø,ō - - ü,û,ù,ú,ū - - ş,ß,ś,š - - ğ - - ň,ñ - - ç,ć,č - - ý - - ž - diff --git a/tools/make-keyboard-text/src/main/resources/values-uk/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-uk/donottranslate-more-keys.xml deleted file mode 100644 index e111d0d0..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-uk/donottranslate-more-keys.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - щ - - і - - є - - и - - ґ - - ї - - ъ - - - - АБВ - !text/single_9qm_lqm - !text/double_9qm_lqm - diff --git a/tools/make-keyboard-text/src/main/resources/values-ur/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-ur/donottranslate-more-keys.xml deleted file mode 100644 index 7ade10b8..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-ur/donottranslate-more-keys.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - اب‌پ - - ، - - - ۳۲۱؟ - - ۱ - ۲ - ۳ - ۴ - ۵ - ۶ - ۷ - ۸ - ۹ - ۰ - - - ۔ - - - ؟,،,!,.,- - - ؟ - ؛ - - ٪ - - \\%,‰ - - - ★,٭ - - - !fixedColumnOrder!4,﴾|﴿,!text/keyspecs_left_parenthesis_more_keys - !fixedColumnOrder!4,﴿|﴾,!text/keyspecs_right_parenthesis_more_keys - - !fixedColumnOrder!3,!text/keyspec_left_single_angle_quote,!text/keyspec_less_than_equal,!text/keyspec_less_than - !fixedColumnOrder!3,!text/keyspec_right_single_angle_quote,!text/keyspec_greater_than_equal,!text/keyspec_greater_than - (|) - )|( - [|] - ]|[ - {|} - }|{ - <|> - >|< - ≤|≥ - ≥|≤ - «|» - »|« - ‹|› - ›|‹ - diff --git a/tools/make-keyboard-text/src/main/resources/values-uz/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-uz/donottranslate-more-keys.xml deleted file mode 100644 index 737691b8..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-uz/donottranslate-more-keys.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - â,ä,á - - ə,é - - ı,î,ï,ì,í,į,ī - - ö,ô,œ,ò,ó,õ,ø,ō - - ü,û,ù,ú,ū - - ş,ß,ś,š - - ğ - - ň,ñ - - ç,ć,č - - ý - - ž - diff --git a/tools/make-keyboard-text/src/main/resources/values-vi/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-vi/donottranslate-more-keys.xml deleted file mode 100644 index 6029c11f..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-vi/donottranslate-more-keys.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - à,á,ả,ã,ạ,ă,ằ,ắ,ẳ,ẵ,ặ,â,ầ,ấ,ẩ,ẫ,ậ - - è,é,ẻ,ẽ,ẹ,ê,ề,ế,ể,ễ,ệ - - ì,í,ỉ,ĩ,ị - - ò,ó,ỏ,õ,ọ,ô,ồ,ố,ổ,ỗ,ộ,ơ,ờ,ớ,ở,ỡ,ợ - - ù,ú,ủ,ũ,ụ,ư,ừ,ứ,ử,ữ,ự - - ỳ,ý,ỷ,ỹ,ỵ - - đ - - - diff --git a/tools/make-keyboard-text/src/main/resources/values-zu/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-zu/donottranslate-more-keys.xml deleted file mode 100644 index 7dbf80e5..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-zu/donottranslate-more-keys.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - à,á,â,ä,æ,ã,å,ā - - é,è,ê,ë,ē - - í,î,ï,ī,ì - - ó,ô,ö,ò,œ,ø,ō,õ - - ú,û,ü,ù,ū - - ß - - ñ - - ç - diff --git a/tools/make-keyboard-text/src/main/resources/values-zz/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values-zz/donottranslate-more-keys.xml deleted file mode 100644 index 1ede5ef9..00000000 --- a/tools/make-keyboard-text/src/main/resources/values-zz/donottranslate-more-keys.xml +++ /dev/null @@ -1,125 +0,0 @@ - - - - - à,á,â,ã,ä,å,æ,ā,ă,ą,ª - - è,é,ê,ë,ē,ĕ,ė,ę,ě - - ì,í,î,ï,ĩ,ī,ĭ,į,ı,ij - - ò,ó,ô,õ,ö,ø,ō,ŏ,ő,œ,º - - ù,ú,û,ü,ũ,ū,ŭ,ů,ű,ų - - ß,ś,ŝ,ş,š,ſ - - ñ,ń,ņ,ň,ʼn,ŋ - - ç,ć,ĉ,ċ,č - - ý,ŷ,ÿ,ij - - ď,đ,ð - - ŕ,ŗ,ř - - þ,ţ,ť,ŧ - - ź,ż,ž - - ķ,ĸ - - ĺ,ļ,ľ,ŀ,ł - - ĝ,ğ,ġ,ģ - - ĥ - - ĵ - - ŵ - diff --git a/tools/make-keyboard-text/src/main/resources/values/donottranslate-more-keys.xml b/tools/make-keyboard-text/src/main/resources/values/donottranslate-more-keys.xml deleted file mode 100644 index 95f17df5..00000000 --- a/tools/make-keyboard-text/src/main/resources/values/donottranslate-more-keys.xml +++ /dev/null @@ -1,263 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - q - w - y - x - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ABC - !text/single_lqm_rqm - !text/double_lqm_rqm - !text/single_laqm_raqm - !text/double_laqm_raqm - - ¢,£,€,¥,₱ - $ - $,¢,€,£,¥,₱ - "!autoColumnOrder!8,\\,,?,!,#,!text/keyspec_right_parenthesis,!text/keyspec_left_parenthesis,/,;,',@,:,-,\",+,\\%,&" - "!autoColumnOrder!7,\\,,',#,!text/keyspec_right_parenthesis,!text/keyspec_left_parenthesis,/,;,@,:,-,\",+,\\%,&" - - ñ - - †,‡,★ - - ♪,♥,♠,♦,♣ - - ± - !fixedColumnOrder!3,!text/keyspecs_left_parenthesis_more_keys - !fixedColumnOrder!3,!text/keyspecs_right_parenthesis_more_keys - !fixedColumnOrder!3,!text/keyspec_left_single_angle_quote,!text/keyspec_less_than_equal,!text/keyspec_left_double_angle_quote - !fixedColumnOrder!3,!text/keyspec_right_single_angle_quote,!text/keyspec_greater_than_equal,!text/keyspec_right_double_angle_quote - - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 0 - - ?123 - - - - - - - - - - - - ¹,½,⅓,¼,⅛ - - ²,⅔ - - ³,¾,⅜ - - - - - - - - - - - ⁿ,∅ - - ( - ) - [ - ] - { - } - < - > - - - « - » - - - - , - , - - - - . - - !text/morekeys_punctuation - . - - !text/morekeys_tablet_punctuation - ? - ; - % - - ¡ - - ¿ - - - - !fixedColumnOrder!2,!hasLabels!,!text/keylabel_time_am,!text/keylabel_time_pm - !icon/settings_key|!code/key_settings - !icon/shortcut_key|!code/key_shortcut - !hasLabels!,!text/label_next_key|!code/key_action_next - !hasLabels!,!text/label_previous_key|!code/key_action_previous - - = \\\\ < - - ~ [ < - - 123 - - - *# - - "AM" - - "PM" - ".com" - - "!hasLabels!,.net,.org,.gov,.edu" - !text/keyspec_less_than,!text/keyspec_left_curly_bracket,!text/keyspec_left_square_bracket - !text/keyspec_greater_than,!text/keyspec_right_curly_bracket,!text/keyspec_right_square_bracket - - - - !text/keyspec_left_single_angle_quote,!text/keyspec_right_single_angle_quote - !text/keyspec_right_single_angle_quote,!text/keyspec_left_single_angle_quote - !text/keyspec_left_double_angle_quote,!text/keyspec_right_double_angle_quote - !text/keyspec_right_double_angle_quote,!text/keyspec_left_double_angle_quote - - ‚,‘,’ - ’,‚,‘ - ‘,‚,’ - ‘,’,‚ - „,“,” - ”,„,“ - “,„,” - “,”,„ - !fixedColumnOrder!5,!text/single_quotes,!text/single_angle_quotes - !fixedColumnOrder!5,!text/double_quotes,!text/double_angle_quotes - !fixedColumnOrder!6,!text/double_quotes,!text/single_quotes,!text/double_angle_quotes,!text/single_angle_quotes - !icon/emoji_action_key|!code/key_emoji - !icon/emoji_normal_key|!code/key_emoji - !icon/clipboard_action_key|!code/key_clipboard - !icon/clipboard_normal_key|!code/key_clipboard - !icon/start_onehanded_mode_key|!code/key_start_onehanded - !icon/language_switch_key|!code/key_language_switch - !icon/numpad_key|!code/key_numpad - !string/label_go_key - !string/label_send_key - !string/label_next_key - !string/label_done_key - !string/label_search_key - !string/label_previous_key - !string/label_pause_key - !string/label_wait_key - diff --git a/tools/morekeys_reader.py b/tools/morekeys_reader.py deleted file mode 100644 index ed0968da..00000000 --- a/tools/morekeys_reader.py +++ /dev/null @@ -1,276 +0,0 @@ -#!/bin/python -import pathlib -import xml.etree.ElementTree as ET -import langcodes -import re - -# (WIP) script for reading moreKeys from tools used to create KeyTextsTable while resolving "!text/" references -# plan is to create a straightforward moreKeys file per language -xml_folder = "make-keyboard-text/src/main/resources/" -default_file = pathlib.Path(__file__).parent / f"{xml_folder}/values/donottranslate-more-keys.xml" -out_folder = pathlib.Path(__file__).parent / "../app/src/main/assets/language_key_texts/" - - -def append_to_morekeys(morekeys, text, label): - if label in morekeys: - morekeys[label] = morekeys[label] + " " + text - else: - morekeys[label] = text - - -def prepend_to_morekeys(morekeys, text, label): - if label in morekeys: - morekeys[label] = text + " " + morekeys[label] - else: - morekeys[label] = text - - -def read_keys(file): - root = ET.parse(file).getroot() - morekeys = dict() - extra_keys = dict() - labels = dict() - number_row = dict() - for key in root.iter("resources"): - for string in key.iter("string"): - for tag, value in string.items(): - if tag != "name": - print("ignoring tag " + tag) - continue - if string.text is None: - text = "" - else: - text = resolve_text(string.text, file) - if "!text/" in text: - raise ValueError(f"can't have !text/ in {text} (from {string.text})") - if " " in text and "fixedColumnOrder" not in text: # issues with arabic punctuation (more) keys - raise ValueError(f"can't have consecutive spaces in {text} (from {string.text})") - if value.startswith("keyspec_") and "_row" in value and "slavic" not in value: - # put additional key labels (for nordic, spanish, swiss, german, but not for slavic, because here the keys are not extra) - key = value.split("_row")[1] - d = extra_keys.get(key, dict()) - d["label"] = text - extra_keys[key] = d - elif value.startswith("morekeys_") and "_row" in value and "slavic" not in value: - # put additional key morekeys (for nordic, spanish, swiss, german, but not for slavic, because here the keys are not extra) - key = value.split("_row")[1] - d = extra_keys.get(key, dict()) - d["morekeys"] = text - extra_keys[key] = d - elif value.startswith("morekeys_"): - key_label = value.split("morekeys_")[1] - if key_label == "period": - key_label = "punctuation" # used in the same place - if len(key_label) > 1 and key_label != "punctuation": - if key_label.startswith("cyrillic_"): - label = key_label.split("cyrillic_")[1] - if label == "u": - key_label = "у" - elif label == "ka": - key_label = "к" - elif label == "ie": - key_label = "е" - elif label == "en": - key_label = "н" - elif label == "ghe": - key_label = "г" - elif label == "o": - key_label = "о" - elif label == "soft_sign": - key_label = "ь" - elif label == "a": - key_label = "а" - elif label == "i": - key_label = "и" - else: - print(f"ignoring cyrillic long more key: {key_label}: {text}") - continue - else: - if key_label not in ["bullet", "star", "left_parenthesis", "right_parenthesis", "less_than", "greater_than", "symbols_semicolon", "symbols_percent"]: - # only print for keys that are not already handled - print(f"ignoring long more key: {key_label}: {text}") - continue - morekeys[key_label] = text - elif value == "single_quotes": - prepend_to_morekeys(morekeys, text, '\'') - elif value == "single_angle_quotes": - append_to_morekeys(morekeys, text, '\'') - elif value == "double_quotes": - prepend_to_morekeys(morekeys, text, '\"') - elif value == "double_angle_quotes": - append_to_morekeys(morekeys, text, '\"') - elif value == "keylabel_to_alpha": - labels["alphabet"] = text - elif value == "keylabel_to_symbol": - labels["symbol"] = text - elif value == "keyspec_comma": - labels["comma"] = text - elif value == "keyspec_period": - labels["period"] = text - elif value.startswith("keyspec_symbols_") and len(value.split("keyspec_symbols_")[1]) == 1: # checking whether it's an int would be better, but bah - number_row[value.split("keyspec_symbols_")[1]] = text - elif "values-ur" in file and value.startswith("additional_morekeys_symbols_"): - number_row[value.split("additional_morekeys_symbols_")[1]] = text - # for some reason ur has the arabic numbers in moreKeys - elif value in ["keyspec_currency", "symbols_semicolon", "symbols_percent"] or value.startswith("additional_morekeys_symbols_") or "_left_" in value or "_right_" in value or "_greater" in value or "_less_" in value: - pass # ignore keys handled somewhere else (currency key not yet fully replaced) - else: - print(f"ignored tag: {tag}={value}, {text}") - keys = dict() - keys["morekeys"] = morekeys - keys["extra_keys"] = extra_keys - keys["labels"] = labels - keys["number_row"] = number_row - return keys - - -def resolve_text(text, file): - if text.startswith("\"") and text.endswith("\"") and len(text) > 1: - text = text[1:-1] - sp = re.split("(? 1: # resolve each entry separately - result = [] - for t in sp: - resolved = resolve_text(t, file) - if text.startswith("\\"): # remove backslash at start, this seems to be happening somewhere in android parsing too - result.append(resolved[1:]) - else: - result.append(resolved) - return " ".join(result) # join with space, because that doesn't cause issues with comma in moreKeys - if "!text/" not in text: - if text.startswith("\\"): # see above - return text[1:] - return text - root = ET.parse(file).getroot() - sp = text.split("!text/") - required = sp[1] - for key in root.findall(".//string"): - for tag, value in key.items(): - if tag == "name" and value == required: - return resolve_text(key.text, file) - # fall back to searching in no-language values - root = ET.parse(default_file).getroot() - for key in root.findall(".//string"): - for tag, value in key.items(): - if tag == "name" and value == required: - return resolve_text(key.text, file) - raise LookupError(text + " not found in " + str(file)) - - -def read_locale_from_folder(folder): - if folder.startswith("values-"): - return folder.split("values-")[1] - return None - - -def write_keys(outfile, keys, locc=""): - with open(outfile, "w") as f: - # write section [more_keys], then [extra_keys], skip if empty - has_extra_keys = len(keys["extra_keys"]) > 0 - has_labels = len(keys["labels"]) > 0 - has_number_row = len(keys["number_row"]) > 0 - if len(keys["morekeys"]) > 0: - f.write("[morekeys]\n") - for k, v in keys["morekeys"].items(): - f.write(f"{k} {v}\n") - if has_labels or has_number_row or has_extra_keys: - f.write("\n") - if has_extra_keys and locc != "eo": # eo has the extra key moved into the layout - f.write("[extra_keys]\n") - # clarify somewhere that extra keys only apply to default layout (where to get?) - for k, v in sorted(keys["extra_keys"].items()): - row = k.split("_")[0] - morekeys = v.get("morekeys", "") - label = v["label"] - if len(morekeys) == 0: - f.write(f"{row}: {label}\n") - else: - f.write(f"{row}: {label} {morekeys}\n") - if has_labels or has_number_row: - f.write("\n") - if has_labels: - f.write("[labels]\n") - for k, v in keys["labels"].items(): - f.write(f"{k}: {v}\n") - if has_number_row: - f.write("\n") - if has_number_row: - if len(keys["number_row"]) != 10: - raise ValueError("number row must have 10 keys") - f.write("[number_row]\n") - zero = keys["number_row"]["0"] - for k, v in sorted(keys["number_row"].items()): - if k == "0": - continue - f.write(f"{v} ") - f.write(f"{zero}\n") - - -def get_morekeys_texts(write=False): - val = [] - for file in (pathlib.Path(__file__).parent / xml_folder).iterdir(): - locc = read_locale_from_folder(file.name) - if locc is None: - continue - loc = langcodes.Language.get(locc) - - script = loc.assume_script().script - # some scripts are not detected, fill in the current state of OpenBoard - if locc == "sr" or locc == "ky" or locc == "mn": - script = "Cyrl" - if locc == "sr-rZZ" or locc == "uz" or locc == "zz" or locc == "az" or locc == "tl": - script = "Latn" - if script is None: - raise ValueError("undefined script") - if script != "Latn": - continue # skip non-latin scripts - print(file) - keys = read_keys(f"{file}/donottranslate-more-keys.xml") - val.append(keys) - if not write: - continue - outfile_name = locc.replace("-r", "_").lower() + ".txt" -# outfile = pathlib.Path(out_folder + outfile_name) - outfile = out_folder / outfile_name - outfile.parent.mkdir(exist_ok=True, parents=True) - write_keys(outfile, keys, locc) - return val - - -# write lists of all moreKeys from different languages -def write_combined_lists(keys): - infos_by_letters = dict() - for key in keys: - for k, v in key["morekeys"].items(): - infos = infos_by_letters.get(k, dict()) - for l in v.split(" "): - if l == "%": - continue - infos[l] = infos.get(l, 0) + 1 - infos_by_letters[k] = infos - with open(out_folder / "all_more_keys.txt", 'w') as f: - f.write("[morekeys]\n") - for letter, info in infos_by_letters.items(): - sorted_info = dict(sorted(info.items(), key=lambda item: item[1], reverse=True)) - f.write(letter + " " + " ".join(sorted_info.keys()) + "\n") - with open(out_folder / "more_more_keys.txt", 'w') as f: - f.write("[morekeys]\n") - for letter, info in infos_by_letters.items(): - morekeys = [] - for morekey, count in sorted(info.items(), key=lambda item: item[1], reverse=True): - if count > 1: - morekeys.append(morekey) - if len(morekeys) > 0: - f.write(letter + " " + " ".join(morekeys) + "\n") - - -def main(): -# k = read_keys(default_file) -# write_keys(pathlib.Path(__file__).parent / f"defaultkeys.txt", k) - keys = get_morekeys_texts(False) -# write_combined_lists(keys) - - -if __name__ == "__main__": - main()