import autosize from 'autosize';
import Tribute from 'tributejs/src/Tribute.js';
import { i18n } from '../i18next';
-import { T } from 'inferno-i18next';
interface CommentFormProps {
postId?: number;
.previewMode && 'active'}`}
onClick={linkEvent(this, this.handlePreviewToggle)}
>
- <T i18nKey="preview">#</T>
+ {i18n.t('preview')}
</button>
)}
{this.props.node && (
class="btn btn-sm btn-secondary mr-2"
onClick={linkEvent(this, this.handleReplyCancel)}
>
- <T i18nKey="cancel">#</T>
+ {i18n.t('cancel')}
</button>
)}
<a
target="_blank"
class="d-inline-block float-right text-muted small font-weight-bold"
>
- <T i18nKey="formatting_help">#</T>
+ {i18n.t('formatting_help')}
</a>
<form class="d-inline-block mr-2 float-right text-muted small font-weight-bold">
<label
htmlFor={`file-upload-${this.id}`}
className={`${UserService.Instance.user && 'pointer'}`}
>
- <T i18nKey="upload_image">#</T>
+ {i18n.t('upload_image')}
</label>
<input
id={`file-upload-${this.id}`}
import { CommentForm } from './comment-form';
import { CommentNodes } from './comment-nodes';
import { i18n } from '../i18next';
-import { T } from 'inferno-i18next';
interface CommentNodeState {
showReply: boolean;
</li>
{this.isMod && (
<li className="list-inline-item badge badge-light">
- <T i18nKey="mod">#</T>
+ {i18n.t('mod')}
</li>
)}
{this.isAdmin && (
<li className="list-inline-item badge badge-light">
- <T i18nKey="admin">#</T>
+ {i18n.t('admin')}
</li>
)}
{this.isPostCreator && (
<li className="list-inline-item badge badge-light">
- <T i18nKey="creator">#</T>
+ {i18n.t('creator')}
</li>
)}
{(node.comment.banned_from_community || node.comment.banned) && (
<li className="list-inline-item badge badge-danger">
- <T i18nKey="banned">#</T>
+ {i18n.t('banned')}
</li>
)}
<li className="list-inline-item">
class="pointer"
onClick={linkEvent(this, this.handleReplyClick)}
>
- <T i18nKey="reply">#</T>
+ {i18n.t('reply')}
</span>
</li>
<li className="list-inline-item mr-2">
class="pointer"
onClick={linkEvent(this, this.handleEditClick)}
>
- <T i18nKey="edit">#</T>
+ {i18n.t('edit')}
</span>
</li>
<li className="list-inline-item">
className="pointer"
onClick={linkEvent(this, this.handleViewSource)}
>
- <T i18nKey="view_source">#</T>
+ {i18n.t('view_source')}
</span>
</li>
<li className="list-inline-item">
className="text-muted"
to={`/post/${node.comment.post_id}/comment/${node.comment.id}`}
>
- <T i18nKey="link">#</T>
+ {i18n.t('link')}
</Link>
</li>
{/* Admins and mods can remove comments */}
this.handleModRemoveShow
)}
>
- <T i18nKey="remove">#</T>
+ {i18n.t('remove')}
</span>
) : (
<span
this.handleModRemoveSubmit
)}
>
- <T i18nKey="restore">#</T>
+ {i18n.t('restore')}
</span>
)}
</li>
this.handleModBanFromCommunityShow
)}
>
- <T i18nKey="ban">#</T>
+ {i18n.t('ban')}
</span>
) : (
<span
this.handleModBanFromCommunitySubmit
)}
>
- <T i18nKey="unban">#</T>
+ {i18n.t('unban')}
</span>
)}
</li>
) : (
<>
<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.handleAddModToCommunity
)}
>
- <T i18nKey="yes">#</T>
+ {i18n.t('yes')}
</span>
<span
class="pointer d-inline-block"
this.handleCancelConfirmAppointAsMod
)}
>
- <T i18nKey="no">#</T>
+ {i18n.t('no')}
</span>
</>
)}
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
)}
>
- <T i18nKey="yes">#</T>
+ {i18n.t('yes')}
</span>
<span
class="pointer d-inline-block"
this.handleCancelShowConfirmTransferCommunity
)}
>
- <T i18nKey="no">#</T>
+ {i18n.t('no')}
</span>
</>
)}
class="pointer"
onClick={linkEvent(this, this.handleModBanShow)}
>
- <T i18nKey="ban_from_site">#</T>
+ {i18n.t('ban_from_site')}
</span>
) : (
<span
this.handleModBanSubmit
)}
>
- <T i18nKey="unban_from_site">#</T>
+ {i18n.t('unban_from_site')}
</span>
)}
</li>
) : (
<>
<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"
onClick={linkEvent(this, this.handleAddAdmin)}
>
- <T i18nKey="yes">#</T>
+ {i18n.t('yes')}
</span>
<span
class="pointer d-inline-block"
this.handleCancelConfirmAppointAsAdmin
)}
>
- <T i18nKey="no">#</T>
+ {i18n.t('no')}
</span>
</>
)}
this.handleShowConfirmTransferSite
)}
>
- <T i18nKey="transfer_site">#</T>
+ {i18n.t('transfer_site')}
</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"
onClick={linkEvent(this, this.handleTransferSite)}
>
- <T i18nKey="yes">#</T>
+ {i18n.t('yes')}
</span>
<span
class="pointer d-inline-block"
this.handleCancelShowConfirmTransferSite
)}
>
- <T i18nKey="no">#</T>
+ {i18n.t('no')}
</span>
</>
)}
onInput={linkEvent(this, this.handleModRemoveReasonChange)}
/>
<button type="submit" class="btn btn-secondary">
- <T i18nKey="remove_comment">#</T>
+ {i18n.t('remove_comment')}
</button>
</form>
)}
{this.state.showBanDialog && (
<form onSubmit={linkEvent(this, this.handleModBanBothSubmit)}>
<div class="form-group row">
- <label class="col-form-label">
- <T i18nKey="reason">#</T>
- </label>
+ <label class="col-form-label">{i18n.t('reason')}</label>
<input
type="text"
class="form-control mr-2"