PurgeCommunity,
RemoveCommunity,
} from "lemmy-js-client";
-import { i18n } from "../../i18next";
import { mdToHtml } from "../../markdown";
-import { UserService } from "../../services";
+import { I18NextService, UserService } from "../../services";
import { Badges } from "../common/badges";
import { BannerIconHeader } from "../common/banner-icon-header";
import { Icon, PurgeWarning, Spinner } from "../common/icon";
) : (
<>
<Icon icon="check" classes="icon-inline text-success me-1" />
- {i18n.t("joined")}
+ {I18NextService.i18n.t("joined")}
</>
)}
</button>
{this.state.followCommunityLoading ? (
<Spinner />
) : (
- i18n.t("subscribe_pending")
+ I18NextService.i18n.t("subscribe_pending")
)}
</button>
)}
{community.removed && (
<small className="me-2 text-muted font-italic">
- {i18n.t("removed")}
+ {I18NextService.i18n.t("removed")}
</small>
)}
{community.deleted && (
<small className="me-2 text-muted font-italic">
- {i18n.t("deleted")}
+ {I18NextService.i18n.t("deleted")}
</small>
)}
{community.nsfw && (
<small className="me-2 text-muted font-italic">
- {i18n.t("nsfw")}
+ {I18NextService.i18n.t("nsfw")}
</small>
)}
</h5>
mods() {
return (
<ul className="list-inline small">
- <li className="list-inline-item">{i18n.t("mods")}: </li>
+ <li className="list-inline-item">{I18NextService.i18n.t("mods")}: </li>
{this.props.moderators.map(mod => (
<li key={mod.moderator.id} className="list-inline-item">
<PersonListing person={mod.moderator} />
}`}
to={`/create_post?communityId=${cv.community.id}`}
>
- {i18n.t("create_a_post")}
+ {I18NextService.i18n.t("create_a_post")}
</Link>
);
}
{this.state.followCommunityLoading ? (
<Spinner />
) : (
- i18n.t("subscribe")
+ I18NextService.i18n.t("subscribe")
)}
</button>
)}
className="btn btn-danger d-block mb-2 w-100"
onClick={linkEvent(this, this.handleBlockCommunity)}
>
- {i18n.t(blocked ? "unblock_community" : "block_community")}
+ {I18NextService.i18n.t(
+ blocked ? "unblock_community" : "block_community"
+ )}
</button>
)}
</>
<button
className="btn btn-link text-muted d-inline-block"
onClick={linkEvent(this, this.handleEditClick)}
- data-tippy-content={i18n.t("edit")}
- aria-label={i18n.t("edit")}
+ data-tippy-content={I18NextService.i18n.t("edit")}
+ aria-label={I18NextService.i18n.t("edit")}
>
<Icon icon="edit" classes="icon-inline" />
</button>
this.handleShowConfirmLeaveModTeamClick
)}
>
- {i18n.t("leave_mod_team")}
+ {I18NextService.i18n.t("leave_mod_team")}
</button>
</li>
) : (
<>
<li className="list-inline-item-action">
- {i18n.t("are_you_sure")}
+ {I18NextService.i18n.t("are_you_sure")}
</li>
<li className="list-inline-item-action">
<button
className="btn btn-link text-muted d-inline-block"
onClick={linkEvent(this, this.handleLeaveModTeam)}
>
- {i18n.t("yes")}
+ {I18NextService.i18n.t("yes")}
</button>
</li>
<li className="list-inline-item-action">
this.handleCancelLeaveModTeamClick
)}
>
- {i18n.t("no")}
+ {I18NextService.i18n.t("no")}
</button>
</li>
</>
onClick={linkEvent(this, this.handleDeleteCommunity)}
data-tippy-content={
!community_view.community.deleted
- ? i18n.t("delete")
- : i18n.t("restore")
+ ? I18NextService.i18n.t("delete")
+ : I18NextService.i18n.t("restore")
}
aria-label={
!community_view.community.deleted
- ? i18n.t("delete")
- : i18n.t("restore")
+ ? I18NextService.i18n.t("delete")
+ : I18NextService.i18n.t("restore")
}
>
{this.state.deleteCommunityLoading ? (
className="btn btn-link text-muted d-inline-block"
onClick={linkEvent(this, this.handleModRemoveShow)}
>
- {i18n.t("remove")}
+ {I18NextService.i18n.t("remove")}
</button>
) : (
<button
{this.state.removeCommunityLoading ? (
<Spinner />
) : (
- i18n.t("restore")
+ I18NextService.i18n.t("restore")
)}
</button>
)}
<button
className="btn btn-link text-muted d-inline-block"
onClick={linkEvent(this, this.handlePurgeCommunityShow)}
- aria-label={i18n.t("purge_community")}
+ aria-label={I18NextService.i18n.t("purge_community")}
>
- {i18n.t("purge_community")}
+ {I18NextService.i18n.t("purge_community")}
</button>
</li>
)}
<form onSubmit={linkEvent(this, this.handleRemoveCommunity)}>
<div className="input-group mb-3">
<label className="col-form-label" htmlFor="remove-reason">
- {i18n.t("reason")}
+ {I18NextService.i18n.t("reason")}
</label>
<input
type="text"
id="remove-reason"
className="form-control me-2"
- placeholder={i18n.t("optional")}
+ placeholder={I18NextService.i18n.t("optional")}
value={this.state.removeReason}
onInput={linkEvent(this, this.handleModRemoveReasonChange)}
/>
{/* TODO hold off on expires for now */}
{/* <div class="mb-3 row"> */}
{/* <label class="col-form-label">Expires</label> */}
- {/* <input type="date" class="form-control me-2" placeholder={i18n.t('expires')} value={this.state.removeExpires} onInput={linkEvent(this, this.handleModRemoveExpiresChange)} /> */}
+ {/* <input type="date" class="form-control me-2" placeholder={I18NextService.i18n.t('expires')} value={this.state.removeExpires} onInput={linkEvent(this, this.handleModRemoveExpiresChange)} /> */}
{/* </div> */}
<div className="input-group mb-3">
<button type="submit" className="btn btn-secondary">
{this.state.removeCommunityLoading ? (
<Spinner />
) : (
- i18n.t("remove_community")
+ I18NextService.i18n.t("remove_community")
)}
</button>
</div>
</div>
<div className="input-group mb-3">
<label className="visually-hidden" htmlFor="purge-reason">
- {i18n.t("reason")}
+ {I18NextService.i18n.t("reason")}
</label>
<input
type="text"
id="purge-reason"
className="form-control me-2"
- placeholder={i18n.t("reason")}
+ placeholder={I18NextService.i18n.t("reason")}
value={this.state.purgeReason}
onInput={linkEvent(this, this.handlePurgeReasonChange)}
/>
<button
type="submit"
className="btn btn-secondary"
- aria-label={i18n.t("purge_community")}
+ aria-label={I18NextService.i18n.t("purge_community")}
>
- {i18n.t("purge_community")}
+ {I18NextService.i18n.t("purge_community")}
</button>
)}
</div>