From 7be10eb35bf2e276adf8f68f1fdd7a5c80e50bd8 Mon Sep 17 00:00:00 2001 From: Jay Sitter Date: Wed, 28 Jun 2023 08:42:55 -0400 Subject: [PATCH] Revert #1463, markdown default lang select --- src/shared/components/comment/comment-form.tsx | 4 ---- .../components/common/language-select.tsx | 2 +- .../components/common/markdown-textarea.tsx | 6 +----- src/shared/components/post/post-form.tsx | 8 ++++---- src/shared/utils/app/index.ts | 2 -- .../utils/app/user-interface-language.ts | 18 ------------------ 6 files changed, 6 insertions(+), 34 deletions(-) delete mode 100644 src/shared/utils/app/user-interface-language.ts diff --git a/src/shared/components/comment/comment-form.tsx b/src/shared/components/comment/comment-form.tsx index c9937c6..294960a 100644 --- a/src/shared/components/comment/comment-form.tsx +++ b/src/shared/components/comment/comment-form.tsx @@ -1,5 +1,4 @@ import { myAuthRequired } from "@utils/app"; -import getUserInterfaceLangId from "@utils/app/user-interface-language"; import { capitalizeFirstLetter } from "@utils/helpers"; import { Component } from "inferno"; import { T } from "inferno-i18next-dess"; @@ -41,8 +40,6 @@ export class CommentForm extends Component { : undefined : undefined; - const userInterfaceLangId = getUserInterfaceLangId(this.props.allLanguages); - return (
{ {UserService.Instance.myUserInfo ? ( { return this.props.iconVersion ? ( this.selectBtn ) : ( -
+
diff --git a/src/shared/utils/app/index.ts b/src/shared/utils/app/index.ts index 12cf1ea..b2b0baa 100644 --- a/src/shared/utils/app/index.ts +++ b/src/shared/utils/app/index.ts @@ -54,7 +54,6 @@ import showScores from "./show-scores"; import siteBannerCss from "./site-banner-css"; import updateCommunityBlock from "./update-community-block"; import updatePersonBlock from "./update-person-block"; -import getUserInterfaceLangId from "./user-interface-language"; export { buildCommentsTree, @@ -90,7 +89,6 @@ export { getRecipientIdFromProps, getRoleLabelPill, getUpdatedSearchId, - getUserInterfaceLangId, initializeSite, insertCommentIntoTree, isAuthPath, diff --git a/src/shared/utils/app/user-interface-language.ts b/src/shared/utils/app/user-interface-language.ts deleted file mode 100644 index ff2e439..0000000 --- a/src/shared/utils/app/user-interface-language.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Language } from "lemmy-js-client"; -import { I18NextService } from "../../services/I18NextService"; - -export default function getUserInterfaceLangId( - allLanguages: Language[] -): number { - // Get the string of the browser- or user-defined language, like en-US - const i18nLang = I18NextService.i18n.language; - - // Find the Language object with a code that matches the initial characters of - // this string - const userLang = allLanguages.find(lang => { - return i18nLang.indexOf(lang.code) === 0; - }); - - // Return the ID of that language object, or "0" for Undetermined - return userLang?.id || 0; -} -- 2.44.1