Skip to content

Commit

Permalink
Merge pull request #9562 from keymanapp/chore/merge-master-into-epic-…
Browse files Browse the repository at this point in the history
…windows-upgrades

chore(windows): Merge master into epic/windows-upgrades for sprint A17S21 📲
  • Loading branch information
rc-swag authored Sep 19, 2023
2 parents 94be8c6 + 38b8cf7 commit 6ba5fb4
Show file tree
Hide file tree
Showing 67 changed files with 1,937 additions and 143 deletions.
47 changes: 47 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,52 @@
# Keyman Version History

## 17.0.173 alpha 2023-09-13

* chore(common): Update to Unicode 15.1 (#9555)

## 17.0.172 alpha 2023-09-12

* fix(linux): Prevent exception if neither USER, LOGNAME nor SUDO_USER set (#9543)
* chore(linux): Exclude environment.sh from build (#9553)

## 17.0.171 alpha 2023-09-01

* chore(linux): Add `clean` target to `rules` (#9531)

## 17.0.170 alpha 2023-08-31

* fix(common): builder_parse broke on option parameters (#9489)
* docs(linux): Explicitly specify emscripten version (#9527)

## 17.0.169 alpha 2023-08-30

* fix(linux): Fix exception in km-kvk2ldml (#9523)

## 17.0.168 alpha 2023-08-29

* refactor(linux): Fix warning (#9513)

## 17.0.167 alpha 2023-08-25

* feat(core): implement mapped set mapping (#9504)
* feat(resources): add pcm keyboard (#9508)

## 17.0.166 alpha 2023-08-24

* chore(common): Update crowdin strings for French (#9505)

## 17.0.165 alpha 2023-08-23

* feat(core): add display=id (#9484)

## 17.0.164 alpha 2023-08-22

* fix(common): don't crash on illegal unicodesets (#9492)

## 17.0.163 alpha 2023-08-21

* chore(web): Update keymanweb-osk.ttf to v. 3.0 (#9469)

## 17.0.162 alpha 2023-08-18

* (#9483)
Expand Down
2 changes: 1 addition & 1 deletion VERSION.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
17.0.163
17.0.174
10 changes: 7 additions & 3 deletions android/KMAPro/kMAPro/src/main/res/values-fr-rFR/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- app_name removed in 16.0 beta. Set in build.gradle -->
<!-- Context: Menu Action -->
<string name="action_share" comment="Menu action to send text content to another app">Partager</string>
<!-- Context: Menu Action -->
Expand All @@ -25,13 +26,16 @@
<!-- Context: Textfield prompt (&#8230; is the ellipsis character "...") -->
<string name="textview_hint" comment="Prompt to start typing">Commencez à taper ici&#8230;</string>
<!-- Context: Splash screen (version/copyright info currently disabled -->
<string name="splash_blank" translatable="false" comment="Blank text while version info on splash page is disabled"></string>
<!-- Context: Splash screen (version/copyright info currently disabled -->
<!-- Context: Text Size dialog -->
<string name="text_size" comment="Current text size (number)">Taille du texte : %1$d</string>
<!-- Context: Text Size dialog -->
<string name="ic_text_size_up" comment="Make text bigger">Augmenter la taille du texte</string>
<!-- Context: Text Size dialog -->
<string name="ic_text_size_down" comment="Make text smaller">Diminuer la taille du texte</string>
<!-- Context: Text Size dialog -->
<string name="ic_text_size_slider" comment="Adjust text size">Text size slider</string>
<!-- Context: Clear Text dialog -->
<string name="all_text_will_be_cleared" comment="Erase all the text">\nTout le texte sera effacé\n</string>
<!-- Context: Get Started menu -->
Expand Down Expand Up @@ -82,7 +86,7 @@
<!-- Context: Keyman Settings menu / Spacebar caption hint -->
<string name="spacebar_caption_hint_blank" comment="Spacebar caption hint - blank">Ne pas afficher la légende sur la barre d\'espace</string>
<!-- Context: Keyman Settings menu / Haptic feedback -->
<string name="haptic_feedback" comment="haptic feedback on key press">Vibrate when typing</string>
<string name="haptic_feedback" comment="haptic feedback on key press">Vibrer lors de la saisie</string>
<!-- Context: Keyman Settings menu -->
<string name="show_banner" comment="text suggestions banner">Toujours afficher la bannière</string>
<!-- Context: Keyman Settings menu -->
Expand Down Expand Up @@ -154,7 +158,7 @@
<!-- Context: KMP Package strings -->
<string name="invalid_metadata" comment="kmp.json metadata file is invalid or missing in package">Métadonnées non valides/manquantes dans le package</string>
<!-- Context: KMP Package strings -->
<string name="minimum_keyboard_version_not_supported" comment="Notification when keyboard has functionality not supported by current Keyman"> Keyboard requires a newer version of Keyman</string>
<string name="minimum_keyboard_version_not_supported" comment="Notification when keyboard has functionality not supported by current Keyman"> Le clavier nécessite une version plus récente de Keyman</string>
<!-- Context: anywhere -->
<string name="unable_to_open_browser" comment="Notification when a browser activity cannot be launched">Unable to launch web browser</string>
<string name="unable_to_open_browser" comment="Notification when a browser activity cannot be launched">Impossible de lancer le navigateur web</string>
</resources>
12 changes: 6 additions & 6 deletions android/KMEA/app/src/main/res/values-fr-rFR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<!-- Context: Button label -->
<string name="label_update" comment="Dialog button to update a resource">Mise à jour</string>
<!-- Context: No internet for updates -->
<string name="no_internet_connection" comment="Internet connection missing">No internet connection</string>
<string name="no_internet_connection" comment="Internet connection missing">Aucune connexion internet</string>
<!-- Context: Keyboard Updates -->
<string name="cannot_connect" comment="Error message when network connection fails">Impossible de se connecter au serveur Keyman !</string>
<!-- Context: Keyboard Updates -->
Expand Down Expand Up @@ -84,7 +84,7 @@
<string name="fatal_keyboard_error_short" comment="Error in keyboard (keyboard ID::packageID for language)."> Erreur dans le clavier %1$s:%2$s pour la langue %3$s.</string>
<!-- Context: Query for associated dictionary -->
<string name="query_associated_model" comment="Check if there's an available dictionary to download">Vérification du dictionnaire associé à télécharger</string>
<string name="cannot_query_associated_model" comment="Cannot reach server to check if there's an available dictionary to download"> Cannot connect to Keyman server to check for associated dictionary to download</string>
<string name="cannot_query_associated_model" comment="Cannot reach server to check if there's an available dictionary to download"> Impossible de se connecter au serveur Keyman pour chercher un dictionnaire à télécharger</string>
<!-- Context: Model Updates -->
<string name="confirm_download_model" comment="Confirmation to download a dictionary update">Voulez-vous télécharger la dernière version de ce dictionnaire ?</string>
<!-- Context: No associated dictionary found -->
Expand Down Expand Up @@ -128,11 +128,11 @@
<!-- Context: Model Info -->
<string name="confirm_delete_model" comment="Confirmation to delete a dictionary">Voulez-vous supprimer ce dictionnaire ?</string>
<!-- Context: Model Deleted -->
<string name="model_deleted" comment="Notification when a dictionary is deleted">Dictionary deleted</string>
<string name="model_deleted" comment="Notification when a dictionary is deleted">Dictionnaire supprimé</string>
<!-- Context: Language Settings Keyboard install strings -->
<string name="keyboard_install_toast" comment="Notification when a keyboard is installed">Clavier %1$s installé</string>
<!-- Context: Language Settings Keyboard uninstall strings -->
<string name="keyboard_deleted_toast" comment="Notification when a keyboard is deleted">Keyboard deleted</string>
<string name="keyboard_deleted_toast" comment="Notification when a keyboard is deleted">Clavier supprimé</string>
<!-- Context: Language Settings menu strings -->
<string name="enable_corrections" comment="Enable corrections from the suggestion banner">Activer les corrections</string>
<!-- Context: Language Settings menu strings -->
Expand All @@ -145,7 +145,7 @@
</plurals>
<!-- Context: Language Settings menu substring - Check for available dictionary -->
<string name="check_available_model" comment="Check for available dictionary">Vérifier les dictionnaires disponibles</string>
<string name="check_model_online" comment="Check for dictionaries online">Check for dictionaries online</string>
<string name="check_model_online" comment="Check for dictionaries online">Obtenir des dictionnaires en ligne</string>
<!-- Context: Language Settings menu strings -->
<string name="model_info_header" comment="Dictionary name">Dictionnaire : %1$s</string>
<!-- Context: Language Settings menu strings -->
Expand All @@ -168,5 +168,5 @@
<!-- Context: Other strings -->
<string name="help_bubble_text">Appuyez ici pour changer de clavier</string>
<!-- Context: anywhere -->
<string name="unable_to_open_browser" comment="Notification when a browser activity cannot be launched">Unable to launch web browser</string>
<string name="unable_to_open_browser" comment="Notification when a browser activity cannot be launched">Impossible de lancer le navigateur web</string>
</resources>
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,20 @@ protected void onCreate(Bundle savedInstanceState) {
KMManager.KMDefault_KeyboardFont);
KMManager.addKeyboard(this, finalKBInfo);

// Issue #9469 Verify special characters in keyamnweb-osk.ttf keyboard
Keyboard specialKBInfo = new Keyboard(
"test9469",
"test9469",
"test9469 Keyboard",
"en",
"English",
"1.0",
"",
"",
true,
KMManager.KMDefault_KeyboardFont,
KMManager.KMDefault_KeyboardFont);
KMManager.addKeyboard(this, specialKBInfo);
}

@Override
Expand Down
2 changes: 2 additions & 0 deletions common/web/types/src/kmx/kmx-plus-builder/build-disp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { BUILDER_SECTION } from './builder-section.js';
*/
interface BUILDER_DISP_ITEM {
to: BUILDER_STR_REF;
id: BUILDER_STR_REF;
display: BUILDER_STR_REF;
};

Expand All @@ -38,6 +39,7 @@ export function build_disp(kmxplus: KMXPlusData, sect_strs: BUILDER_STRS): BUILD
for(let item of kmxplus.disp.disps) {
disp.items.push({
to: build_strs_index(sect_strs, item.to),
id: build_strs_index(sect_strs, item.id),
display: build_strs_index(sect_strs, item.display),
});
}
Expand Down
10 changes: 5 additions & 5 deletions common/web/types/src/kmx/kmx-plus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,10 @@ export class VarsItem extends Section {
export class UnicodeSetItem extends VarsItem {
constructor(id: string, value: string, sections: DependencySections, usetparser: UnicodeSetParser) {
super(id, value, sections);
// TODO-LDML: err on max buffer size
const needRanges = sections.usetparser.sizeUnicodeSet(value);
this.unicodeSet = sections.usetparser.parseUnicodeSet(value, needRanges);

// _unicodeSet may be null, indicating this is invalid.
// A message will have been set in that case.
if (needRanges >= 0) {
this.unicodeSet = sections.usetparser.parseUnicodeSet(value, needRanges);
} // otherwise: error (was recorded via callback)
}
unicodeSet?: UnicodeSet;
valid() : boolean {
Expand Down Expand Up @@ -420,6 +418,7 @@ export class Vkey extends Section {
// 'disp'
export class DispItem {
to: StrsItem;
id: StrsItem;
display: StrsItem;
};

Expand Down Expand Up @@ -671,6 +670,7 @@ export class KMXPlusFile extends KMXFile {
// 'disp'
this.COMP_PLUS_DISP_ITEM = new r.Struct({
to: STR_REF,
id: STR_REF,
display: STR_REF,
});

Expand Down
2 changes: 1 addition & 1 deletion common/web/types/src/ldml-keyboard/ldml-keyboard-xml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export interface LKDisplayOptions {
export interface LKDisplay {
to?: string;
display?: string;
id?: string; // TODO-LDML: This comes in a near-future CLDR update
id?: string;
};

export interface LKDisplays {
Expand Down
2 changes: 1 addition & 1 deletion core/include/ldml/keyboardprocessor_ldml.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
#define LDML_LENGTH_BKSP 0xC
#define LDML_LENGTH_BKSP_ITEM 0x10
#define LDML_LENGTH_DISP 0x10
#define LDML_LENGTH_DISP_ITEM 0x8
#define LDML_LENGTH_DISP_ITEM 0xC
#define LDML_LENGTH_ELEM 0xC
#define LDML_LENGTH_ELEM_ITEM 0x8
#define LDML_LENGTH_ELEM_ITEM_ELEMENT 0x8
Expand Down
2 changes: 1 addition & 1 deletion core/include/ldml/keyboardprocessor_ldml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class Constants {
/**
* Length of each entry in the 'disp' variable part
*/
readonly length_disp_item = 8;
readonly length_disp_item = 12;

/* ------------------------------------------------------------------
* elem section
Expand Down
63 changes: 61 additions & 2 deletions core/src/kmx/kmx_plus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "ldml/keyboardprocessor_ldml.h"

#include <assert.h>
#include "kmx_plus.h"

namespace km {
namespace kbp {
Expand Down Expand Up @@ -386,11 +387,35 @@ COMP_KMXPLUS_ELEM::getElementList(KMX_DWORD elementNumber, KMX_DWORD &length) co

std::u16string
COMP_KMXPLUS_ELEM_ELEMENT::get_element_string() const {
assert((flags & LDML_ELEM_FLAGS_TYPE) == LDML_ELEM_FLAGS_TYPE_CHAR); // should only be called on char
assert(type() == LDML_ELEM_FLAGS_TYPE_CHAR); // should only be called on char
return COMP_KMXPLUS_STRS::str_from_char(element);
}

// Note: shared with subclass COMP_KMXPLUS_BKSP
std::deque<std::u32string>
COMP_KMXPLUS_ELEM_ELEMENT::loadAsStringList(KMX_DWORD length, const COMP_KMXPLUS_STRS &strs) const {
std::deque<std::u32string> list;
for (KMX_DWORD i = 0; i<length; i++) {
const auto &o = this[i];
std::u32string str;
if (o.type() == LDML_ELEM_FLAGS_TYPE_STR) {
// fetch the string
const auto str16 = strs.get(o.element);
str = km::kbp::kmx::u16string_to_u32string(str16);
} else {
// single char
str = std::u32string(1, (km_kbp_usv)o.element);
}
list.emplace_back(str);
}
return list;
}

KMX_DWORD
COMP_KMXPLUS_ELEM_ELEMENT::type() const {
return (flags & LDML_ELEM_FLAGS_TYPE);
}

// Note: shared with subclass COMP_KMXPLUS_BKSP
bool
COMP_KMXPLUS_TRAN::valid(KMX_DWORD _kmn_unused(length)) const {
if (header.size < sizeof(*this) + (sizeof(COMP_KMXPLUS_TRAN_GROUP) * groupCount) +
Expand Down Expand Up @@ -503,6 +528,18 @@ COMP_KMXPLUS_TRAN_Helper::setTran(const COMP_KMXPLUS_TRAN *newTran) {
is_valid = false;
assert(is_valid);
}
for(KMX_DWORD t = 0; is_valid && t < group.count; t++) {
const auto &transform = transforms[group.index + t];
if (transform.from == 0) {
DebugLog("COMP_KMXPLUS_TRAN_Helper: transform [%d].[%d] has empty 'from' string", i, t);
is_valid = false;
assert(is_valid);
} else if ((transform.mapFrom == 0) != (transform.mapTo == 0)) {
DebugLog("COMP_KMXPLUS_TRAN_Helper: transform [%d].[%d] should have neither or both mapFrom=%d/mapTo=%d", i, t, transform.mapFrom, transform.mapTo);
is_valid = false;
assert(is_valid);
}
}
} else if (group.type == LDML_TRAN_GROUP_TYPE_REORDER) {
DebugLog(" .. type=reorder");
if ((group.index >= tran->reorderCount) || (group.index + group.count > tran->reorderCount)) {
Expand All @@ -511,6 +548,15 @@ COMP_KMXPLUS_TRAN_Helper::setTran(const COMP_KMXPLUS_TRAN *newTran) {
is_valid = false;
assert(is_valid);
}
for(KMX_DWORD t = 0; is_valid && t < group.count; t++) {
const auto &reorder = reorders[group.index + t];
if (reorder.elements == 0) {
DebugLog("COMP_KMXPLUS_TRAN_Helper: reorder [%d].[%d] has elements=0", i, t);
// TODO-LDML: is this an error?
// is_valid = false;
// assert(is_valid);
}
}
} else {
DebugLog(" .. type=illegal 0x%X", group.type);
is_valid = false;
Expand Down Expand Up @@ -1248,6 +1294,19 @@ COMP_KMXPLUS_VARS::valid(KMX_DWORD _kmn_unused(length)) const {
return true;
}

const COMP_KMXPLUS_VARS_ITEM *COMP_KMXPLUS_VARS::findByStringId(KMX_DWORD strId) const {
if (strId == 0) {
return nullptr;
}
for (KMX_DWORD index = 0; index < varCount; index++) {
if (varEntries[index].id == strId) {
return &(varEntries[index]);
}
}
return nullptr;
}



} // namespace kmx
} // namespace kbp
Expand Down
Loading

0 comments on commit 6ba5fb4

Please sign in to comment.