diff --git a/locales/en-US.yml b/locales/en-US.yml index 9e9c36deb1..e9bf164a1b 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -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" diff --git a/packages/client/src/components/MkPostForm.vue b/packages/client/src/components/MkPostForm.vue index da1c665c61..3e666ee227 100644 --- a/packages/client/src/components/MkPostForm.vue +++ b/packages/client/src/components/MkPostForm.vue @@ -709,19 +709,28 @@ function setVisibility() { } function setLanguage() { - const actions: Array = [ - { - text: i18n.ts.autoDetect, - danger: false, - active: false, - icon: `${icon("ph-magic-wand")}`, - action: () => { - language.value = detectLanguage(text.value) ?? language.value; + const actions: Array = []; + + const detectedLanguage = detectLanguage(text.value); + if ( + detectedLanguage !== "" && + detectedLanguage != null && + detectedLanguage !== language.value + ) + actions.push( + { + text: langmap[detectedLanguage].nativeName, + danger: false, + active: false, + icon: `${icon("ph-list-magnifying-glass")}`, + action: () => { + language.value = detectedLanguage; + }, }, - }, - null, - ]; - if (language.value) + null, + ); + + if (language.value != null) actions.push({ text: langmap[language.value].nativeName, danger: false,