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"
|
slow: "Slow"
|
||||||
fast: "Fast"
|
fast: "Fast"
|
||||||
sensitiveMediaDetection: "Detection of NSFW media"
|
sensitiveMediaDetection: "Detection of NSFW media"
|
||||||
autoDetect: "Auto detect"
|
|
||||||
localOnly: "Local only"
|
localOnly: "Local only"
|
||||||
remoteOnly: "Remote only"
|
remoteOnly: "Remote only"
|
||||||
failedToUpload: "Upload failed"
|
failedToUpload: "Upload failed"
|
||||||
|
|
|
@ -709,19 +709,28 @@ function setVisibility() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function setLanguage() {
|
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,
|
danger: false,
|
||||||
active: false,
|
active: false,
|
||||||
icon: `${icon("ph-magic-wand")}`,
|
icon: `${icon("ph-list-magnifying-glass")}`,
|
||||||
action: () => {
|
action: () => {
|
||||||
language.value = detectLanguage(text.value) ?? language.value;
|
language.value = detectedLanguage;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
null,
|
null,
|
||||||
];
|
);
|
||||||
if (language.value)
|
|
||||||
|
if (language.value != null)
|
||||||
actions.push({
|
actions.push({
|
||||||
text: langmap[language.value].nativeName,
|
text: langmap[language.value].nativeName,
|
||||||
danger: false,
|
danger: false,
|
||||||
|
|
Loading…
Reference in a new issue