From: Jay Sitter Date: Wed, 28 Jun 2023 12:42:55 +0000 (-0400) Subject: Revert #1463, markdown default lang select X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/%22%7B%7D/%22https:/nerdica.net/%7Bthis.getImage%28%29%7D?a=commitdiff_plain;h=7be10eb35bf2e276adf8f68f1fdd7a5c80e50bd8;p=lemmy-ui.git Revert #1463, markdown default lang select --- 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; -}