feat: add typescript support to i18next
This commit is contained in:
@@ -3,10 +3,11 @@ import "dayjs/locale/zh-cn";
|
||||
import relativeTime from "dayjs/plugin/relativeTime";
|
||||
import isToday from "dayjs/plugin/isToday";
|
||||
import isYesterday from "dayjs/plugin/isYesterday";
|
||||
import i18n from '../i18n';
|
||||
// import i18n from '../i18n';
|
||||
|
||||
dayjs.extend(relativeTime);
|
||||
dayjs.extend(isToday);
|
||||
dayjs.extend(isYesterday);
|
||||
|
||||
dayjs.locale(i18n.language == "en" ? "en" : "zh-cn");
|
||||
// console.log("dddd", i18n.resolvedLanguage);
|
||||
// if(i18n.language)
|
||||
// dayjs.locale(i18n.language == "en" ? "en" : "zh-cn");
|
||||
|
||||
@@ -100,7 +100,7 @@ const ChannelModal: FC<Props> = ({ personal = false, closeModal }) => {
|
||||
<input
|
||||
value={input}
|
||||
onChange={handleInputChange}
|
||||
placeholder={t("search_user_placeholder") || ""}
|
||||
placeholder={t("search_user_placeholder")}
|
||||
/>
|
||||
</div>
|
||||
{users && (
|
||||
|
||||
@@ -97,7 +97,7 @@ const InviteByEmail: FC<Props> = ({ cid }) => {
|
||||
onChange={handleEmail}
|
||||
disabled={!enableSMTP}
|
||||
type="email"
|
||||
placeholder={enableSMTP ? "Enter Email" : t("enable_smtp") || ""}
|
||||
placeholder={enableSMTP ? "Enter Email" : t("enable_smtp")}
|
||||
/>
|
||||
<Button disabled={!enableSMTP || !email} className="send">
|
||||
{t("action.send", { ns: "common" })}
|
||||
|
||||
@@ -30,11 +30,11 @@ const LeaveConfirmModal: FC<Props> = ({ id, closeModal, handleNextStep }) => {
|
||||
<Modal id="modal-modal">
|
||||
<StyledModal
|
||||
className="compact"
|
||||
title={t("channel.leave") || ""}
|
||||
title={t("channel.leave")}
|
||||
description={
|
||||
isOwner
|
||||
? t("channel.transfer_desc") || ""
|
||||
: t("channel.leave_desc") || ""
|
||||
? t("channel.transfer_desc")
|
||||
: t("channel.leave_desc")
|
||||
}
|
||||
buttons={
|
||||
<>
|
||||
|
||||
@@ -60,7 +60,7 @@ const PinMessageModal: FC<Props> = ({ closeModal, mid = 0, gid = 0 }) => {
|
||||
</Button>
|
||||
</>
|
||||
}
|
||||
title={t("action.pin") || ""}
|
||||
title={t("action.pin")}
|
||||
description={`Do you want to pin this message to #${channel?.name}`}
|
||||
>
|
||||
<PreviewMessage mid={mid} />
|
||||
|
||||
@@ -70,7 +70,7 @@ const UsersModal: FC<Props> = ({ closeModal }) => {
|
||||
<Modal>
|
||||
<StyledWrapper ref={wrapperRef}>
|
||||
<div className="search">
|
||||
<input value={input} onChange={handleSearch} placeholder={t("search_user_placeholder") || ""} />
|
||||
<input value={input} onChange={handleSearch} placeholder={t("search_user_placeholder")} />
|
||||
</div>
|
||||
{users && (
|
||||
<ul className="users">
|
||||
|
||||
Reference in New Issue
Block a user