diff options
author | Dessalines <tyhou13@gmx.com> | 2020-02-02 13:50:44 -0500 |
---|---|---|
committer | Dessalines <tyhou13@gmx.com> | 2020-02-02 13:50:44 -0500 |
commit | ac943f8951fe7da86aaa9f41ee879ab670786c86 (patch) | |
tree | c8aabdada00514135c35d2aa9be6890a95bac743 | |
parent | 23daba54b4dbc3220effaa5d55042db5398cde43 (diff) |
Finishing up interpolation rework.
-rw-r--r-- | README.md | 24 | ||||
-rw-r--r-- | ui/src/components/communities.tsx | 37 | ||||
-rw-r--r-- | ui/src/components/community-form.tsx | 24 | ||||
-rw-r--r-- | ui/src/components/community.tsx | 17 | ||||
-rw-r--r-- | ui/src/components/create-community.tsx | 5 | ||||
-rw-r--r-- | ui/src/components/create-post.tsx | 5 | ||||
-rw-r--r-- | ui/src/components/inbox.tsx | 42 | ||||
-rw-r--r-- | ui/src/components/login.tsx | 45 | ||||
-rw-r--r-- | ui/src/components/main.tsx | 84 | ||||
-rw-r--r-- | ui/src/components/modlog.tsx | 15 | ||||
-rw-r--r-- | ui/src/components/navbar.tsx | 13 | ||||
-rw-r--r-- | ui/src/components/password_change.tsx | 9 | ||||
-rw-r--r-- | ui/src/components/post-form.tsx | 45 | ||||
-rw-r--r-- | ui/src/components/post-listing.tsx | 68 | ||||
-rw-r--r-- | ui/src/components/post-listings.tsx | 9 | ||||
-rw-r--r-- | ui/src/components/post.tsx | 14 | ||||
-rw-r--r-- | ui/src/components/search.tsx | 45 | ||||
-rw-r--r-- | ui/src/components/setup.tsx | 23 | ||||
-rw-r--r-- | ui/src/components/sidebar.tsx | 52 | ||||
-rw-r--r-- | ui/src/components/site-form.tsx | 27 | ||||
-rw-r--r-- | ui/src/components/sort-select.tsx | 33 | ||||
-rw-r--r-- | ui/src/components/user.tsx | 156 |
22 files changed, 308 insertions, 484 deletions
@@ -167,18 +167,18 @@ If you'd like to add translations, take a look at the [English translation file] 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: diff --git a/ui/src/components/communities.tsx b/ui/src/components/communities.tsx index eef39ccf..8d130ae7 100644 --- a/ui/src/components/communities.tsx +++ b/ui/src/components/communities.tsx @@ -15,7 +15,6 @@ import { import { WebSocketService } from '../services'; import { wsJsonToRes, toast } from '../utils'; import { i18n } from '../i18next'; -import { T } from 'inferno-i18next'; declare const Sortable: any; @@ -76,37 +75,27 @@ export class Communities extends Component<any, CommunitiesState> { 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> @@ -139,7 +128,7 @@ export class Communities extends Component<any, CommunitiesState> { this.handleUnsubscribe )} > - <T i18nKey="unsubscribe">#</T> + {i18n.t('unsubscribe')} </span> ) : ( <span @@ -149,7 +138,7 @@ export class Communities extends Component<any, CommunitiesState> { this.handleSubscribe )} > - { i18n.t('subscribe') } + {i18n.t('subscribe')} </span> )} </td> @@ -173,7 +162,7 @@ export class Communities extends Component<any, CommunitiesState> { class="btn btn-sm btn-secondary mr-1" onClick={linkEvent(this, this.prevPage)} > - { i18n.t('prev') } + {i18n.t('prev')} </button> )} @@ -182,7 +171,7 @@ export class Communities extends Component<any, CommunitiesState> { class="btn btn-sm btn-secondary" onClick={linkEvent(this, this.nextPage)} > - { i18n.t('next') } + {i18n.t('next')} </button> )} </div> diff --git a/ui/src/components/community-form.tsx b/ui/src/components/community-form.tsx index 46fc4185..aaa3e6c4 100644 --- a/ui/src/components/community-form.tsx +++ b/ui/src/components/community-form.tsx @@ -21,7 +21,6 @@ import { import Tribute from 'tributejs/src/Tribute.js'; import autosize from 'autosize'; import { i18n } from '../i18next'; -import { T } from 'inferno-i18next'; import { Community } from '../interfaces'; @@ -108,8 +107,8 @@ export class CommunityForm extends Component< 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 @@ -128,8 +127,8 @@ export class CommunityForm extends Component< </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 @@ -145,14 +144,13 @@ export class CommunityForm extends Component< </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} @@ -161,8 +159,8 @@ export class CommunityForm extends Component< </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 @@ -189,8 +187,8 @@ export class CommunityForm extends Component< 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> @@ -215,7 +213,7 @@ export class CommunityForm extends Component< class="btn btn-secondary" onClick={linkEvent(this, this.handleCancel)} > - { i18n.t('cancel') } + {i18n.t('cancel')} </button> )} </div> diff --git a/ui/src/components/community.tsx b/ui/src/components/community.tsx index 30756344..da456fe5 100644 --- a/ui/src/components/community.tsx +++ b/ui/src/components/community.tsx @@ -14,7 +14,7 @@ import { GetCommunityForm, ListingType, GetPostsResponse, - CreatePostLikeResponse, + PostResponse, WebSocketJsonResponse, } from '../interfaces'; import { WebSocketService, UserService } from '../services'; @@ -28,7 +28,6 @@ import { postRefetchSeconds, toast, } from '../utils'; -import { T } from 'inferno-i18next'; import { i18n } from '../i18next'; interface State { @@ -128,11 +127,11 @@ export class Community extends Component<any, 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"> @@ -140,12 +139,12 @@ export class Community extends Component<any, State> { {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> @@ -192,7 +191,7 @@ export class Community extends Component<any, State> { 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 && ( @@ -200,7 +199,7 @@ export class Community extends Component<any, State> { class="btn btn-sm btn-secondary" onClick={linkEvent(this, this.nextPage)} > - { i18n.t('next') } + {i18n.t('next')} </button> )} </div> @@ -287,7 +286,7 @@ export class Community extends Component<any, State> { 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; diff --git a/ui/src/components/create-community.tsx b/ui/src/components/create-community.tsx index 49cfb0e9..5c7a0a9b 100644 --- a/ui/src/components/create-community.tsx +++ b/ui/src/components/create-community.tsx @@ -3,7 +3,6 @@ import { CommunityForm } from './community-form'; 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) { @@ -22,9 +21,7 @@ export class CreateCommunity extends Component<any, 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> diff --git a/ui/src/components/create-post.tsx b/ui/src/components/create-post.tsx index 39a5e5f0..adbdfb58 100644 --- a/ui/src/components/create-post.tsx +++ b/ui/src/components/create-post.tsx @@ -3,7 +3,6 @@ import { PostForm } from './post-form'; 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) { @@ -22,9 +21,7 @@ export class CreatePost extends Component<any, 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> diff --git a/ui/src/components/inbox.tsx b/ui/src/components/inbox.tsx index c89beb40..d4fdf910 100644 --- a/ui/src/components/inbox.tsx +++ b/ui/src/components/inbox.tsx @@ -122,7 +122,7 @@ export class Inbox extends Component<any, InboxState> { <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> @@ -147,40 +147,20 @@ export class Inbox extends Component<any, InboxState> { 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} @@ -252,14 +232,14 @@ export class Inbox extends Component<any, InboxState> { 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> ); diff --git a/ui/src/components/login.tsx b/ui/src/components/login.tsx index 1aacac0e..8eee016e 100644 --- a/ui/src/components/login.tsx +++ b/ui/src/components/login.tsx @@ -13,7 +13,6 @@ import { import { WebSocketService, UserService } from '../services'; import { wsJsonToRes, validEmail, toast } from '../utils'; import { i18n } from '../i18next'; -import { T } from 'inferno-i18next'; interface State { loginForm: LoginForm; @@ -78,10 +77,13 @@ export class Login extends Component<any, State> { 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 @@ -96,8 +98,8 @@ export class Login extends Component<any, State> { </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 @@ -113,7 +115,7 @@ export class Login extends Component<any, State> { 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> @@ -137,13 +139,11 @@ export class Login extends Component<any, State> { 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"> @@ -162,8 +162,8 @@ export class Login extends Component<any, State> { </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 @@ -179,8 +179,8 @@ export class Login extends Component<any, State> { </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 @@ -195,8 +195,11 @@ export class Login extends Component<any, State> { </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 @@ -210,7 +213,7 @@ export class Login extends Component<any, State> { </div> </div> - { this.state.enable_nsfw && ( + {this.state.enable_nsfw && ( <div class="form-group row"> <div class="col-sm-10"> <div class="form-check"> @@ -221,8 +224,8 @@ export class Login extends Component<any, State> { 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> diff --git a/ui/src/components/main.tsx b/ui/src/components/main.tsx index e578cc83..b39cec8b 100644 --- a/ui/src/components/main.tsx +++ b/ui/src/components/main.tsx @@ -14,7 +14,7 @@ import { ListingType, SiteResponse, GetPostsResponse, - CreatePostLikeResponse, + PostResponse, Post, GetPostsForm, WebSocketJsonResponse, @@ -159,7 +159,9 @@ export class Main extends Component<any, MainState> { 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> @@ -200,7 +202,7 @@ export class Main extends Component<any, MainState> { 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> @@ -270,73 +272,43 @@ export class Main extends Component<any, MainState> { 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_com |