encountered weird network error.

This commit is contained in:
Jordan
2025-03-17 06:56:05 -07:00
parent e61fb43ee3
commit 0ba5c4b309
7 changed files with 40 additions and 557 deletions

View File

@ -115,13 +115,13 @@ export class Translator {
console.log(data);
return data.translatedText;
} else {
console.error(data);
console.error("Status %d: %s", res.status, JSON.stringify(data));
}
}
static async getDefault(defaultTarget: string | undefined = undefined) {
const settings = await Settings.getDefault();
const source = await settings.getHostLanguage();
const source = await settings.getHostLanguage() || "en";
return new Translator(
source,
defaultTarget,