diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
commit | a90a5cba08fdf6c0ceb95101c275108a152a3aed (patch) | |
tree | 532507288f3defd7f4dcf1af49698bcb76034855 /mobile/android/modules/geckoview/GeckoViewTranslations.sys.mjs | |
parent | Adding debian version 126.0.1-1. (diff) | |
download | firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mobile/android/modules/geckoview/GeckoViewTranslations.sys.mjs')
-rw-r--r-- | mobile/android/modules/geckoview/GeckoViewTranslations.sys.mjs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/mobile/android/modules/geckoview/GeckoViewTranslations.sys.mjs b/mobile/android/modules/geckoview/GeckoViewTranslations.sys.mjs index 7e74e7bf30..45b43ac9f9 100644 --- a/mobile/android/modules/geckoview/GeckoViewTranslations.sys.mjs +++ b/mobile/android/modules/geckoview/GeckoViewTranslations.sys.mjs @@ -50,8 +50,11 @@ export class GeckoViewTranslations extends GeckoViewModule { aData.toLanguage ); try { - this.getActor("Translations").translate(fromLanguage, toLanguage); - aCallback.onSuccess(); + this.getActor("Translations") + .translate(fromLanguage, toLanguage) + .then(() => { + aCallback.onSuccess(); + }); } catch (error) { aCallback.onError(`Could not translate: ${error}`); } @@ -101,10 +104,11 @@ export class GeckoViewTranslations extends GeckoViewModule { type: "GeckoView:Translations:Offer", }); break; - case "TranslationsParent:LanguageState": + case "TranslationsParent:LanguageState": { const { detectedLanguages, requestedTranslationPair, + hasVisibleChange, error, isEngineReady, } = aEvent.detail.actor.languageState; @@ -112,6 +116,7 @@ export class GeckoViewTranslations extends GeckoViewModule { const data = { detectedLanguages, requestedTranslationPair, + hasVisibleChange, error, isEngineReady, }; @@ -120,7 +125,9 @@ export class GeckoViewTranslations extends GeckoViewModule { type: "GeckoView:Translations:StateChange", data, }); + break; + } } } } |