Use on-device translation on mobile when available (#9930)

Co-authored-by: Samuel Newman <mozzius@protonmail.com>
This commit is contained in:
DS Boyce
2026-02-27 16:59:19 -08:00
committed by GitHub
parent 7c9f05a2af
commit 9bbcb472ef
17 changed files with 4620 additions and 608 deletions
+6 -2
View File
@@ -127,8 +127,12 @@ export function isPostInLanguage(
return bcp47Match.basicFilter(lang, targetLangs).length > 0
}
export function getTranslatorLink(text: string, lang: string): string {
return `https://translate.google.com/?sl=auto&tl=${lang}&text=${encodeURIComponent(
export function getTranslatorLink(
text: string,
targetLangCode: string,
sourceLanguage?: string,
): string {
return `https://translate.google.com/?sl=${sourceLanguage ?? 'auto'}&tl=${targetLangCode}&text=${encodeURIComponent(
text,
)}`
}
+4011 -498
View File
File diff suppressed because it is too large Load Diff