From 536c3f491546b4546f43a46e7a1a699ca9ac2934 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 9 Aug 2019 17:14:43 -0700 Subject: Adding support for internationalization / i18n (#189) * Still not working * Starting to work on internationalization * Main done. * i18n translations first pass. * Localization testing mostly done. * Second front end pass. * Added a few more translations. * Adding back end translations. --- ui/src/components/community.tsx | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'ui/src/components/community.tsx') diff --git a/ui/src/components/community.tsx b/ui/src/components/community.tsx index 6a1f5da2..480b909e 100644 --- a/ui/src/components/community.tsx +++ b/ui/src/components/community.tsx @@ -6,6 +6,7 @@ import { WebSocketService } from '../services'; import { PostListings } from './post-listings'; import { Sidebar } from './sidebar'; import { msgOp, routeSortTypeToEnum, fetchLimit } from '../utils'; +import { T } from 'inferno-i18next'; interface State { community: CommunityI; @@ -102,7 +103,7 @@ export class Community extends Component {
{this.state.community.title} {this.state.community.removed && - removed + # }
{this.selects()} @@ -126,15 +127,15 @@ export class Community extends Component { return (
) @@ -144,9 +145,9 @@ export class Community extends Component { return (
{this.state.page > 1 && - + } - +
); } @@ -193,7 +194,7 @@ export class Community extends Component { console.log(msg); let op: UserOperation = msgOp(msg); if (msg.error) { - alert(msg.error); + alert(i18n.t(msg.error)); return; } else if (op == UserOperation.GetCommunity) { let res: GetCommunityResponse = msg; -- cgit v1.2.3