chore: auto detect -> suggest
This commit is contained in:
parent
558867dac5
commit
636cbee66b
2 changed files with 21 additions and 13 deletions
|
@ -1015,7 +1015,6 @@ speed: "Speed"
|
|||
slow: "Slow"
|
||||
fast: "Fast"
|
||||
sensitiveMediaDetection: "Detection of NSFW media"
|
||||
autoDetect: "Auto detect"
|
||||
localOnly: "Local only"
|
||||
remoteOnly: "Remote only"
|
||||
failedToUpload: "Upload failed"
|
||||
|
|
|
@ -709,19 +709,28 @@ function setVisibility() {
|
|||
}
|
||||
|
||||
function setLanguage() {
|
||||
const actions: Array<MenuItem> = [
|
||||
const actions: Array<MenuItem> = [];
|
||||
|
||||
const detectedLanguage = detectLanguage(text.value);
|
||||
if (
|
||||
detectedLanguage !== "" &&
|
||||
detectedLanguage != null &&
|
||||
detectedLanguage !== language.value
|
||||
)
|
||||
actions.push(
|
||||
{
|
||||
text: i18n.ts.autoDetect,
|
||||
text: langmap[detectedLanguage].nativeName,
|
||||
danger: false,
|
||||
active: false,
|
||||
icon: `${icon("ph-magic-wand")}`,
|
||||
icon: `${icon("ph-list-magnifying-glass")}`,
|
||||
action: () => {
|
||||
language.value = detectLanguage(text.value) ?? language.value;
|
||||
language.value = detectedLanguage;
|
||||
},
|
||||
},
|
||||
null,
|
||||
];
|
||||
if (language.value)
|
||||
);
|
||||
|
||||
if (language.value != null)
|
||||
actions.push({
|
||||
text: langmap[language.value].nativeName,
|
||||
danger: false,
|
||||
|
|
Loading…
Reference in a new issue