lang | done | missing
---- | ---- | -------
-ca | 100% | old
-de | 87% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,old,docs,message_sent,messages,old_password,matrix_user_id,private_message_disclaimer,send_notifications_to_email,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message
-fa | 73% | cross_post,subscribed_to_communities,trending_communities,create_private_message,send_secure_message,send_message,message,mod,mods,moderates,remove_as_mod,appoint_as_mod,modlog,stickied,ban,ban_from_site,unban,unban_from_site,banned,number_of_subscribers,subscribers,both,saved,unsubscribe,subscribe,subscribed,old,api,docs,inbox,inbox_for,message_sent,notifications_error,messages,no_email_setup,matrix_user_id,private_message_disclaimer,url,body,copy_suggested_title,community,expand_here,subscribe_to_communities,theme,sponsor_message,general_sponsors,joined,by,to,from,landing_0,logged_in,community_moderator_already_exists,community_follower_already_exists,community_user_already_banned,no_slurs,admin_already_created,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message
-eo | 75% | number_of_communities,create_private_message,send_secure_message,send_message,message,preview,upload_image,avatar,upload_avatar,show_avatars,formatting_help,view_source,sticky,unsticky,archive_link,stickied,delete_account,delete_account_confirm,banned,creator,number_online,old,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,theme,donate_to_lemmy,donate,from,are_you_sure,yes,no,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message
-es | 100% | old
-fi | 100% | old
-fr | 83% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,archive_link,old,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message
-it | 84% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,archive_link,old,docs,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message
-nl | 100% |
-ru | 72% | cross_posts,cross_post,number_of_communities,create_private_message,send_secure_message,send_message,message,preview,upload_image,avatar,upload_avatar,show_avatars,formatting_help,view_source,sticky,unsticky,archive_link,stickied,delete_account,delete_account_confirm,banned,creator,number_online,old,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,recent_comments,theme,donate_to_lemmy,donate,monero,by,to,from,transfer_community,transfer_site,are_you_sure,yes,no,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message
-sv | 83% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,archive_link,old,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message
-zh | 70% | cross_posts,cross_post,users,number_of_communities,create_private_message,send_secure_message,send_message,message,preview,upload_image,avatar,upload_avatar,show_avatars,formatting_help,view_source,sticky,unsticky,archive_link,settings,stickied,delete_account,delete_account_confirm,banned,creator,number_online,old,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,recent_comments,nsfw,show_nsfw,theme,donate_to_lemmy,donate,monero,by,to,from,transfer_community,transfer_site,are_you_sure,yes,no,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message
+ca | 99% | old,time,action
+de | 87% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,old,docs,message_sent,messages,old_password,matrix_user_id,private_message_disclaimer,send_notifications_to_email,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message,time,action
+fa | 72% | cross_post,subscribed_to_communities,trending_communities,create_private_message,send_secure_message,send_message,message,mod,mods,moderates,remove_as_mod,appoint_as_mod,modlog,stickied,ban,ban_from_site,unban,unban_from_site,banned,number_of_subscribers,subscribers,both,saved,unsubscribe,subscribe,subscribed,old,api,docs,inbox,inbox_for,message_sent,notifications_error,messages,no_email_setup,matrix_user_id,private_message_disclaimer,url,body,copy_suggested_title,community,expand_here,subscribe_to_communities,theme,sponsor_message,general_sponsors,joined,by,to,from,landing_0,logged_in,community_moderator_already_exists,community_follower_already_exists,community_user_already_banned,no_slurs,admin_already_created,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message,time,action
+eo | 75% | number_of_communities,create_private_message,send_secure_message,send_message,message,preview,upload_image,avatar,upload_avatar,show_avatars,formatting_help,view_source,sticky,unsticky,archive_link,stickied,delete_account,delete_account_confirm,banned,creator,number_online,old,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,theme,donate_to_lemmy,donate,from,are_you_sure,yes,no,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message,time,action
+es | 99% | old,time,action
+fi | 99% | old,time,action
+fr | 82% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,archive_link,old,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message,time,action
+it | 83% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,archive_link,old,docs,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message,time,action
+nl | 99% | time,action
+ru | 71% | cross_posts,cross_post,number_of_communities,create_private_message,send_secure_message,send_message,message,preview,upload_image,avatar,upload_avatar,show_avatars,formatting_help,view_source,sticky,unsticky,archive_link,stickied,delete_account,delete_account_confirm,banned,creator,number_online,old,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,recent_comments,theme,donate_to_lemmy,donate,monero,by,to,from,transfer_community,transfer_site,are_you_sure,yes,no,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message,time,action
+sv | 82% | create_private_message,send_secure_message,send_message,message,avatar,upload_avatar,show_avatars,archive_link,old,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,donate_to_lemmy,donate,from,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message,time,action
+zh | 69% | cross_posts,cross_post,users,number_of_communities,create_private_message,send_secure_message,send_message,message,preview,upload_image,avatar,upload_avatar,show_avatars,formatting_help,view_source,sticky,unsticky,archive_link,settings,stickied,delete_account,delete_account_confirm,banned,creator,number_online,old,docs,replies,mentions,message_sent,messages,old_password,forgot_password,reset_password_mail_sent,password_change,new_password,no_email_setup,matrix_user_id,private_message_disclaimer,send_notifications_to_email,language,browser_default,downvotes_disabled,enable_downvotes,open_registration,registration_closed,enable_nsfw,recent_comments,nsfw,show_nsfw,theme,donate_to_lemmy,donate,monero,by,to,from,transfer_community,transfer_site,are_you_sure,yes,no,logged_in,email_already_exists,couldnt_create_private_message,no_private_message_edit_allowed,couldnt_update_private_message,time,action
<!-- translationsstop -->
If you'd like to update this report, run:
import { WebSocketService } from '../services';
import { wsJsonToRes, toast } from '../utils';
import { i18n } from '../i18next';
-import { T } from 'inferno-i18next';
declare const Sortable: any;
return (
<div class="container">
{this.state.loading ? (
- <p class="text-center">
+ <h5 class="">
<svg class="icon icon-spinner spin">
<use xlinkHref="#icon-spinner"></use>
</svg>
- </p>
+ </h5>
) : (
<div>
- <h5>
- { i18n.t('list_of_communities') }
- </h5>
+ <h5>{i18n.t('list_of_communities')}</h5>
<div class="table-responsive">
<table id="community_table" class="table table-sm table-hover">
<thead class="pointer">
<tr>
- <th>
- { i18n.t('name') }
- </th>
- <th class="d-none d-lg-table-cell">
- { i18n.t('title') }
- </th>
- <th>
- { i18n.t('category') }
- </th>
- <th class="text-right">
- { i18n.t('subscribers') }
- </th>
+ <th>{i18n.t('name')}</th>
+ <th class="d-none d-lg-table-cell">{i18n.t('title')}</th>
+ <th>{i18n.t('category')}</th>
+ <th class="text-right">{i18n.t('subscribers')}</th>
<th class="text-right d-none d-lg-table-cell">
- { i18n.t('posts') }
+ {i18n.t('posts')}
</th>
<th class="text-right d-none d-lg-table-cell">
- { i18n.t('comments') }
+ {i18n.t('comments')}
</th>
<th></th>
</tr>
this.handleUnsubscribe
)}
>
- <T i18nKey="unsubscribe">#</T>
+ {i18n.t('unsubscribe')}
</span>
) : (
<span
this.handleSubscribe
)}
>
- { i18n.t('subscribe') }
+ {i18n.t('subscribe')}
</span>
)}
</td>
class="btn btn-sm btn-secondary mr-1"
onClick={linkEvent(this, this.prevPage)}
>
- { i18n.t('prev') }
+ {i18n.t('prev')}
</button>
)}
class="btn btn-sm btn-secondary"
onClick={linkEvent(this, this.nextPage)}
>
- { i18n.t('next') }
+ {i18n.t('next')}
</button>
)}
</div>
import Tribute from 'tributejs/src/Tribute.js';
import autosize from 'autosize';
import { i18n } from '../i18next';
-import { T } from 'inferno-i18next';
import { Community } from '../interfaces';
return (
<form onSubmit={linkEvent(this, this.handleCreateCommunitySubmit)}>
<div class="form-group row">
- <label class="col-12 col-form-label" for="community-name">
- { i18n.t('name') }
+ <label class="col-12 col-form-label" htmlFor="community-name">
+ {i18n.t('name')}
</label>
<div class="col-12">
<input
</div>
<div class="form-group row">
- <label class="col-12 col-form-label" for="community-title">
- { i18n.t('title') }
+ <label class="col-12 col-form-label" htmlFor="community-title">
+ {i18n.t('title')}
</label>
<div class="col-12">
<input
</div>
</div>
<div class="form-group row">
- <label class="col-12 col-form-label" for="community-sidebar">
- { i18n.t('sidebar') }
+ <label class="col-12 col-form-label" htmlFor={this.id}>
+ {i18n.t('sidebar')}
</label>
<div class="col-12">
<textarea
id={this.id}
value={this.state.communityForm.description}
- id="community-sidebar"
onInput={linkEvent(this, this.handleCommunityDescriptionChange)}
class="form-control"
rows={3}
</div>
</div>
<div class="form-group row">
- <label class="col-12 col-form-label" for="community-category">
- { i18n.t('category') }
+ <label class="col-12 col-form-label" htmlFor="community-category">
+ {i18n.t('category')}
</label>
<div class="col-12">
<select
checked={this.state.communityForm.nsfw}
onChange={linkEvent(this, this.handleCommunityNsfwChange)}
/>
- <label class="form-check-label" for="community-nsfw">
- { i18n.t('nsfw') }
+ <label class="form-check-label" htmlFor="community-nsfw">
+ {i18n.t('nsfw')}
</label>
</div>
</div>
class="btn btn-secondary"
onClick={linkEvent(this, this.handleCancel)}
>
- { i18n.t('cancel') }
+ {i18n.t('cancel')}
</button>
)}
</div>
GetCommunityForm,
ListingType,
GetPostsResponse,
- CreatePostLikeResponse,
+ PostResponse,
WebSocketJsonResponse,
} from '../interfaces';
import { WebSocketService, UserService } from '../services';
postRefetchSeconds,
toast,
} from '../utils';
-import { T } from 'inferno-i18next';
import { i18n } from '../i18next';
interface State {
return (
<div class="container">
{this.state.loading ? (
- <p class="text-center">
+ <h5>
<svg class="icon icon-spinner spin">
<use xlinkHref="#icon-spinner"></use>
</svg>
- </p>
+ </h5>
) : (
<div class="row">
<div class="col-12 col-md-8">
{this.state.community.title}
{this.state.community.removed && (
<small className="ml-2 text-muted font-italic">
- { i18n.t('removed') }
+ {i18n.t('removed')}
</small>
)}
{this.state.community.nsfw && (
<small className="ml-2 text-muted font-italic">
- { i18n.t('nsfw') }
+ {i18n.t('nsfw')}
</small>
)}
</h5>
class="btn btn-sm btn-secondary mr-1"
onClick={linkEvent(this, this.prevPage)}
>
- { i18n.t('prev') }
+ {i18n.t('prev')}
</button>
)}
{this.state.posts.length == fetchLimit && (
class="btn btn-sm btn-secondary"
onClick={linkEvent(this, this.nextPage)}
>
- { i18n.t('next') }
+ {i18n.t('next')}
</button>
)}
</div>
this.state.loading = false;
this.setState(this.state);
} else if (res.op == UserOperation.CreatePostLike) {
- let data = res.data as CreatePostLikeResponse;
+ let data = res.data as PostResponse;
let found = this.state.posts.find(c => c.id == data.post.id);
found.my_vote = data.post.my_vote;
found.score = data.post.score;
import { Community } from '../interfaces';
import { WebSocketService } from '../services';
import { i18n } from '../i18next';
-import { T } from 'inferno-i18next';
export class CreateCommunity extends Component<any, any> {
constructor(props: any, context: any) {
<div class="container">
<div class="row">
<div class="col-12 col-lg-6 offset-lg-3 mb-4">
- <h5>
- { i18n.t('create_community') }
- </h5>
+ <h5>{i18n.t('create_community')}</h5>
<CommunityForm onCreate={this.handleCommunityCreate} />
</div>
</div>
import { WebSocketService } from '../services';
import { PostFormParams } from '../interfaces';
import { i18n } from '../i18next';
-import { T } from 'inferno-i18next';
export class CreatePost extends Component<any, any> {
constructor(props: any, context: any) {
<div class="container">
<div class="row">
<div class="col-12 col-lg-6 offset-lg-3 mb-4">
- <h5>
- { i18n.t('create_post') }
- </h5>
+ <h5>{i18n.t('create_post')}</h5>
<PostForm onCreate={this.handlePostCreate} params={this.params} />
</div>
</div>
<ul class="list-inline mb-1 text-muted small font-weight-bold">
<li className="list-inline-item">
<span class="pointer" onClick={this.markAllAsRead}>
- { i18n.t('mark_all_as_read') }
+ {i18n.t('mark_all_as_read')}
</span>
</li>
</ul>
onChange={linkEvent(this, this.handleUnreadOrAllChange)}
class="custom-select custom-select-sm w-auto mr-2"
>
- <option disabled>
- { i18n.t('type') }
-
- </option>
- <option value={UnreadOrAll.Unread}>
- { i18n.t('unread') }
- </option>
- <option value={UnreadOrAll.All}>
- { i18n.t('all') }
- </option>
+ <option disabled>{i18n.t('type')}</option>
+ <option value={UnreadOrAll.Unread}>{i18n.t('unread')}</option>
+ <option value={UnreadOrAll.All}>{i18n.t('all')}</option>
</select>
<select
value={this.state.unreadType}
onChange={linkEvent(this, this.handleUnreadTypeChange)}
class="custom-select custom-select-sm w-auto mr-2"
>
- <option disabled>
- { i18n.t('type') }
- </option>
- <option value={UnreadType.All}>
- { i18n.t('all') }
- </option>
- <option value={UnreadType.Both}>
- { i18n.t('both') }
- </option>
- <option value={UnreadType.Replies}>
- { i18n.t('replies') }
- </option>
- <option value={UnreadType.Mentions}>
- { i18n.t('mentions') }
- </option>
- <option value={UnreadType.Messages}>
- { i18n.t('messages') }
- </option>
+ <option disabled>{i18n.t('type')}</option>
+ <option value={UnreadType.All}>{i18n.t('all')}</option>
+ <option value={UnreadType.Replies}>{i18n.t('replies')}</option>
+ <option value={UnreadType.Mentions}>{i18n.t('mentions')}</option>
+ <option value={UnreadType.Messages}>{i18n.t('messages')}</option>
</select>
<SortSelect
sort={this.state.sort}
class="btn btn-sm btn-secondary mr-1"
onClick={linkEvent(this, this.prevPage)}
>
- { i18n.t('prev') }
+ {i18n.t('prev')}
</button>
)}
<button
class="btn btn-sm btn-secondary"
onClick={linkEvent(this, this.nextPage)}
>
- { i18n.t('next') }
+ {i18n.t('next')}
</button>
</div>
);
import { WebSocketService, UserService } from '../services';
import { wsJsonToRes, validEmail, toast } from '../utils';
import { i18n } from '../i18next';
-import { T } from 'inferno-i18next';
interface State {
loginForm: LoginForm;
return (
<div>
<form onSubmit={linkEvent(this, this.handleLoginSubmit)}>
- <h5>{ i18n.t('login') }</h5>
+ <h5>{i18n.t('login')}</h5>
<div class="form-group row">
- <label class="col-sm-2 col-form-label" for="login-email-or-username">
- { i18n.t('email_or_username') }
+ <label
+ class="col-sm-2 col-form-label"
+ htmlFor="login-email-or-username"
+ >
+ {i18n.t('email_or_username')}
</label>
<div class="col-sm-10">
<input
</div>
</div>
<div class="form-group row">
- <label class="col-sm-2 col-form-label" for="login-password">
- { i18n.t('password') }
+ <label class="col-sm-2 col-form-label" htmlFor="login-password">
+ {i18n.t('password')}
</label>
<div class="col-sm-10">
<input
onClick={linkEvent(this, this.handlePasswordReset)}
className="btn p-0 btn-link d-inline-block float-right text-muted small font-weight-bold"
>
- { i18n.t('forgot_password') }
+ {i18n.t('forgot_password')}
</button>
</div>
</div>
registerForm() {
return (
<form onSubmit={linkEvent(this, this.handleRegisterSubmit)}>
- <h2>
- { i18n.t('sign_up') }
- </h2>
+ <h5>{i18n.t('sign_up')}</h5>
<div class="form-group row">
- <label class="col-sm-2 col-form-label" for="register-username">
- { i18n.t('username') }
+ <label class="col-sm-2 col-form-label" htmlFor="register-username">
+ {i18n.t('username')}
</label>
<div class="col-sm-10">
</div>
<div class="form-group row">
- <label class="col-sm-2 col-form-label" for="register-email">
- { i18n.t('email') }
+ <label class="col-sm-2 col-form-label" htmlFor="register-email">
+ {i18n.t('email')}
</label>
<div class="col-sm-10">
<input
</div>
<div class="form-group row">
- <label class="col-sm-2 col-form-label" for="register-password">
- { i18n.t('password') }
+ <label class="col-sm-2 col-form-label" htmlFor="register-password">
+ {i18n.t('password')}
</label>
<div class="col-sm-10">
<input
</div>
<div class="form-group row">
- <label class="col-sm-2 col-form-label" for="register-verify-password">
- { i18n.t('verify_password') }
+ <label
+ class="col-sm-2 col-form-label"
+ htmlFor="register-verify-password"
+ >
+ {i18n.t('verify_password')}
</label>
<div class="col-sm-10">
<input
</div>
</div>
- { this.state.enable_nsfw && (
+ {this.state.enable_nsfw && (
<div class="form-group row">
<div class="col-sm-10">
<div class="form-check">
checked={this.state.registerForm.show_nsfw}
onChange={linkEvent(this, this.handleRegisterShowNsfwChange)}
/>
- <label class="form-check-label" for="register-show-nsfw">
- { i18n.t('show_nsfw') }
+ <label class="form-check-label" htmlFor="register-show-nsfw">
+ {i18n.t('show_nsfw')}
</label>
</div>
</div>
ListingType,
SiteResponse,
GetPostsResponse,
- CreatePostLikeResponse,
+ PostResponse,
Post,
GetPostsForm,
WebSocketJsonResponse,
return (
<div class="container">
<div class="row">
- <main role="main" class="col-12 col-md-8">{this.posts()}</main>
+ <main role="main" class="col-12 col-md-8">
+ {this.posts()}
+ </main>
<aside class="col-12 col-md-4">{this.my_sidebar()}</aside>
</div>
</div>
class="btn btn-sm btn-secondary btn-block"
to="/create_community"
>
- <T i18nKey="create_a_community">#</T>
+ {i18n.t('create_a_community')}
</Link>
</div>
</div>
class="pointer"
onClick={linkEvent(this, this.handleEditClick)}
>
- <T i18nKey="edit">#</T>
+ {i18n.t('edit')}
</span>
</li>
</ul>
)}
<ul class="my-2 list-inline">
<li className="list-inline-item badge badge-secondary">
- <T
- i18nKey="number_online"
- interpolation={{ count: this.state.site.online }}
- >
- #
- </T>
+ {i18n.t('number_online', { count: this.state.site.online })}
</li>
<li className="list-inline-item badge badge-secondary">
- <T
- i18nKey="number_of_users"
- interpolation={{
- count: this.state.site.site.number_of_users,
- }}
- >
- #
- </T>
+ {i18n.t('number_of_users', {
+ count: this.state.site.site.number_of_users,
+ })}
</li>
<li className="list-inline-item badge badge-secondary">
- <T
- i18nKey="number_of_communities"
- interpolation={{
- count: this.state.site.site.number_of_communities,
- }}
- >
- #
- </T>
+ {i18n.t('number_of_communities', {
+ count: this.state.site.site.number_of_communities,
+ })}
</li>
<li className="list-inline-item badge badge-secondary">
- <T
- i18nKey="number_of_posts"
- interpolation={{
- count: this.state.site.site.number_of_posts,
- }}
- >
- #
- </T>
+ {i18n.t('number_of_posts', {
+ count: this.state.site.site.number_of_posts,
+ })}
</li>
<li className="list-inline-item badge badge-secondary">
- <T
- i18nKey="number_of_comments"
- interpolation={{
- count: this.state.site.site.number_of_comments,
- }}
- >
- #
- </T>
+ {i18n.t('number_of_comments', {
+ count: this.state.site.site.number_of_comments,
+ })}
</li>
<li className="list-inline-item">
<Link className="badge badge-secondary" to="/modlog">
- <T i18nKey="modlog">#</T>
+ {i18n.t('modlog')}
</Link>
</li>
</ul>
<ul class="mt-1 list-inline small mb-0">
- <li class="list-inline-item">
- <T i18nKey="admins" class="d-inline">
- #
- </T>
- :
- </li>
+ <li class="list-inline-item">{i18n.t('admins')}:</li>
{this.state.site.admins.map(admin => (
<li class="list-inline-item">
<Link class="text-info" to={`/u/${admin.name}`}>
<div class="card border-secondary">
<div class="card-body">
<h5>
- <T i18nKey="powered_by" class="d-inline">
- #
- </T>
+ {i18n.t('powered_by')}
<svg class="icon mx-2">
<use xlinkHref="#icon-mouse">#</use>
</svg>
return (
<div class="main-content-wrapper">
{this.state.loading ? (
- <p class="text-center">
+ <h5>
<svg class="icon icon-spinner spin">
<use xlinkHref="#icon-spinner"></use>
</svg>
- </p>
+ </h5>
) : (
<div>
{this.selects()}
class="btn btn-sm btn-secondary mr-1"
onClick={linkEvent(this, this.prevPage)}
>
- <T i18nKey="prev">#</T>
+ {i18n.t('prev')}
</button>
)}
{this.state.posts.length == fetchLimit && (
class="btn btn-sm btn-secondary"
onClick={linkEvent(this, this.nextPage)}
>
- <T i18nKey="next">#</T>
+ {i18n.t('next')}
</button>
)}
</div>
this.state.loading = false;
this.setState(this.state);
} else if (res.op == UserOperation.CreatePostLike) {
- let data = res.data as CreatePostLikeResponse;
+ let data = res.data as PostResponse;
let found = this.state.posts.find(c => c.id == data.post.id);
found.my_vote = data.post.my_vote;
found.score = data.post.score;
ModBan,
ModAddCommunity,
ModAdd,
+ WebSocketJsonResponse,
} from '../interfaces';
import { WebSocketService } from '../services';
import { wsJsonToRes, addTypeInfo, fetchLimit, toast } from '../utils';
return (
<div class="container">
{this.state.loading ? (
- <h5 class="text-center">
+ <h5 class="">
<svg class="icon icon-spinner spin">
<use xlinkHref="#icon-spinner"></use>
</svg>
/c/{this.state.communityName}{' '}
</Link>
)}
- <span>{ i18n.t('modlog') }</span>
+ <span>{i18n.t('modlog')}</span>
</h5>
<div class="table-responsive">
<table id="modlog_table" class="table table-sm table-hover">
<thead class="pointer">
<tr>
- <th> { i18n.t('time')}</th>
- <th>{ i18n.t('mod')}</th>
- <th>{ i18n.t('action')}</th>
+ <th> {i18n.t('time')}</th>
+ <th>{i18n.t('mod')}</th>
+ <th>{i18n.t('action')}</th>
</tr>
</thead>
{this.combined()}
class="btn btn-sm btn-secondary mr-1"
onClick={linkEvent(this, this.prevPage)}
>
- { i18n.t('prev') }
+ {i18n.t('prev')}
</button>
)}
<button
class="btn btn-sm btn-secondary"
onClick={linkEvent(this, this.nextPage)}
>
- { i18n.t('next') }
+ {i18n.t('next')}
</button>
</div>
);
} from '../utils';
import { version } from '../version';
import { i18n } from '../i18next';
-import { T } from 'inferno-i18next';
interface NavbarState {
isLoggedIn: boolean;
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<Link class="nav-link" to="/communities">
- { i18n.t('communities') }
+ {i18n.t('communities')}
</Link>
</li>
<li class="nav-item">
<Link class="nav-link" to="/search">
- { i18n.t('search') }
+ {i18n.t('search')}
</Link>
</li>
<li class="nav-item">
state: { prevPath: this.currentLocation },
}}
>
- { i18n.t('create_post') }
+ {i18n.t('create_post')}
</Link>
</li>
<li class="nav-item">
<Link class="nav-link" to="/create_community">
- { i18n.t('create_community') }
+ {i18n.t('create_community')}
</Link>
</li>
<li className="nav-item">
<Link
- class="nav-link ml-2"
+ class="nav-link"
to="/sponsors"
title={i18n.t('donate_to_lemmy')}
>
</>
) : (
<Link class="nav-link" to="/login">
- { i18n.t('login_sign_up') }
+ {i18n.t('login_sign_up')}
</Link>
)}
</ul>
import { WebSocketService, UserService } from '../services';
import { wsJsonToRes, capitalizeFirstLetter, toast } from '../utils';
import { i18n } from '../i18next';
-import { T } from 'inferno-i18next';
interface State {
passwordChangeForm: PasswordChangeForm;
<div class="container">
<div class="row">
<div class="col-12 col-lg-6 offset-lg-3 mb-4">
- <h5>
- { i18n.t('password_change') }
- </h5>
+ <h5>{i18n.t('password_change')}</h5>
{this.passwordChangeForm()}
</div>
</div>
<form onSubmit={linkEvent(this, this.handlePasswordChangeSubmit)}>
<div class="form-group row">
<label class="col-sm-2 col-form-label">
- <T i18nKey="new_password">#</T>
+ {i18n.t('new_password')}
</label>
<div class="col-sm-10">
<input
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">
- <T i18nKey="verify_password">#</T>
+ {i18n.t('verify_password')}
</label>
<div class="col-sm-10">
<input
import autosize from 'autosize';
import Tribute from 'tributejs/src/Tribute.js';
import { i18n } from '../i18next';
-import { T } from 'inferno-i18next';
interface PostFormProps {
post?: Post; // If a post is given, that means this is an edit
<div>
<form onSubmit={linkEvent(this, this.handlePostSubmit)}>
<div class="form-group row">
- <label class="col-sm-2 col-form-label" for="post-url">
- { i18n.t('url') }
+ <label class="col-sm-2 col-form-label" htmlFor="post-url">
+ {i18n.t('url')}
</label>
<div class="col-sm-10">
<input
class="mt-1 text-muted small font-weight-bold pointer"
onClick={linkEvent(this, this.copySuggestedTitle)}
>
- <T
- i18nKey="copy_suggested_title"
- interpolation={{ title: this.state.suggestedTitle }}
- >
- #
- </T>
+ {i18n.t('copy_suggested_title', {
+ title: this.state.suggestedTitle,
+ })}
</div>
)}
<form>
className={`${UserService.Instance.user &&
'pointer'} d-inline-block mr-2 float-right text-muted small font-weight-bold`}
>
- { i18n.t('upload_image') }
+ {i18n.t('upload_image')}
</label>
<input
id="file-upload"
target="_blank"
class="mr-2 d-inline-block float-right text-muted small font-weight-bold"
>
- { i18n.t('archive_link') }
+ {i18n.t('archive_link')}
</a>
)}
{this.state.imageLoading && (
{this.state.crossPosts.length > 0 && (
<>
<div class="my-1 text-muted small font-weight-bold">
- { i18n.t('cross_posts') }
+ {i18n.t('cross_posts')}
</div>
<PostListings showCommunity posts={this.state.crossPosts} />
</>
</div>
</div>
<div class="form-group row">
- <label class="col-sm-2 col-form-label" for="post-title">
- { i18n.t('title') }
+ <label class="col-sm-2 col-form-label" htmlFor="post-title">
+ {i18n.t('title')}
</label>
<div class="col-sm-10">
<textarea
{this.state.suggestedPosts.length > 0 && (
<>
<div class="my-1 text-muted small font-weight-bold">
- { i18n.t('related_posts') }
+ {i18n.t('related_posts')}
</div>
<PostListings posts={this.state.suggestedPosts} />
</>
</div>
<div class="form-group row">
- <label class="col-sm-2 col-form-label" for="post-body">
- { i18n.t('body') }
+ <label class="col-sm-2 col-form-label" htmlFor={this.id}>
+ {i18n.t('body')}
</label>
<div class="col-sm-10">
<textarea
id={this.id}
value={this.state.postForm.body}
- id="post-body"
onInput={linkEvent(this, this.handlePostBodyChange)}
className={`form-control ${this.state.previewMode && 'd-none'}`}
rows={4}
.previewMode && 'active'}`}
onClick={linkEvent(this, this.handlePreviewToggle)}
>
- { i18n.t('preview') }
+ {i18n.t('preview')}
</button>
)}
<a
target="_blank"
class="d-inline-block float-right text-muted small font-weight-bold"
>
- { i18n.t('formatting_help') }
+ {i18n.t('formatting_help')}
</a>
</div>
</div>
{!this.props.post && (
<div class="form-group row">
- <label class="col-sm-2 col-form-label" for="post-community">
- { i18n.t('community') }
+ <label class="col-sm-2 col-form-label" htmlFor="post-community">
+ {i18n.t('community')}
</label>
<div class="col-sm-10">
<select
checked={this.state.postForm.nsfw}
onChange={linkEvent(this, this.handlePostNsfwChange)}
/>
- <label class="form-check-label" for="post-nsfw">
- { i18n.t('nsfw') }
+ <label class="form-check-label" htmlFor="post-nsfw">
+ {i18n.t('nsfw')}
</label>
</div>
</div>
class="btn btn-secondary"
onClick={linkEvent(this, this.handleCancel)}
>
- { i18n.t('cancel') }
+ {i18n.t('cancel')}
</button>
)}
</div>
imageThumbnailer,
} from '../utils';
import { i18n } from '../i18next';
-import { T } from 'inferno-i18next';
interface PostListingState {
showEdit: boolean;
)}
{post.removed && (
<small className="ml-2 text-muted font-italic">
- { i18n.t('removed') }
+ {i18n.t('removed')}
</small>
)}
{post.deleted && (
<small className="ml-2 text-muted font-italic">
- { i18n.t('deleted') }
+ {i18n.t('deleted')}
</small>
)}
{post.locked && (
<small className="ml-2 text-muted font-italic">
- { i18n.t('locked') }
+ {i18n.t('locked')}
</small>
)}
{post.stickied && (
<small className="ml-2 text-muted font-italic">
- { i18n.t('stickied') }
+ {i18n.t('stickied')}
</small>
)}
{post.nsfw && (
<small className="ml-2 text-muted font-italic">
- { i18n.t('nsfw') }
+ {i18n.t('nsfw')}
</small>
)}
</div>
<span>{post.creator_name}</span>
</Link>
{this.isMod && (
- <span className="mx-1 badge badge-light">
- { i18n.t('mod') }
- </span>
+ <span className="mx-1 badge badge-light">{i18n.t('mod')}</span>
)}
{this.isAdmin && (
<span className="mx-1 badge badge-light">
- { i18n.t('admin') }
+ {i18n.t('admin')}
</span>
)}
{(post.banned_from_community || post.banned) && (
<span className="mx-1 badge badge-danger">
- { i18n.t('banned') }
+ {i18n.t('banned')}
</span>
)}
{this.props.showCommunity && (
</li>
<li className="list-inline-item">
<Link className="text-muted" to={`/post/${post.id}`}>
- <T
- i18nKey="number_of_comments"
- interpolation={{ count: post.number_of_comments }}
- >
- #
- </T>
+ {i18n.t('number_of_comments', {
+ count: post.number_of_comments,
+ })}
</Link>
</li>
</ul>
className="text-muted"
to={`/create_post${this.crossPostParams}`}
>
- <T i18nKey="cross_post">#</T>
+ {i18n.t('cross_post')}
</Link>
</li>
</>
class="pointer"
onClick={linkEvent(this, this.handleEditClick)}
>
- <T i18nKey="edit">#</T>
+ {i18n.t('edit')}
</span>
</li>
<li className="list-inline-item mr-2">
class="pointer"
onClick={linkEvent(this, this.handleModRemoveShow)}
>
- { i18n.t('remove') }
+ {i18n.t('remove')}
</span>
) : (
<span
class="pointer"
onClick={linkEvent(this, this.handleModRemoveSubmit)}
>
- { i18n.t('restore') }
+ {i18n.t('restore')}
</span>
)}
</li>
this.handleModBanFromCommunityShow
)}
>
- { i18n.t('ban') }
+ {i18n.t('ban')}
</span>
) : (
<span
this.handleModBanFromCommunitySubmit
)}
>
- { i18n.t('unban') }
+ {i18n.t('unban')}
</span>
)}
</li>
this.handleShowConfirmTransferCommunity
)}
>
- <T i18nKey="transfer_community">#</T>
+ {i18n.t('transfer_community')}
</span>
) : (
<>
<span class="d-inline-block mr-1">
- <T i18nKey="are_you_sure">#</T>
+ {i18n.t('are_you_sure')}
</span>
<span
class="pointer d-inline-block mr-1"
this.handleTransferCommunity
)}
>
- { i18n.t('yes') }
+ {i18n.t('yes')}
</span>
<span
class="pointer d-inline-block"
this.handleCancelShowConfirmTransferCommunity
)}
>
- { i18n.t('no') }
+ {i18n.t('no')}
</span>
</>
)}
class="pointer"
onClick={linkEvent(this, this.handleModBanShow)}
>
- { i18n.t('ban_from_site') }
+ {i18n.t('ban_from_site')}
</span>
) : (
<span
class="pointer"
onClick={linkEvent(this, this.handleModBanSubmit)}
>
- { i18n.t('unban_from_site') }
+ {i18n.t('unban_from_site')}
</span>
)}
</li>
this.handleShowConfirmTransferSite
)}
>
- { i18n.t('transfer_site') }
+ {i18n.t('transfer_site')}
</span>
) : (
<>
<span class="d-inline-block mr-1">
- { i18n.t('are_you_sure') }
+ {i18n.t('are_you_sure')}
</span>
<span
class="pointer d-inline-block mr-1"
onClick={linkEvent(this, this.handleTransferSite)}
>
- { i18n.t('yes') }
+ {i18n.t('yes')}
</span>
<span
class="pointer d-inline-block"
this.handleCancelShowConfirmTransferSite
)}
>
- { i18n.t('no') }
+ {i18n.t('no')}
</span>
</>
)}
className="pointer"
onClick={linkEvent(this, this.handleViewSource)}
>
- { i18n.t('view_source') }
+ {i18n.t('view_source')}
</span>
</li>
)}
onInput={linkEvent(this, this.handleModRemoveReasonChange)}
/>
<button type="submit" class="btn btn-secondary">
- { i18n.t('remove_post') }
+ {i18n.t('remove_post')}
</button>
</form>
)}
{this.state.showBanDialog && (
<form onSubmit={linkEvent(this, this.handleModBanBothSubmit)}>
<div class="form-group row">
- <label class="col-form-label" for="post-listing-reason">
- { i18n.t('reason') }
+ <label class="col-form-label" htmlFor="post-listing-reason">
+ {i18n.t('reason')}
</label>
<input
type="text"
import { Post } from '../interfaces';
import { PostListing } from './post-listing';
import { i18n } from '../i18next';
-import { T } from 'inferno-i18next';
interface PostListingsProps {
posts: Array<Post>;
))
) : (
<>
- <h5>
- { i18n.t('no_posts') }
- </h5>
+ <div>{i18n.t('no_posts')}</div>
{this.props.showCommunity !== undefined && (
<div>
- <Link to="/communities">{ i18n.t('subscribe_to_communities') }</Link>
+ <Link to="/communities">
+ {i18n.t('subscribe_to_communities')}
+ </Link>
</div>
)}
</>
CommentForm as CommentFormI,
CommentResponse,
CommentSortType,
- CreatePostLikeResponse,
CommunityUser,
CommunityResponse,
CommentNode as CommentNodeI,
import { CommentNodes } from './comment-nodes';
import autosize from 'autosize';
import { i18n } from '../i18next';
-import { T } from 'inferno-i18next';
interface PostState {
post: PostI;
return (
<div class="container">
{this.state.loading ? (
- <p class="text-center">
+ <h5>
<svg class="icon icon-spinner spin">
<use xlinkHref="#icon-spinner"></use>
</svg>
- </p>
+ </h5>
) : (
<div class="row">
<div class="col-12 col-md-8 mb-3">
{this.state.crossPosts.length > 0 && (
<>
<div class="my-1 text-muted small font-weight-bold">
- { i18n.t('cross_posts') }
+ {i18n.t('cross_posts')}
</div>
<PostListings showCommunity posts={this.state.crossPosts} />
</>
return (
<div class="d-none d-md-block new-comments mb-3 card border-secondary">
<div class="card-body small">
- <h6>
- { i18n.t('recent_comments') }
- </h6>
+ <h6>{i18n.t('recent_comments')}</h6>
{this.state.comments.map(comment => (
<CommentNodes
nodes={[{ comment: comment }]}
}
this.setState(this.state);
} else if (res.op == UserOperation.CreatePostLike) {
- let data = res.data as CreatePostLikeResponse;
+ let data = res.data as PostResponse;
this.state.post.my_vote = data.post.my_vote;
this.state.post.score = data.post.score;
this.state.post.upvotes = data.post.upvotes;
SearchForm,
SearchResponse,
SearchType,
- CreatePostLikeResponse,
+ PostResponse,
CommentResponse,
WebSocketJsonResponse,
} from '../interfaces';
import { SortSelect } from './sort-select';
import { CommentNodes } from './comment-nodes';
import { i18n } from '../i18next';
-import { T } from 'inferno-i18next';
interface SearchState {
q: string;
render() {
return (
<div class="container">
- <h5>
- { i18n.t('search') }
- </h5>
+ <h5>{i18n.t('search')}</h5>
{this.selects()}
{this.searchForm()}
{this.state.type_ == SearchType.All && this.all()}
<use xlinkHref="#icon-spinner"></use>
</svg>
) : (
- <span>
- { i18n.t('search') }
- </span>
+ <span>{i18n.t('search')}</span>
)}
</button>
</form>
onChange={linkEvent(this, this.handleTypeChange)}
class="custom-select custom-select-sm w-auto"
>
- <option disabled>
- { i18n.t('type') }
- </option>
- <option value={SearchType.All}>
- { i18n.t('all') }
- </option>
- <option value={SearchType.Comments}>
- { i18n.t('comments') }
- </option>
- <option value={SearchType.Posts}>
- { i18n.t('posts') }
- </option>
+ <option disabled>{i18n.t('type')}</option>
+ <option value={SearchType.All}>{i18n.t('all')}</option>
+ <option value={SearchType.Comments}>{i18n.t('comments')}</option>
+ <option value={SearchType.Posts}>{i18n.t('posts')}</option>
<option value={SearchType.Communities}>
- { i18n.t('communities') }
- </option>
- <option value={SearchType.Users}>
- { i18n.t('users') }
+ {i18n.t('communities')}
</option>
+ <option value={SearchType.Users}>{i18n.t('users')}</option>
</select>
<span class="ml-2">
<SortSelect
class="btn btn-sm btn-secondary mr-1"
onClick={linkEvent(this, this.prevPage)}
>
- { i18n.t('prev') }
+ {i18n.t('prev')}
</button>
)}
<button
class="btn btn-sm btn-secondary"
onClick={linkEvent(this, this.nextPage)}
>
- { i18n.t('next') }
+ {i18n.t('next')}
</button>
</div>
);
res.posts.length == 0 &&
res.comments.length == 0 &&
res.communities.length == 0 &&
- res.users.length == 0 && (
- <span>
- { i18n.t('no_results') }
- </span>
- )}
+ res.users.length == 0 && <span>{i18n.t('no_results')}</span>}
</div>
);
}
}
this.setState(this.state);
} else if (res.op == UserOperation.CreatePostLike) {
- let data = res.data as CreatePostLikeResponse;
+ let data = res.data as PostResponse;
let found = this.state.searchResponse.posts.find(
c => c.id == data.post.id
);
import { wsJsonToRes, toast } from '../utils';
import { SiteForm } from './site-form';
import { i18n } from '../i18next';
-import { T } from 'inferno-i18next';
interface State {
userForm: RegisterForm;
<div class="container">
<div class="row">
<div class="col-12 offset-lg-3 col-lg-6">
- <h3>
- { i18n.t('lemmy_instance_setup') }
- </h3>
+ <h3>{i18n.t('lemmy_instance_setup')}</h3>
{!this.state.doneRegisteringUser ? (
this.registerUser()
) : (
registerUser() {
return (
<form onSubmit={linkEvent(this, this.handleRegisterSubmit)}>
- <h4>{ i18n.t('setup_admin')}</h4>
+ <h5>{i18n.t('setup_admin')}</h5>
<div class="form-group row">
- <label class="col-sm-2 col-form-label" for="username">
- { i18n.t('username') }
+ <label class="col-sm-2 col-form-label" htmlFor="username">
+ {i18n.t('username')}
</label>
<div class="col-sm-10">
<input
</div>
</div>
<div class="form-group row">
- <label class="col-sm-2 col-form-label" for="email">
- { i18n.t('email') }
+ <label class="col-sm-2 col-form-label" htmlFor="email">
+ {i18n.t('email')}
</label>
<div class="col-sm-10">
</div>
</div>
<div class="form-group row">
- <label class="col-sm-2 col-form-label" for="password">
- { i18n.t('password')}
+ <label class="col-sm-2 col-form-label" htmlFor="password">
+ {i18n.t('password')}
</label>
<div class="col-sm-10">
<input
</div>
</div>
<div class="form-group row">
- <label class="col-sm-2 col-form-label" for="verify-password">
- { i18n.t('verify_password') }
+ <label class="col-sm-2 col-form-label" htmlFor="verify-password">
+ {i18n.t('verify_password')}
</label>
<div class="col-sm-10">
<input
} from '../utils';
import { CommunityForm } from './community-form';
import { i18n } from '../i18next';
-import { T } from 'inferno-i18next';
interface SidebarProps {
community: Community;
<span>{community.title}</span>
{community.removed && (
<small className="ml-2 text-muted font-italic">
- { i18n.t('removed') }
+ {i18n.t('removed')}
</small>
)}
{community.deleted && (
<small className="ml-2 text-muted font-italic">
- <T i18nKey="deleted">#</T>
+ {i18n.t('deleted')}
</small>
)}
</h5>
class="pointer"
onClick={linkEvent(this, this.handleEditClick)}
>
- { i18n.t('edit') }
+ {i18n.t('edit')}
</span>
</li>
{this.amCreator && (
class="pointer"
onClick={linkEvent(this, this.handleModRemoveShow)}
>
- { i18n.t('remove') }
+ {i18n.t('remove')}
</span>
) : (
<span
class="pointer"
onClick={linkEvent(this, this.handleModRemoveSubmit)}
>
- { i18n.t('restore') }
+ {i18n.t('restore')}
</span>
)}
</li>
{this.state.showRemoveDialog && (
<form onSubmit={linkEvent(this, this.handleModRemoveSubmit)}>
<div class="form-group row">
- <label class="col-form-label" for="remove-reason">
- { i18n.t('reason') }
+ <label class="col-form-label" htmlFor="remove-reason">
+ {i18n.t('reason')}
</label>
<input
type="text"
{/* </div> */}
<div class="form-group row">
<button type="submit" class="btn btn-secondary">
- { i18n.t('remove_community') }
+ {i18n.t('remove_community')}
</button>
</div>
</form>
</Link>
</li>
<li className="list-inline-item badge badge-secondary">
- <T
- i18nKey="number_of_subscribers"
- interpolation={{ count: community.number_of_subscribers }}
- >
- #
- </T>
+ {i18n.t('number_of_subscribers', {
+ count: community.number_of_subscribers,
+ })}
</li>
<li className="list-inline-item badge badge-secondary">
- <T
- i18nKey="number_of_posts"
- interpolation={{ count: community.number_of_posts }}
- >
- #
- </T>
+ {i18n.t('number_of_posts', {
+ count: community.number_of_posts,
+ })}
</li>
<li className="list-inline-item badge badge-secondary">
- <T
- i18nKey="number_of_comments"
- interpolation={{ count: community.number_of_comments }}
- >
- #
- </T>
+ {i18n.t('number_of_comments', {
+ count: community.number_of_comments,
+ })}
</li>
<li className="list-inline-item">
<Link
className="badge badge-secondary"
to={`/modlog/community/${this.props.community.id}`}
>
- <T i18nKey="modlog">#</T>
+ {i18n.t('modlog')}
</Link>
</li>
</ul>
'no-click'}`}
to={`/create_post?community=${community.name}`}
>
- { i18n.t('create_a_post') }
+ {i18n.t('create_a_post')}
</Link>
<div>
{community.subscribed ? (
class="btn btn-sm btn-secondary btn-block"
onClick={linkEvent(community.id, this.handleUnsubscribe)}
>
- { i18n.t('unsubscribe') }
+ {i18n.t('unsubscribe')}
</button>
) : (
<button
class="btn btn-sm btn-secondary btn-block"
onClick={linkEvent(community.id, this.handleSubscribe)}
>
- { i18n.t('subscribe') }
+ {i18n.t('subscribe')}
</button>
)}
</div>
import autosize from 'autosize';
import Tribute from 'tributejs/src/Tribute.js';
import { i18n } from '../i18next';
-import { T } from 'inferno-i18next';
interface SiteFormProps {
site?: Site; // If a site is given, that means this is an edit
: capitalizeFirstLetter(i18n.t('name'))
} ${i18n.t('your_site')}`}</h5>
<div class="form-group row">
- <label class="col-12 col-form-label" for="create-site-name">
- { i18n.t('name') }
+ <label class="col-12 col-form-label" htmlFor="create-site-name">
+ {i18n.t('name')}
</label>
<div class="col-12">
<input
</div>
</div>
<div class="form-group row">
- <label class="col-12 col-form-label" for="create-site-sidebar">
- { i18n.t('sidebar') }
+ <label class="col-12 col-form-label" htmlFor={this.id}>
+ {i18n.t('sidebar')}
</label>
<div class="col-12">
<textarea
id={this.id}
value={this.state.siteForm.description}
- id="create-site-sidebar"
onInput={linkEvent(this, this.handleSiteDescriptionChange)}
class="form-control"
rows={3}
checked={this.state.siteForm.enable_downvotes}
onChange={linkEvent(this, this.handleSiteEnableDownvotesChange)}
/>
- <label class="form-check-label" for="create-site-downvotes">
- { i18n.t('enable_downvotes') }
+ <label class="form-check-label" htmlFor="create-site-downvotes">
+ {i18n.t('enable_downvotes')}
</label>
</div>
</div>
checked={this.state.siteForm.enable_nsfw}
onChange={linkEvent(this, this.handleSiteEnableNsfwChange)}
/>
- <label class="form-check-label" for="create-site-enable-nsfw">
- { i18n.t('enable_nsfw') }
+ <label class="form-check-label" htmlFor="create-site-enable-nsfw">
+ {i18n.t('enable_nsfw')}
</label>
</div>
</div>
this.handleSiteOpenRegistrationChange
)}
/>
- <label class="form-check-label" for="create-site-open-registration">
- { i18n.t('open_registration') }
+ <label
+ class="form-check-label"
+ htmlFor="create-site-open-registration"
+ >
+ {i18n.t('open_registration')}
</label>
</div>
</div>
class="btn btn-secondary"
onClick={linkEvent(this, this.handleCancel)}
>
- { i18n.t('cancel') }
+ {i18n.t('cancel')}
</button>
)}
</div>
import { Component, linkEvent } from 'inferno';
import { SortType } from '../interfaces';
import { i18n } from '../i18next';
-import { T } from 'inferno-i18next';
interface SortSelectProps {
sort: SortType;
onChange={linkEvent(this, this.handleSortChange)}
class="custom-select custom-select-sm w-auto"
>
- <option disabled>
- { i18n.t('sort_type') }
- </option>
+ <option disabled>{i18n.t('sort_type')}</option>
{!this.props.hideHot && (
- <option value={SortType.Hot}>
- { i18n.t('hot') }
- </option>
+ <option value={SortType.Hot}>{i18n.t('hot')}</option>
)}
- <option value={SortType.New}>
- { i18n.t('new') }
- </option>
+ <option value={SortType.New}>{i18n.t('new')}</option>
<option disabled>─────</option>
- <option value={SortType.TopDay}>
- { i18n.t('top_day') }
- </option>
- <option value={SortType.TopWeek}>
- { i18n.t('week') }
- </option>
- <option value={SortType.TopMonth}>
- { i18n.t('month') }
- </option>
- <option value={SortType.TopYear}>
- { i18n.t('year') }
- </option>
- <option value={SortType.TopAll}>
- { i18n.t('all') }
- </option>
+ <option value={SortType.TopDay}>{i18n.t('top_day')}</option>
+ <option value={SortType.TopWeek}>{i18n.t('week')}</option>
+ <option value={SortType.TopMonth}>{i18n.t('month')}</option>
+ <option value={SortType.TopYear}>{i18n.t('year')}</option>
+ <option value={SortType.TopAll}>{i18n.t('all')}</option>
</select>
);
}
BanUserResponse,
AddAdminResponse,
DeleteAccountForm,
- CreatePostLikeResponse,
+ PostResponse,
WebSocketJsonResponse,
} from '../interfaces';
import { WebSocketService, UserService } from '../services';
import { CommentNodes } from './comment-nodes';
import { MomentTime } from './moment-time';
import { i18n } from '../i18next';
-import { T } from 'inferno-i18next';
enum View {
Overview,
return (
<div class="container">
{this.state.loading ? (
- <p class="text-center">
+ <h5>
<svg class="icon icon-spinner spin">
<use xlinkHref="#icon-spinner"></use>
</svg>
- </p>
+ </h5>
) : (
<div class="row">
<div class="col-12 col-md-8">
onChange={linkEvent(this, this.handleViewChange)}
class="custom-select custom-select-sm w-auto"
>
- <option disabled>
- { i18n.t('view') }
- </option>
- <option value={View.Overview}>
- { i18n.t('overview') }
- </option>
- <option value={View.Comments}>
- { i18n.t('comments') }
- </option>
- <option value={View.Posts}>
- { i18n.t('posts') }
- </option>
- <option value={View.Saved}>
- { i18n.t('saved') }
- </option>
+ <option disabled>{i18n.t('view')}</option>
+ <option value={View.Overview}>{i18n.t('overview')}</option>
+ <option value={View.Comments}>{i18n.t('comments')}</option>
+ <option value={View.Posts}>{i18n.t('posts')}</option>
+ <option value={View.Saved}>{i18n.t('saved')}</option>
</select>
<span class="ml-2">
<SortSelect
<li className="list-inline-item">{user.name}</li>
{user.banned && (
<li className="list-inline-item badge badge-danger">
- { i18n.t('banned') }
+ {i18n.t('banned')}
</li>
)}
</ul>
<table class="table table-bordered table-sm mt-2 mb-0">
<tr>
<td>
- <T
- i18nKey="number_of_points"
- interpolation={{ count: user.post_score }}
- >
- #
- </T>
+ {i18n.t('number_of_points', { count: user.post_score })}
</td>
<td>
- <T
- i18nKey="number_of_posts"
- interpolation={{ count: user.number_of_posts }}
- >
- #
- </T>
+ {i18n.t('number_of_posts', { count: user.number_of_posts })}
</td>
</tr>
<tr>
<td>
- <T
- i18nKey="number_of_points"
- interpolation={{ count: user.comment_score }}
- >
- #
- </T>
+ {i18n.t('number_of_points', { count: user.comment_score })}
</td>
<td>
- <T
- i18nKey="number_of_comments"
- interpolation={{ count: user.number_of_comments }}
- >
- #
- </T>
+ {i18n.t('number_of_comments', {
+ count: user.number_of_comments,
+ })}
</td>
</tr>
</table>
class="btn btn-block btn-secondary mt-3"
onClick={linkEvent(this, this.handleLogoutClick)}
>
- { i18n.t('logout') }
+ {i18n.t('logout')}
</button>
) : (
<>
<div>
<div class="card border-secondary mb-3">
<div class="card-body">
- <h5>
- { i18n.t('settings') }
- </h5>
+ <h5>{i18n.t('settings')}</h5>
<form onSubmit={linkEvent(this, this.handleUserSettingsSubmit)}>
<div class="form-group">
- <label>
- { i18n.t('avatar') }
- </label>
+ <label>{i18n.t('avatar')}</label>
<form class="d-inline">
<label
htmlFor="file-upload"
>
{!this.state.userSettingsForm.avatar ? (
<span class="btn btn-sm btn-secondary">
- { i18n.t('upload_avatar') }
+ {i18n.t('upload_avatar')}
</span>
) : (
<img
</form>
</div>
<div class="form-group">
- <label>
- { i18n.t('language') }
- </label>
+ <label>{i18n.t('language')}</label>
<select
value={this.state.userSettingsForm.lang}
onChange={linkEvent(this, this.handleUserSettingsLangChange)}
class="ml-2 custom-select custom-select-sm w-auto"
>
- <option disabled>
- { i18n.t('language') }
- </option>
- <option value="browser">
- { i18n.t('browser_default') }
- </option>
+ <option disabled>{i18n.t('language')}</option>
+ <option value="browser">{i18n.t('browser_default')}</option>
<option disabled>──</option>
{languages.map(lang => (
<option value={lang.code}>{lang.name}</option>
</select>
</div>
<div class="form-group">
- <label>
- { i18n.t('theme') }
- </label>
+ <label>{i18n.t('theme')}</label>
<select
value={this.state.userSettingsForm.theme}
onChange={linkEvent(this, this.handleUserSettingsThemeChange)}
class="ml-2 custom-select custom-select-sm w-auto"
>
- <option disabled>
- { i18n.t('theme') }
- </option>
+ <option disabled>{i18n.t('theme')}</option>
{themes.map(theme => (
<option value={theme}>{theme}</option>
))}
</div>
<form className="form-group">
<label>
- <T i18nKey="sort_type" class="mr-2">
- #
- </T>
+ <div class="mr-2">{i18n.t('sort_type')}</div>
</label>
<ListingTypeSelect
type_={this.state.userSettingsForm.default_listing_type}
</form>
<form className="form-group">
<label>
- <T i18nKey="type" class="mr-2">
- #
- </T>
+ <div class="mr-2">{i18n.t('type')}</div>
</label>
<SortSelect
sort={this.state.userSettingsForm.default_sort_type}
/>
</form>
<div class="form-group row">
- <label class="col-lg-3 col-form-label" for="user-email">
- { i18n.t('email') }
+ <label class="col-lg-3 col-form-label" htmlFor="user-email">
+ {i18n.t('email')}
</label>
<div class="col-lg-9">
<input
</div>
</div>
<div class="form-group row">
- <label class="col-lg-5 col-form-label" for="user-password">
- { i18n.t('new_password') }
+ <label class="col-lg-5 col-form-label" htmlFor="user-password">
+ {i18n.t('new_password')}
</label>
<div class="col-lg-7">
<input
</div>
</div>
<div class="form-group row">
- <label class="col-lg-5 col-form-label" for="user-verify-password">
- { i18n.t('verify_password') }
+ <label
+ class="col-lg-5 col-form-label"
+ htmlFor="user-verify-password"
+ >
+ {i18n.t('verify_password')}
</label>
<div class="col-lg-7">
<input
</div>
</div>
<div class="form-group row">
- <label class="col-lg-5 col-form-label" for="user-old-password">
- { i18n.t('old_password') }
+ <label
+ class="col-lg-5 col-form-label"
+ htmlFor="user-old-password"
+ >
+ {i18n.t('old_password')}
</label>
<div class="col-lg-7">
<input
this.handleUserSettingsShowNsfwChange
)}
/>
- <label class="form-check-label" for="user-show-nsfw">
- { i18n.t('show_nsfw') }
+ <label class="form-check-label" htmlFor="user-show-nsfw">
+ {i18n.t('show_nsfw')}
</label>
</div>
</div>
this.handleUserSettingsShowAvatarsChange
)}
/>
- <label class="form-check-label" for="user-show-avatars">
- { i18n.t('show_avatars') }
+ <label class="form-check-label" htmlFor="user-show-avatars">
+ {i18n.t('show_avatars')}
</label>
</div>
</div>
this.handleUserSettingsSendNotificationsToEmailChange
)}
/>
- <label class="form-check-label" for="user-send-notifications-to-email">
- { i18n.t('send_notifications_to_email') }
+ <label
+ class="form-check-label"
+ htmlFor="user-send-notifications-to-email"
+ >
+ {i18n.t('send_notifications_to_email')}
</label>
</div>
</div>
this.handleDeleteAccountShowConfirmToggle
)}
>
- { i18n.t('delete_account') }
+ {i18n.t('delete_account')}
</button>
{this.state.deleteAccountShowConfirm && (
<>
<div class="my-2 alert alert-danger" role="alert">
- { i18n.t('delete_account_confirm') }
+ {i18n.t('delete_account_confirm')}
</div>
<input
type="password"
this.handleDeleteAccountShowConfirmToggle
)}
>
- { i18n.t('cancel') }
+ {i18n.t('cancel')}
</button>
</>
)}
{this.state.moderates.length > 0 && (
<div class="card border-secondary mb-3">
<div class="card-body">
- <h5>
- { i18n.t('moderates') }
- </h5>
+ <h5>{i18n.t('moderates')}</h5>
<ul class="list-unstyled mb-0">
{this.state.moderates.map(community => (
<li>
{this.state.follows.length > 0 && (
<div class="card border-secondary mb-3">
<div class="card-body">
- <h5>
- { i18n.t('subscribed') }
- </h5>
+ <h5>{i18n.t('subscribed')}</h5>
<ul class="list-unstyled mb-0">
{this.state.follows.map(community => (
<li>
class="btn btn-sm btn-secondary mr-1"
onClick={linkEvent(this, this.prevPage)}
>
- <T i18nKey="prev">#</T>
+ {i18n.t('prev')}
</button>
)}
<button
class="btn btn-sm btn-secondary"
onClick={linkEvent(this, this.nextPage)}
>
- { i18n.t('next') }
+ {i18n.t('next')}
</button>
</div>
);
if (data.comment.my_vote !== null) found.my_vote = data.comment.my_vote;
this.setState(this.state);
} else if (res.op == UserOperation.CreatePostLike) {
- let data = res.data as CreatePostLikeResponse;
+ let data = res.data as PostResponse;
let found = this.state.posts.find(c => c.id == data.post.id);
found.my_vote = data.post.my_vote;
found.score = data.post.score;