Skip to content

Commit

Permalink
Merge pull request #12768 from keymanapp/fix/developer/12765-improve-…
Browse files Browse the repository at this point in the history
…hint-for-non-matching-script

fix(developer): honour provided script when checking for matching scripts
  • Loading branch information
mcdurdin authored Dec 4, 2024
2 parents 4ddcfc9 + 148938e commit 0eea6b4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions developer/src/kmc-keyboard-info/src/keyboard-info-compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -575,11 +575,12 @@ export class KeyboardInfoCompiler implements KeymanCompiler {
''
);

const resolvedScript = locale.script ?? langtagsByTag[bcp47]?.script ?? langtagsByTag[locale.language]?.script ?? undefined;
if(commonScript === null) {
commonScript = tag?.script ?? undefined;
commonScript = resolvedScript;
} else {
if(tag?.script !== commonScript) {
this.callbacks.reportMessage(KeyboardInfoCompilerMessages.Hint_ScriptDoesNotMatch({commonScript, bcp47, script: tag?.script}))
if(resolvedScript !== commonScript) {
this.callbacks.reportMessage(KeyboardInfoCompilerMessages.Hint_ScriptDoesNotMatch({commonScript, bcp47, script: resolvedScript}))
}
}
}
Expand Down

0 comments on commit 0eea6b4

Please sign in to comment.