Skip to content

Commit

Permalink
... Merge branch 'master' into chore/mac/mcompile_mac-CommonMesonPatt…
Browse files Browse the repository at this point in the history
…erns
  • Loading branch information
SabineSIL committed Oct 10, 2024
2 parents 5e93570 + 71a1b6c commit b0006ba
Show file tree
Hide file tree
Showing 1,427 changed files with 26,836 additions and 3,249 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/api-verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ jobs:

- name: "Verify API for libkeymancore*.so (${{ steps.environment_step.outputs.GIT_BRANCH }}, branch ${{ steps.environment_step.outputs.GIT_BASE_BRANCH }}, by ${{ steps.environment_step.outputs.GIT_USER }})"
run: |
echo "Verify API for libkeymancore*.so (${{ steps.environment_step.outputs.GIT_BRANCH }}, branch ${{ steps.environment_step.outputs.GIT_BASE_BRANCH }}, by ${{ steps.environment_step.outputs.GIT_USER }})" >> $GITHUB_STEP_SUMMARY
BIN_PACKAGE=$(ls "${GITHUB_WORKSPACE}/artifacts/" | grep "${PKG_NAME}[0-9]*_${{ steps.environment_step.outputs.VERSION }}-1${{ steps.environment_step.outputs.PRERELEASE_TAG }}+$(lsb_release -c -s)1_amd64.deb")
cd ${{ github.workspace }}/keyman/linux
./scripts/deb-packaging.sh \
Expand All @@ -93,19 +95,19 @@ jobs:
if: needs.api_verification.result == 'success'
run: |
echo "RESULT=success" >> $GITHUB_ENV
echo "MSG=Package build succeeded" >> $GITHUB_ENV
echo "MSG=API verification succeeded" >> $GITHUB_ENV
- name: Set cancelled
if: needs.api_verification.result == 'cancelled'
run: |
echo "RESULT=error" >> $GITHUB_ENV
echo "MSG=Package build cancelled" >> $GITHUB_ENV
echo "MSG=API verification cancelled" >> $GITHUB_ENV
- name: Set failure
if: needs.api_verification.result == 'failure'
run: |
echo "RESULT=failure" >> $GITHUB_ENV
echo "MSG=Package build failed" >> $GITHUB_ENV
echo "MSG=API verification failed" >> $GITHUB_ENV
- name: Set final status
run: |
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,6 @@ lcov.info
/keyman*.buildinfo
/keyman*.changes
/keyman*.tar.?z

# flag file for build script
.configured
84 changes: 84 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,89 @@
# Keyman Version History

## 18.0.124 alpha 2024-10-09

* chore(common): fix links in minimum-versions.md (#12507)
* fix(developer): use richedit in debug memo to support Egyptian cartouches (#12464)
* feat(android): Add controls for auto-correct (#12443)

## 18.0.123 alpha 2024-10-08

* chore(developer,common): deps: replace xml2js with fast-xml-parser (#12502)
* chore(ios): renew certificate (#12512)

## 18.0.122 alpha 2024-10-07

* feat(mac): both option keys generate right alt if no left alt mapping (#12458)
* chore(common): improve configuration detection for hextobin (#12481)

## 18.0.121 alpha 2024-10-03

* docs(developer): Fix image links in help (#12488)
* fix(oem/fv): Update keyboard versions and names for fv_all.kmp 13.1 (#12486)
* feat(common): unified XML parser/writer (#12482)

## 18.0.120 alpha 2024-10-02

* chore(common): Add note on troubleshooting website errors (#12487)
* docs(common): mention `KEYMAN_USE_NVM` in minimum versions doc (#12490)
* docs(web): fix paths to several help pages (#12491)
* docs(web): fix structure of test document (#12492)

## 18.0.119 alpha 2024-09-28

* refactor(developer): copy dev 17.0 help into repo (#12427)
* fix(developer): warn before importing over touch layout (#12478)
* chore(linux): display branch name with API verification (#12480)
* docs(core): Update kmx-plus-file-format.md (#12479)

## 18.0.118 alpha 2024-09-26

* chore(developer): add context/options (#11566)
* chore(deps-dev): bump rollup from 4.16.4 to 4.22.4 (#12462)
* fix(developer): ignore excess whitespace in `<row keys>` attribute (#12468)
* refactor(common): move help into common prod/docs/help folders (#12424)
* fix(developer): publish developer-utils package during build (#12471)
* fix(linux): ignore additional C++ symbol in API check (#12474)

## 18.0.117 alpha 2024-09-25

* docs(common): Document how to skip generating CDN on websites (#12446)
* fix(android): Remove toggle for "Always Show Banner" (#12430)
* fix(android): Hide suggestion banner on password fields (#12442)
* fix(developer): prevent invalid string ids (#12465)

## 18.0.116 alpha 2024-09-20

* change(mac): remove verbose logging option (#12431)
* chore(common): Allow to build offline (#12439)

## 18.0.115 alpha 2024-09-19

* chore(common): detect ssh remotes in git hooks (#12437)
* fix(common): add proper configure output for hextobin (#12440)
* fix(core): add missing dependency for core (#12438)
* chore(developer): remove .js output from LDML compiler (#12432)

## 18.0.114 alpha 2024-09-17

* fix(developer): rewrite ldml visual keyboard compiler (#12402)
* fix(developer): check vars string usage before definition (#12404)
* change(mac): remove 'Always show OSK' option (#12355)

## 18.0.113 alpha 2024-09-16

* test(developer): kmcmplib compiler unit tests 3 (#11990)

## 18.0.112 alpha 2024-09-14

* chore(deps): bump express from 4.19.2 to 4.20.0 (#12396)

## 18.0.111 alpha 2024-09-13

* chore(common): Update crowdin strings for Italian (#12408)
* fix(common): correct offsets in KMX+ spec (#12350)
* fix(android): Add gating to setLongpressDelay() (#12410)

## 18.0.110 alpha 2024-09-12

* chore(common): Update to Unicode 16.0 (#12393)
Expand Down
2 changes: 1 addition & 1 deletion VERSION.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.0.111
18.0.125
4 changes: 2 additions & 2 deletions android/KMAPro/build-play-store-notes.inc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ function generateReleaseNotes() {
# Pad release notes if whatsnew.md doesn't have any line items
# Play Store release notes have a limit of 500 characters
local DEFAULT_RELEASE_NOTE="* Additional bug fixes and improvements"
local FILTERED_LINES=$( grep '^\s*\*.*$' "$KEYMAN_ROOT/android/help/about/whatsnew.md" || [[ $? == 1 ]] ) # Continue if grep has no matches
local FILTERED_LINES=$( grep '^\s*\*.*$' "$KEYMAN_ROOT/android/docs/help/about/whatsnew.md" || [[ $? == 1 ]] ) # Continue if grep has no matches
if [ -z "$FILTERED_LINES" ]; then
FILTERED_LINES="$DEFAULT_RELEASE_NOTE"
builder_warn "Warning: whatsnew.md empty so using default release note: '$FILTERED_LINES'"
fi

# Change IFS to new line
local old_IFS="${IFS}"
IFS=$'\n'
IFS=$'\n'
for line in $FILTERED_LINES
do
local CHARS_IN_RELEASE_NOTES=$( wc -m < "$PLAY_RELEASE_NOTES" )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.keyman.engine.KMManager;
import com.keyman.engine.KMManager.KeyboardType;
import com.keyman.engine.KMHardwareKeyboardInterpreter;
import com.keyman.engine.KMManager.SuggestionType;
import com.keyman.engine.KeyboardEventHandler.OnKeyboardEventListener;
import com.keyman.engine.R;
import com.keyman.engine.data.Keyboard;
Expand Down Expand Up @@ -169,8 +170,9 @@ public void onStartInput(EditorInfo attribute, boolean restarting) {
if (kbInfo != null) {
String langId = kbInfo.getLanguageID();
SharedPreferences prefs = appContext.getSharedPreferences(appContext.getString(R.string.kma_prefs_name), Context.MODE_PRIVATE);
boolean mayPredict = prefs.getBoolean(KMManager.getLanguagePredictionPreferenceKey(langId), true);
KMManager.setBannerOptions(mayPredict);
int maySuggest = prefs.getInt(KMManager.getLanguageAutoCorrectionPreferenceKey(langId), KMManager.KMDefault_Suggestion);
// Enable banner if maySuggest is not SuggestionType.SUGGESTIONS_DISABLED (0)
KMManager.setBannerOptions(maySuggest != SuggestionType.SUGGESTIONS_DISABLED.toInt());
} else {
KMManager.setBannerOptions(false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
public class KeymanSettingsActivity extends BaseActivity {
protected static final String installedLanguagesKey = "InstalledLanguages";
protected static final String installKeyboardOrDictionaryKey = "InstallKeyboardOrDictionary";
protected static final String showBannerKey = "ShowBanner";
protected static final String sendCrashReport = "SendCrashReport";
public static final String spacebarTextKey = "SpacebarText";
public static final String hapticFeedbackKey = "HapticFeedback";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,6 @@ public boolean onPreferenceChange(Preference preference, Object newValue) {
editor.putBoolean(KeymanSettingsActivity.showBannerKey, isChecked);
as part of the default onClick() used by SwitchPreference.
*/
SwitchPreference bannerPreference = new SwitchPreference(context);
bannerPreference.setKey(KeymanSettingsActivity.showBannerKey);
bannerPreference.setTitle(getString(R.string.show_banner));
bannerPreference.setSummaryOn(getString(R.string.show_banner_on));
bannerPreference.setSummaryOff(getString(R.string.show_banner_off));

SwitchPreference getStartedPreference = new SwitchPreference(context);
getStartedPreference.setKey(GetStartedActivity.showGetStartedKey);
getStartedPreference.setTitle(String.format(getString(R.string.show_get_started), getString(R.string.get_started)));
Expand All @@ -207,7 +201,6 @@ as part of the default onClick() used by SwitchPreference.
screen.addPreference(spacebarTextPreference);

screen.addPreference(hapticFeedbackPreference);
screen.addPreference(bannerPreference);
screen.addPreference(getStartedPreference);
screen.addPreference(sendCrashReportPreference);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.RadioGroup.OnCheckedChangeListener;
import android.widget.RelativeLayout;
import android.widget.TextView;

import androidx.annotation.IdRes;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
Expand Down Expand Up @@ -55,50 +59,6 @@ public final class LanguageSettingsActivity extends AppCompatActivity {

private final static String TAG = "LanguageSettingsAct";

private class PreferenceToggleListener implements View.OnClickListener {
String prefsKey;
String lgCode;

public PreferenceToggleListener(String prefsKey, String lgCode) {
this.prefsKey = prefsKey;
this.lgCode = lgCode;
}

@Override
public void onClick(View v) {
// For predictions/corrections toggle
SwitchCompat toggle = (SwitchCompat) v;

SharedPreferences.Editor prefEditor = prefs.edit();

// predictionsToggle overrides correctionToggle and correctionsTextView
if (prefsKey.endsWith(KMManager.predictionPrefSuffix)) {
boolean override = toggle.isChecked();
overrideCorrectionsToggle(override);
}

// This will allow preemptively making settings for languages without models.
// Seems more trouble than it's worth to block this.
prefEditor.putBoolean(prefsKey, toggle.isChecked());
prefEditor.apply();

// Don't use/apply language modeling settings for languages without models.
if (associatedLexicalModel.isEmpty()) {
return;
}

Keyboard kbInfo = KMManager.getCurrentKeyboardInfo(context);
if(kbInfo != null) {
// If the active keyboard is for this language, immediately enact the new pref setting.
String kbdLgCode = kbInfo.getLanguageID();
if (kbdLgCode.equals(lgCode)) {
// Not only registers the model but also applies our modeling preferences.
KMManager.registerAssociatedLexicalModel(lgCode);
}
}
}
}

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand Down Expand Up @@ -139,33 +99,48 @@ public void onCreate(Bundle savedInstanceState) {

FilteredKeyboardsAdapter adapter = new FilteredKeyboardsAdapter(context, KeyboardPickerActivity.getInstalledDataset(context), lgCode);

// The following two layouts/toggles will need to link with these objects.
// The following radio group will need to link with these objects.
Context appContext = this.getApplicationContext();
prefs = appContext.getSharedPreferences(appContext.getString(R.string.kma_prefs_name), Context.MODE_PRIVATE);
boolean mayPredict = prefs.getBoolean(KMManager.getLanguagePredictionPreferenceKey(lgCode), true);
boolean mayCorrect = prefs.getBoolean(KMManager.getLanguageCorrectionPreferenceKey(lgCode), true);

RelativeLayout layout = (RelativeLayout)findViewById(R.id.corrections_toggle);
int maySuggest = prefs.getInt(KMManager.getLanguageAutoCorrectionPreferenceKey(lgCode), KMManager.KMDefault_Suggestion);

correctionsTextView = (TextView) layout.findViewById(R.id.text1);
correctionsTextView.setText(getString(R.string.enable_corrections));
correctionsToggle = layout.findViewById(R.id.toggle);
correctionsToggle.setChecked(mayCorrect); // Link to persistent option storage! Also needs handler.
String prefsKey = KMManager.getLanguageCorrectionPreferenceKey(lgCode);
correctionsToggle.setOnClickListener(new PreferenceToggleListener(prefsKey, lgCode));
// Initialize Radio button group change listeners
RadioGroup radioGroup = (RadioGroup) findViewById(R.id.suggestion_radio_group);
radioGroup.clearCheck();

layout = (RelativeLayout)findViewById(R.id.predictions_toggle);
int[] RadioButtonArray = {
R.id.suggestion_radio_0,
R.id.suggestion_radio_1,
R.id.suggestion_radio_2,
R.id.suggestion_radio_3};
RadioButton radioButton = (RadioButton)radioGroup.findViewById(RadioButtonArray[maySuggest]);
radioButton.setChecked(true);

textView = (TextView) layout.findViewById(R.id.text1);
textView.setText(getString(R.string.enable_predictions));
SwitchCompat predictionsToggle = layout.findViewById(R.id.toggle);
predictionsToggle.setChecked(mayPredict); // Link to persistent option storage! Also needs handler.
prefsKey = KMManager.getLanguagePredictionPreferenceKey(lgCode);
predictionsToggle.setOnClickListener(new PreferenceToggleListener(prefsKey, lgCode));
radioGroup.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, @IdRes int checkId) {
RadioButton checkedButton = (RadioButton)radioGroup.findViewById(checkId);
int index = radioGroup.indexOfChild(checkedButton);
KMManager.setMaySuggest(lgCode, KMManager.SuggestionType.fromInt(index));

// Don't use/apply language modeling settings for languages without models.
if (associatedLexicalModel.isEmpty()) {
return;
}

overrideCorrectionsToggle(mayPredict);
Keyboard kbInfo = KMManager.getCurrentKeyboardInfo(context);
if(kbInfo != null) {
// If the active keyboard is for this language, immediately enact the new pref setting.
String kbdLgCode = kbInfo.getLanguageID();
if (kbdLgCode.equals(lgCode)) {
// Not only registers the model but also applies our modeling preferences.
KMManager.registerAssociatedLexicalModel(lgCode);
}
}
}
});

layout = (RelativeLayout)findViewById(R.id.model_picker);
RelativeLayout layout = (RelativeLayout)findViewById(R.id.model_picker);
textView = (TextView) layout.findViewById(R.id.text1);
textView.setText(getString(R.string.model_label));

Expand Down
6 changes: 3 additions & 3 deletions android/KMAPro/kMAPro/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,13 @@
<!-- Context: Keyman Settings menu / Haptic feedback -->
<string name="haptic_feedback" comment="haptic feedback on key press">Vibrate when typing</string>

<!-- Context: Keyman Settings menu -->
<!-- Context: Keyman Settings menu. Removed in Keyman 18 -->
<string name="show_banner" comment="text suggestions banner">Always show banner</string>

<!-- Context: Keyman Settings menu -->
<!-- Context: Keyman Settings menu. Removed in Keyman 18 -->
<string name="show_banner_on" comment="Description when toggle is on">To be implemented</string>

<!-- Context: Keyman Settings menu -->
<!-- Context: Keyman Settings menu. Removed in Keyman 18 -->
<string name="show_banner_off" comment="Description when toggle is off">When off, only shown when predictive text is enabled</string>

<!-- Context: Keyman Settings menu -->
Expand Down
18 changes: 15 additions & 3 deletions android/KMEA/app/src/main/assets/android-host.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,23 @@ function deregisterModel(modelID) {
keyman.removeModel(modelID);
}

function enableSuggestions(model, mayPredict, mayCorrect) {
function enableSuggestions(model, suggestionType) {
// Set the options first so that KMW's ModelManager can properly handle model enablement states
// the moment we actually register the new model.
keyman.core.languageProcessor.mayPredict = mayPredict;
keyman.core.languageProcessor.mayCorrect = mayCorrect;
// Use console_debug
console_debug('enableSuggestions(model, maySuggest='+suggestionType+')');
const suggestionSettings = [
// mayPredict, mayCorrect, mayAutoCorrect
[false, false, false], // 0 = SuggestionType.SUGGESTIONS_DISABLED
[true, false, false], // 1 = SuggestionType.PREDICTIONS_ONLY
[true, true, false], // 2 = SuggestionType.PREDICTIONS_WITH_CORRECTIONS
[true, true, true], // 3 = SuggestionType.PREDICTIONS_WITH_AUTO_CORRECT
];
const t = suggestionSettings[suggestionType]
? suggestionSettings[suggestionType] : suggestionSettings[0];
keyman.core.languageProcessor.mayPredict = t[0];
keyman.core.languageProcessor.maySuggest = t[1];
// keyman.core.languageProcessor.mayAutoCorrect = t[2];

registerModel(model);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.keyman.engine.KeyboardEventHandler.EventType;
import com.keyman.engine.KMManager;
import com.keyman.engine.KMManager.KeyboardType;
import com.keyman.engine.KMManager.SuggestionType;
import com.keyman.engine.util.KMLog;
import com.keyman.engine.data.Keyboard;

Expand Down Expand Up @@ -164,8 +165,10 @@ public boolean shouldOverrideUrlLoading(WebView view, String url) {
// appContext instead of context?
SharedPreferences prefs = context.getSharedPreferences(context.getString(R.string.kma_prefs_name), Context.MODE_PRIVATE);
boolean modelPredictionPref = false;
if (KMManager.currentLexicalModel != null) {
modelPredictionPref = prefs.getBoolean(KMManager.getLanguagePredictionPreferenceKey(KMManager.currentLexicalModel.get(KMManager.KMKey_LanguageID)), true);
if (!KMManager.getMayPredictOverride() && KMManager.currentLexicalModel != null) {
modelPredictionPref = prefs.getInt(KMManager.getLanguageAutoCorrectionPreferenceKey(
KMManager.currentLexicalModel.get(KMManager.KMKey_LanguageID)), KMManager.KMDefault_Suggestion)
!= SuggestionType.SUGGESTIONS_DISABLED.toInt();
}
KMManager.setBannerOptions(modelPredictionPref);
RelativeLayout.LayoutParams params = KMManager.getKeyboardLayoutParams();
Expand Down
Loading

0 comments on commit b0006ba

Please sign in to comment.