]> Untitled Git - lemmy-ui.git/commitdiff
Show language on posts and comments (#1026)
authorSleeplessOne1917 <abias1122@gmail.com>
Sun, 21 May 2023 18:13:25 +0000 (18:13 +0000)
committerGitHub <noreply@github.com>
Sun, 21 May 2023 18:13:25 +0000 (14:13 -0400)
* Show language on posts and comments

* Revert "Show language on posts and comments"

This reverts commit 54267903fc6941762030ec20daa048d47662d50d.

* Change language indicator look

src/shared/components/comment/comment-node.tsx
src/shared/components/post/post-listing.tsx

index d68c5b30695a29bd8ab1c337b2a3eab3d45461c4..16e0a731640f017e235c0ed9ae83e6138e5a4f7a 100644 (file)
@@ -282,8 +282,15 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
                 )}
               </button>
               {this.linkBtn(true)}
+              <span className="mx-1 badge badge-secondary">
+                {
+                  this.props.allLanguages.find(
+                    lang => lang.id === cv.comment.language_id
+                  )?.name
+                }
+              </span>
               {/* This is an expanding spacer for mobile */}
-              <div className="mr-lg-5 flex-grow-1 flex-lg-grow-0 unselectable pointer mx-2"></div>
+              <div className="mr-lg-5 flex-grow-1 flex-lg-grow-0 unselectable pointer mx-2" />
               {showScores() && (
                 <>
                   <a
index 1096b73eab43fd7ee8f5ed491a18512fdb066203..cfaa81ee1ccfebee36ee501b35d95dcfc852343a 100644 (file)
@@ -342,6 +342,13 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
             </span>
           )}
         </li>
+        <span className="mx-1 badge badge-secondary">
+          {
+            this.props.allLanguages.find(
+              lang => lang.id === post_view.post.language_id
+            )?.name
+          }
+        </span>
         <li className="list-inline-item">•</li>
         {url && !(hostname(url) === getExternalHost()) && (
           <>