Use on-device translation on mobile when available (#9930)
Co-authored-by: Samuel Newman <mozzius@protonmail.com>
This commit is contained in:
@@ -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
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user