summaryrefslogtreecommitdiffstats
path: root/toolkit/components/translations/translations.d.ts
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
commit8dd16259287f58f9273002717ec4d27e97127719 (patch)
tree3863e62a53829a84037444beab3abd4ed9dfc7d0 /toolkit/components/translations/translations.d.ts
parentReleasing progress-linux version 126.0.1-1~progress7.99u1. (diff)
downloadfirefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz
firefox-8dd16259287f58f9273002717ec4d27e97127719.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/translations/translations.d.ts')
-rw-r--r--toolkit/components/translations/translations.d.ts19
1 files changed, 19 insertions, 0 deletions
diff --git a/toolkit/components/translations/translations.d.ts b/toolkit/components/translations/translations.d.ts
index 9823f6a845..c3fcf7ab63 100644
--- a/toolkit/components/translations/translations.d.ts
+++ b/toolkit/components/translations/translations.d.ts
@@ -271,8 +271,27 @@ export interface SupportedLanguages {
export type TranslationErrors = "engine-load-error";
export type SelectTranslationsPanelState =
+ // The panel is closed.
| { phase: "closed"; }
+
+ // The panel is idle after successful initialization and ready to attempt translation.
| { phase: "idle"; fromLanguage: string; toLanguage: string, sourceText: string, }
+
+ // The language dropdown menus failed to populate upon opening the panel.
+ // This state contains all of the information for the try-again button to close and re-open the panel.
+ | { phase: "init-failure"; event: Event, screenX: number, screenY: number, sourceText: string, langPairPromise: Promise<{fromLang?: string, toLang?: string}> }
+
+ // The translation failed to complete.
+ | { phase: "translation-failure"; fromLanguage: string; toLanguage: string, sourceText: string, }
+
+ // The selected language pair is determined to be translatable.
| { phase: "translatable"; fromLanguage: string; toLanguage: string, sourceText: string, }
+
+ // The panel is actively translating the source text.
| { phase: "translating"; fromLanguage: string; toLanguage: string, sourceText: string, }
+
+ // The source text has been translated successfully.
| { phase: "translated"; fromLanguage: string; toLanguage: string, sourceText: string, translatedText: string, }
+
+ // The source language is not currently supported by Translations in Firefox.
+ | { phase: "unsupported"; detectedLanguage: string; toLanguage: string, sourceText: string }