From 411e7ef16e7cde0f8a63ee741680c5090998da2e Mon Sep 17 00:00:00 2001 From: Dessalines Date: Wed, 7 Aug 2019 12:12:53 -0700 Subject: [PATCH] Main done. --- ui/src/components/main.tsx | 55 ++++++++++++++++++++++++++------------ ui/src/i18next.ts | 15 +++++++---- 2 files changed, 48 insertions(+), 22 deletions(-) diff --git a/ui/src/components/main.tsx b/ui/src/components/main.tsx index 73d6deacc..c6d3808b6 100644 --- a/ui/src/components/main.tsx +++ b/ui/src/components/main.tsx @@ -7,6 +7,7 @@ import { WebSocketService, UserService } from '../services'; import { PostListings } from './post-listings'; import { SiteForm } from './site-form'; import { msgOp, repoUrl, mdToHtml, fetchLimit, routeSortTypeToEnum, routeListingTypeToEnum } from '../utils'; +import { T } from 'inferno-i18next'; interface MainState { subscribedCommunities: Array; @@ -135,7 +136,9 @@ export class Main extends Component { {this.trendingCommunities()} {UserService.Instance.user && this.state.subscribedCommunities.length > 0 &&
-
##
+
+ ## +
    {this.state.subscribedCommunities.map(community =>
  • {community.community_name}
  • @@ -144,7 +147,9 @@ export class Main extends Component {
} + to="/create_community"> + # + {this.sidebar()} } @@ -155,7 +160,9 @@ export class Main extends Component { trendingCommunities() { return (
- {/*
{t('Trending')} communities
*/} +
+ ## +
    {this.state.trendingCommunities.map(community =>
  • {community.name}
  • @@ -193,18 +200,32 @@ export class Main extends Component { {this.canAdmin &&
    • - edit + + # +
    }
      -
    • {this.state.site.site.number_of_users} Users
    • -
    • {this.state.site.site.number_of_posts} Posts
    • -
    • {this.state.site.site.number_of_comments} Comments
    • -
    • Modlog
    • +
    • + # +
    • +
    • + # +
    • +
    • + # +
    • +
    • + + # + +
      -
    • admins:
    • +
    • + #: +
    • {this.state.site.admins.map(admin =>
    • {admin.name}
    • )} @@ -223,15 +244,15 @@ export class Main extends Component { landing() { return (
      -
      Powered by - - LemmyBeta +
      + # + # + Lemmybeta
      -

      Lemmy is a link aggregator / reddit alternative, intended to work in the fediverse.

      -

      Its self-hostable, has live-updating comment threads, and is tiny (~80kB). Federation into the ActivityPub network is on the roadmap.

      -

      This is a very early beta version, and a lot of features are currently broken or missing.

      -

      Suggest new features or report bugs here.

      -

      Made with Rust, Actix, Inferno, Typescript.

      +

      + ###

      #

      #

      #

      #### +
      +

      ) } diff --git a/ui/src/i18next.ts b/ui/src/i18next.ts index b2eb96889..0af984235 100644 --- a/ui/src/i18next.ts +++ b/ui/src/i18next.ts @@ -1,15 +1,20 @@ import * as i18next from 'i18next'; +// https://github.com/nimbusec-oss/inferno-i18next/blob/master/tests/T.test.js#L66 const resources = { en: { translation: { - trending: 'NO', subscribed_to_communities:'Subscribed to <1>communities', create_a_community: 'Create a community', - - - - + trending_communities:'Trending <1>communities', + edit: 'edit', + number_of_users:'{{count}} Users', + number_of_posts:'{{count}} Posts', + number_of_comments:'{{count}} Comments', + modlog: 'Modlog', + admins: 'admins', + powered_by: 'Powered by', + landing_0: 'Lemmy is a <1>link aggregator / reddit alternative, intended to work in the <2>fediverse.<3>Its self-hostable, has live-updating comment threads, and is tiny (<4>~80kB). Federation into the ActivityPub network is on the roadmap. <5>This is a <6>very early beta version, and a lot of features are currently broken or missing. <7>Suggest new features or report bugs <8>here.<9>Made with <10>Rust, <11>Actix, <12>Inferno, <13>Typescript.', foo: 'foo',