mirror of https://github.com/casbin/casnode.git
Improve translation.
This commit is contained in:
parent
045d8d298e
commit
4747f60ce3
|
@ -35,4 +35,5 @@ func TestGenerateI18nStrings(t *testing.T) {
|
|||
applyToOtherLanguage(dataEn, "ru")
|
||||
applyToOtherLanguage(dataEn, "zh")
|
||||
applyToOtherLanguage(dataEn, "zh-TW")
|
||||
applyToOtherLanguage(dataEn, "kk")
|
||||
}
|
||||
|
|
|
@ -224,6 +224,7 @@
|
|||
"Total Replies": "Total Replies",
|
||||
"Total Topics": "Total Topics",
|
||||
"Watch": "Watch",
|
||||
"You have signed out completely, no personal information is left on this computer.": "You have signed out completely, no personal information is left on this computer.",
|
||||
"authorized to manage the community": "authorized to manage the community",
|
||||
"member, joined on": "member, joined on",
|
||||
"replied": "replied"
|
||||
|
@ -250,16 +251,14 @@
|
|||
"Already enabled Markdown": "Already enabled Markdown",
|
||||
"Body": "Body",
|
||||
"Hottest Nodes": "Hottest Nodes",
|
||||
"MarkDown": "MarkDown",
|
||||
"Markdown": "Markdown",
|
||||
"New Topic": "New Topic",
|
||||
"Please select a node": "Please select a node",
|
||||
"Preview": "Preview",
|
||||
"Publish": "Publish",
|
||||
"RichText": "RichText",
|
||||
"Switch editor": "Switch editor",
|
||||
"Topic Title": "Topic Title",
|
||||
"markdown": "MarkDown",
|
||||
"richtext": "RichText"
|
||||
"Topic Title": "Topic Title"
|
||||
},
|
||||
"newNodeTopic": {
|
||||
"Preview": "Preview",
|
||||
|
@ -384,6 +383,7 @@
|
|||
"reply": {
|
||||
"Add a New Comment": "Add a New Comment",
|
||||
"Back to Top": "Back to Top",
|
||||
"Cancel reply to {username}": "Cancel reply to {username}",
|
||||
"Delete": "Delete",
|
||||
"Edit": "Edit",
|
||||
"Make your comment helpful for others as much as possible": "Make your comment helpful for others as much as possible",
|
||||
|
|
|
@ -224,6 +224,7 @@
|
|||
"Total Replies": "Total Replies",
|
||||
"Total Topics": "Total Topics",
|
||||
"Watch": "Watch",
|
||||
"You have signed out completely, no personal information is left on this computer.": "You have signed out completely, no personal information is left on this computer.",
|
||||
"authorized to manage the community": "authorized to manage the community",
|
||||
"member, joined on": "member, joined on",
|
||||
"replied": "replied"
|
||||
|
@ -250,16 +251,14 @@
|
|||
"Already enabled Markdown": "Already enabled Markdown",
|
||||
"Body": "Body",
|
||||
"Hottest Nodes": "Hottest Nodes",
|
||||
"MarkDown": "MarkDown",
|
||||
"Markdown": "Markdown",
|
||||
"New Topic": "New Topic",
|
||||
"Please select a node": "Please select a node",
|
||||
"Preview": "Preview",
|
||||
"Publish": "Publish",
|
||||
"RichText": "RichText",
|
||||
"Switch editor": "Switch editor",
|
||||
"Topic Title": "Topic Title",
|
||||
"markdown": "markdown",
|
||||
"richtext": "richtext"
|
||||
"Topic Title": "Topic Title"
|
||||
},
|
||||
"newNodeTopic": {
|
||||
"Preview": "Preview",
|
||||
|
@ -384,6 +383,7 @@
|
|||
"reply": {
|
||||
"Add a New Comment": "Add a New Comment",
|
||||
"Back to Top": "Back to Top",
|
||||
"Cancel reply to {username}": "Cancel reply to {username}",
|
||||
"Delete": "Delete",
|
||||
"Edit": "Edit",
|
||||
"Make your comment helpful for others as much as possible": "Make your comment helpful for others as much as possible",
|
||||
|
|
|
@ -224,6 +224,7 @@
|
|||
"Total Replies": "Total Replies",
|
||||
"Total Topics": "Total Topics",
|
||||
"Watch": "Watch",
|
||||
"You have signed out completely, no personal information is left on this computer.": "You have signed out completely, no personal information is left on this computer.",
|
||||
"authorized to manage the community": "authorized to manage the community",
|
||||
"member, joined on": "member, joined on",
|
||||
"replied": "replied"
|
||||
|
@ -250,16 +251,14 @@
|
|||
"Already enabled Markdown": "Already enabled Markdown",
|
||||
"Body": "Body",
|
||||
"Hottest Nodes": "Hottest Nodes",
|
||||
"MarkDown": "MarkDown",
|
||||
"Markdown": "Markdown",
|
||||
"New Topic": "New Topic",
|
||||
"Please select a node": "Please select a node",
|
||||
"Preview": "Preview",
|
||||
"Publish": "Publish",
|
||||
"RichText": "RichText",
|
||||
"Switch editor": "Switch editor",
|
||||
"Topic Title": "Topic Title",
|
||||
"markdown": "MarkDown",
|
||||
"richtext": "RichText"
|
||||
"Topic Title": "Topic Title"
|
||||
},
|
||||
"newNodeTopic": {
|
||||
"Preview": "Preview",
|
||||
|
@ -384,6 +383,7 @@
|
|||
"reply": {
|
||||
"Add a New Comment": "Add a New Comment",
|
||||
"Back to Top": "Back to Top",
|
||||
"Cancel reply to {username}": "Cancel reply to {username}",
|
||||
"Delete": "Delete",
|
||||
"Edit": "Edit",
|
||||
"Make your comment helpful for others as much as possible": "Make your comment helpful for others as much as possible",
|
||||
|
|
|
@ -224,6 +224,7 @@
|
|||
"Total Replies": "Total Replies",
|
||||
"Total Topics": "Total Topics",
|
||||
"Watch": "Watch",
|
||||
"You have signed out completely, no personal information is left on this computer.": "You have signed out completely, no personal information is left on this computer.",
|
||||
"authorized to manage the community": "authorized to manage the community",
|
||||
"member, joined on": "member, joined on",
|
||||
"replied": "replied"
|
||||
|
@ -250,16 +251,14 @@
|
|||
"Already enabled Markdown": "Already enabled Markdown",
|
||||
"Body": "Body",
|
||||
"Hottest Nodes": "Hottest Nodes",
|
||||
"MarkDown": "MarkDown",
|
||||
"Markdown": "Markdown",
|
||||
"New Topic": "New Topic",
|
||||
"Please select a node": "Please select a node",
|
||||
"Preview": "Preview",
|
||||
"Publish": "Publish",
|
||||
"RichText": "RichText",
|
||||
"Switch editor": "Switch editor",
|
||||
"Topic Title": "Topic Title",
|
||||
"markdown": "MarkDown",
|
||||
"richtext": "RichText"
|
||||
"Topic Title": "Topic Title"
|
||||
},
|
||||
"newNodeTopic": {
|
||||
"Preview": "Preview",
|
||||
|
@ -384,6 +383,7 @@
|
|||
"reply": {
|
||||
"Add a New Comment": "Add a New Comment",
|
||||
"Back to Top": "Back to Top",
|
||||
"Cancel reply to {username}": "Cancel reply to {username}",
|
||||
"Delete": "Delete",
|
||||
"Edit": "Edit",
|
||||
"Make your comment helpful for others as much as possible": "Make your comment helpful for others as much as possible",
|
||||
|
|
|
@ -224,6 +224,7 @@
|
|||
"Total Replies": "Total Replies",
|
||||
"Total Topics": "Total Topics",
|
||||
"Watch": "Watch",
|
||||
"You have signed out completely, no personal information is left on this computer.": "You have signed out completely, no personal information is left on this computer.",
|
||||
"authorized to manage the community": "authorized to manage the community",
|
||||
"member, joined on": "member, joined on",
|
||||
"replied": "replied"
|
||||
|
@ -250,16 +251,14 @@
|
|||
"Already enabled Markdown": "Already enabled Markdown",
|
||||
"Body": "Body",
|
||||
"Hottest Nodes": "Hottest Nodes",
|
||||
"MarkDown": "MarkDown",
|
||||
"Markdown": "Markdown",
|
||||
"New Topic": "New Topic",
|
||||
"Please select a node": "Please select a node",
|
||||
"Preview": "Preview",
|
||||
"Publish": "Publish",
|
||||
"RichText": "RichText",
|
||||
"Switch editor": "Switch editor",
|
||||
"Topic Title": "Topic Title",
|
||||
"markdown": "markdown",
|
||||
"richtext": "richtext"
|
||||
"Topic Title": "Topic Title"
|
||||
},
|
||||
"newNodeTopic": {
|
||||
"Preview": "Preview",
|
||||
|
@ -384,6 +383,7 @@
|
|||
"reply": {
|
||||
"Add a New Comment": "Add a New Comment",
|
||||
"Back to Top": "Back to Top",
|
||||
"Cancel reply to {username}": "Cancel reply to {username}",
|
||||
"Delete": "Delete",
|
||||
"Edit": "Edit",
|
||||
"Make your comment helpful for others as much as possible": "Make your comment helpful for others as much as possible",
|
||||
|
|
|
@ -224,6 +224,7 @@
|
|||
"Total Replies": "Total Replies",
|
||||
"Total Topics": "Total Topics",
|
||||
"Watch": "Watch",
|
||||
"You have signed out completely, no personal information is left on this computer.": "You have signed out completely, no personal information is left on this computer.",
|
||||
"authorized to manage the community": "authorized to manage the community",
|
||||
"member, joined on": "member, joined on",
|
||||
"replied": "replied"
|
||||
|
@ -250,16 +251,14 @@
|
|||
"Already enabled Markdown": "Already enabled Markdown",
|
||||
"Body": "Body",
|
||||
"Hottest Nodes": "Hottest Nodes",
|
||||
"MarkDown": "MarkDown",
|
||||
"Markdown": "Markdown",
|
||||
"New Topic": "New Topic",
|
||||
"Please select a node": "Please select a node",
|
||||
"Preview": "Preview",
|
||||
"Publish": "Publish",
|
||||
"RichText": "RichText",
|
||||
"Switch editor": "Switch editor",
|
||||
"Topic Title": "Topic Title",
|
||||
"markdown": "MarkDown",
|
||||
"richtext": "RichText"
|
||||
"Topic Title": "Topic Title"
|
||||
},
|
||||
"newNodeTopic": {
|
||||
"Preview": "Preview",
|
||||
|
@ -384,6 +383,7 @@
|
|||
"reply": {
|
||||
"Add a New Comment": "Add a New Comment",
|
||||
"Back to Top": "Back to Top",
|
||||
"Cancel reply to {username}": "Cancel reply to {username}",
|
||||
"Delete": "Delete",
|
||||
"Edit": "Edit",
|
||||
"Make your comment helpful for others as much as possible": "Make your comment helpful for others as much as possible",
|
||||
|
|
|
@ -224,6 +224,7 @@
|
|||
"Total Replies": "Total Replies",
|
||||
"Total Topics": "Total Topics",
|
||||
"Watch": "Watch",
|
||||
"You have signed out completely, no personal information is left on this computer.": "You have signed out completely, no personal information is left on this computer.",
|
||||
"authorized to manage the community": "authorized to manage the community",
|
||||
"member, joined on": "member, joined on",
|
||||
"replied": "replied"
|
||||
|
@ -250,16 +251,14 @@
|
|||
"Already enabled Markdown": "Already enabled Markdown",
|
||||
"Body": "Body",
|
||||
"Hottest Nodes": "Hottest Nodes",
|
||||
"MarkDown": "MarkDown",
|
||||
"Markdown": "Markdown",
|
||||
"New Topic": "New Topic",
|
||||
"Please select a node": "Please select a node",
|
||||
"Preview": "Preview",
|
||||
"Publish": "Publish",
|
||||
"RichText": "RichText",
|
||||
"Switch editor": "Switch editor",
|
||||
"Topic Title": "Topic Title",
|
||||
"markdown": "MarkDown",
|
||||
"richtext": "RichText"
|
||||
"Topic Title": "Topic Title"
|
||||
},
|
||||
"newNodeTopic": {
|
||||
"Preview": "Preview",
|
||||
|
@ -384,6 +383,7 @@
|
|||
"reply": {
|
||||
"Add a New Comment": "Add a New Comment",
|
||||
"Back to Top": "Back to Top",
|
||||
"Cancel reply to {username}": "Cancel reply to {username}",
|
||||
"Delete": "Delete",
|
||||
"Edit": "Edit",
|
||||
"Make your comment helpful for others as much as possible": "Make your comment helpful for others as much as possible",
|
||||
|
|
|
@ -224,6 +224,7 @@
|
|||
"Total Replies": "回復總數",
|
||||
"Total Topics": "主題總數",
|
||||
"Watch": "加入特別關註",
|
||||
"You have signed out completely, no personal information is left on this computer.": "你已經完全登出,沒有任何個人信息留在這臺電腦上。",
|
||||
"authorized to manage the community": "具有管理社區的權限",
|
||||
"member, joined on": "號會員,加入於",
|
||||
"replied": "回復了"
|
||||
|
@ -250,16 +251,14 @@
|
|||
"Already enabled Markdown": "已啟用Markdown",
|
||||
"Body": "正文",
|
||||
"Hottest Nodes": "最熱節點",
|
||||
"MarkDown": "MarkDown",
|
||||
"Markdown": "Markdown",
|
||||
"New Topic": "創作新主題",
|
||||
"Please select a node": "請選擇一個節點",
|
||||
"Preview": "預覽主題",
|
||||
"Publish": "發布主題",
|
||||
"RichText": "富文本",
|
||||
"Switch editor": "切換編輯器",
|
||||
"Topic Title": "主題標題",
|
||||
"markdown": "Markdown",
|
||||
"richtext": "富文本"
|
||||
"Topic Title": "主題標題"
|
||||
},
|
||||
"newNodeTopic": {
|
||||
"Preview": "預覽",
|
||||
|
@ -384,6 +383,7 @@
|
|||
"reply": {
|
||||
"Add a New Comment": "添加一條新回復",
|
||||
"Back to Top": "回到頂部",
|
||||
"Cancel reply to {username}": "取消對 {username} 的回復",
|
||||
"Delete": "刪除",
|
||||
"Edit": "編輯",
|
||||
"Make your comment helpful for others as much as possible": "請盡量讓自己的回復能夠對別人有幫助",
|
||||
|
|
|
@ -224,6 +224,7 @@
|
|||
"Total Replies": "回复总数",
|
||||
"Total Topics": "主题总数",
|
||||
"Watch": "加入特别关注",
|
||||
"You have signed out completely, no personal information is left on this computer.": "你已经完全登出,没有任何个人信息留在这台电脑上。",
|
||||
"authorized to manage the community": "具有管理社区的权限",
|
||||
"member, joined on": "号会员,加入于",
|
||||
"replied": "回复了"
|
||||
|
@ -250,16 +251,14 @@
|
|||
"Already enabled Markdown": "已启用Markdown",
|
||||
"Body": "正文",
|
||||
"Hottest Nodes": "最热节点",
|
||||
"MarkDown": "MarkDown",
|
||||
"Markdown": "Markdown",
|
||||
"New Topic": "创作新主题",
|
||||
"Please select a node": "请选择一个节点",
|
||||
"Preview": "预览主题",
|
||||
"Publish": "发布主题",
|
||||
"RichText": "富文本",
|
||||
"Switch editor": "切换编辑器",
|
||||
"Topic Title": "主题标题",
|
||||
"markdown": "Markdown",
|
||||
"richtext": "富文本"
|
||||
"Topic Title": "主题标题"
|
||||
},
|
||||
"newNodeTopic": {
|
||||
"Preview": "预览",
|
||||
|
@ -384,6 +383,7 @@
|
|||
"reply": {
|
||||
"Add a New Comment": "添加一条新回复",
|
||||
"Back to Top": "回到顶部",
|
||||
"Cancel reply to {username}": "取消对 {username} 的回复",
|
||||
"Delete": "删除",
|
||||
"Edit": "编辑",
|
||||
"Make your comment helpful for others as much as possible": "请尽量让自己的回复能够对别人有帮助",
|
||||
|
|
|
@ -41,11 +41,11 @@ class EditBox extends React.Component {
|
|||
form: {},
|
||||
editor: [
|
||||
{
|
||||
text: i18next.t("new:markdown"),
|
||||
text: i18next.t("new:Markdown"),
|
||||
id: 0,
|
||||
},
|
||||
{
|
||||
text: i18next.t("new:richtext"),
|
||||
text: i18next.t("new:RichText"),
|
||||
id: 1,
|
||||
},
|
||||
],
|
||||
|
@ -99,9 +99,7 @@ class EditBox extends React.Component {
|
|||
// reply
|
||||
ReplyBackend.editReplyContent(this.state.form).then((res) => {
|
||||
if (res.status === "ok") {
|
||||
this.props.history.push(
|
||||
`/t/${this.state.editObject?.topicId}#r_${this.state.editObject?.id}`
|
||||
);
|
||||
this.props.history.push(`/t/${this.state.editObject?.topicId}#r_${this.state.editObject?.id}`);
|
||||
} else {
|
||||
Setting.showMessage("error", res?.msg);
|
||||
}
|
||||
|
@ -162,12 +160,12 @@ class EditBox extends React.Component {
|
|||
if (index === 0) {
|
||||
this.updateFormField("editorType", "markdown");
|
||||
this.setState({
|
||||
placeholder: i18next.t("new:markdown"),
|
||||
placeholder: i18next.t("new:Markdown"),
|
||||
});
|
||||
} else {
|
||||
this.updateFormField("editorType", "richtext");
|
||||
this.setState({
|
||||
placeholder: i18next.t("new:richtext"),
|
||||
placeholder: i18next.t("new:RichText"),
|
||||
});
|
||||
}
|
||||
}}
|
||||
|
@ -178,10 +176,7 @@ class EditBox extends React.Component {
|
|||
}
|
||||
|
||||
renderEditor() {
|
||||
if (
|
||||
!this.state.form.editorType ||
|
||||
this.state.form.editorType === "markdown"
|
||||
) {
|
||||
if (!this.state.form.editorType || this.state.form.editorType === "markdown") {
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
|
@ -251,14 +246,10 @@ class EditBox extends React.Component {
|
|||
return (
|
||||
<div className="box">
|
||||
<div className="header">
|
||||
<Link to="/">{Setting.getForumName()}</Link>{" "}
|
||||
<span className="chevron"> › </span>{" "}
|
||||
{i18next.t("loading:Content loading")}
|
||||
<Link to="/">{Setting.getForumName()}</Link> <span className="chevron"> › </span> {i18next.t("loading:Content loading")}
|
||||
</div>
|
||||
<div className="cell">
|
||||
<span className="gray bigger">
|
||||
{i18next.t("loading:Please wait patiently...")}
|
||||
</span>
|
||||
<span className="gray bigger">{i18next.t("loading:Please wait patiently...")}</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
@ -268,13 +259,9 @@ class EditBox extends React.Component {
|
|||
return (
|
||||
<div className="box">
|
||||
<div className="header">
|
||||
<Link to="/">{Setting.getForumName()}</Link>{" "}
|
||||
<span className="chevron"> › </span>{" "}
|
||||
{i18next.t("edit:Edit content")}
|
||||
</div>
|
||||
<div className="inner">
|
||||
{i18next.t("edit:You cannot edit this content.")}
|
||||
<Link to="/">{Setting.getForumName()}</Link> <span className="chevron"> › </span> {i18next.t("edit:Edit content")}
|
||||
</div>
|
||||
<div className="inner">{i18next.t("edit:You cannot edit this content.")}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -283,9 +270,7 @@ class EditBox extends React.Component {
|
|||
return (
|
||||
<div className="box">
|
||||
<div className="header">
|
||||
<Link to="/">{Setting.getForumName()}</Link>{" "}
|
||||
<span className="chevron"> › </span>{" "}
|
||||
{i18next.t("edit:Edit reply")}
|
||||
<Link to="/">{Setting.getForumName()}</Link> <span className="chevron"> › </span> {i18next.t("edit:Edit reply")}
|
||||
</div>
|
||||
<div className="cell">
|
||||
<table cellPadding="5" cellSpacing="0" border="0" width="100%">
|
||||
|
@ -294,16 +279,9 @@ class EditBox extends React.Component {
|
|||
<td>{this.renderEditor()}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td
|
||||
style={{ display: "flex", justifyContent: "space-between" }}
|
||||
>
|
||||
<td style={{ display: "flex", justifyContent: "space-between" }}>
|
||||
<div>
|
||||
<input
|
||||
type="submit"
|
||||
value={i18next.t("edit:Save")}
|
||||
className="super normal button"
|
||||
onClick={() => this.editContent()}
|
||||
/>
|
||||
<input type="submit" value={i18next.t("edit:Save")} className="super normal button" onClick={() => this.editContent()} />
|
||||
</div>
|
||||
{this.renderEditorSelect()}
|
||||
</td>
|
||||
|
@ -317,19 +295,9 @@ class EditBox extends React.Component {
|
|||
return (
|
||||
<div className="box">
|
||||
<div className="header">
|
||||
<Link to="/">{Setting.getForumName()}</Link>{" "}
|
||||
<span className="chevron"> › </span>
|
||||
<Link to={`/go/${encodeURIComponent(this.state.editObject?.nodeId)}`}>
|
||||
{" "}
|
||||
{this.state.editObject?.nodeName}
|
||||
</Link>{" "}
|
||||
<span className="chevron"> › </span>
|
||||
<Link to={`/t/${this.state.editObject?.id}`}>
|
||||
{" "}
|
||||
{pangu.spacing(this.state.editObject?.title)}
|
||||
</Link>{" "}
|
||||
<span className="chevron"> › </span>{" "}
|
||||
{i18next.t("edit:Edit topic")}
|
||||
<Link to="/">{Setting.getForumName()}</Link> <span className="chevron"> › </span>
|
||||
<Link to={`/go/${encodeURIComponent(this.state.editObject?.nodeId)}`}> {this.state.editObject?.nodeName}</Link> <span className="chevron"> › </span>
|
||||
<Link to={`/t/${this.state.editObject?.id}`}> {pangu.spacing(this.state.editObject?.title)}</Link> <span className="chevron"> › </span> {i18next.t("edit:Edit topic")}
|
||||
{/* todo */}
|
||||
</div>
|
||||
<div className="cell">
|
||||
|
@ -356,23 +324,15 @@ class EditBox extends React.Component {
|
|||
<TagsInput
|
||||
inputProps={{
|
||||
maxLength: "8",
|
||||
placeholder:
|
||||
"After adding tags press Enter,only add up to four tags,the length of each tag is up to 8",
|
||||
placeholder: "After adding tags press Enter,only add up to four tags,the length of each tag is up to 8",
|
||||
}}
|
||||
maxTags="4"
|
||||
value={this.state.tags}
|
||||
onChange={this.handleChange.bind(this)}
|
||||
/>
|
||||
<td
|
||||
style={{ display: "flex", justifyContent: "space-between" }}
|
||||
>
|
||||
<td style={{ display: "flex", justifyContent: "space-between" }}>
|
||||
<div>
|
||||
<input
|
||||
type="submit"
|
||||
value={i18next.t("edit:Save")}
|
||||
className="super normal button"
|
||||
onClick={() => this.editContent()}
|
||||
/>
|
||||
<input type="submit" value={i18next.t("edit:Save")} className="super normal button" onClick={() => this.editContent()} />
|
||||
</div>
|
||||
{this.renderEditorSelect()}
|
||||
</td>
|
||||
|
|
|
@ -48,11 +48,11 @@ class NewBox extends React.Component {
|
|||
nodeId: this.props.match.params.nodeId,
|
||||
editor: [
|
||||
{
|
||||
text: i18next.t("new:markdown"),
|
||||
text: i18next.t("new:Markdown"),
|
||||
id: 0,
|
||||
},
|
||||
{
|
||||
text: i18next.t("new:richtext"),
|
||||
text: i18next.t("new:RichText"),
|
||||
id: 1,
|
||||
},
|
||||
],
|
||||
|
@ -190,12 +190,12 @@ class NewBox extends React.Component {
|
|||
if (index === 0) {
|
||||
this.updateFormField("editorType", "markdown");
|
||||
this.setState({
|
||||
placeholder: i18next.t("new:markdown"),
|
||||
placeholder: i18next.t("new:Markdown"),
|
||||
});
|
||||
} else {
|
||||
this.updateFormField("editorType", "richtext");
|
||||
this.setState({
|
||||
placeholder: i18next.t("new:richtext"),
|
||||
placeholder: i18next.t("new:RichText"),
|
||||
});
|
||||
}
|
||||
}}
|
||||
|
@ -214,16 +214,12 @@ class NewBox extends React.Component {
|
|||
|
||||
return (
|
||||
<div className="problem" onClick={() => this.clearMessage()}>
|
||||
{i18next.t(
|
||||
"error:Please resolve the following issues before creating a new topic"
|
||||
)}
|
||||
{i18next.t("error:Please resolve the following issues before creating a new topic")}
|
||||
<ul>
|
||||
{problems.map((problem, i) => {
|
||||
return <li>{problem}</li>;
|
||||
})}
|
||||
{this.state.message !== "" ? (
|
||||
<li>{i18next.t(`error:${this.state.message}`)}</li>
|
||||
) : null}
|
||||
{this.state.message !== "" ? <li>{i18next.t(`error:${this.state.message}`)}</li> : null}
|
||||
</ul>
|
||||
</div>
|
||||
);
|
||||
|
@ -231,13 +227,7 @@ class NewBox extends React.Component {
|
|||
|
||||
render() {
|
||||
if (this.state.nodeId !== undefined && this.props.account !== undefined) {
|
||||
return (
|
||||
<NewNodeTopicBox
|
||||
nodeId={this.state.nodeId}
|
||||
size={"large"}
|
||||
account={this.props.account}
|
||||
/>
|
||||
);
|
||||
return <NewNodeTopicBox nodeId={this.state.nodeId} size={"large"} account={this.props.account} />;
|
||||
}
|
||||
|
||||
if (this.props.account === null) {
|
||||
|
@ -266,9 +256,7 @@ class NewBox extends React.Component {
|
|||
id="topic_title"
|
||||
name="title"
|
||||
autoFocus="autofocus"
|
||||
placeholder={i18next.t(
|
||||
"new:Please input the topic title. The body can be empty if the title expresses the full idea"
|
||||
)}
|
||||
placeholder={i18next.t("new:Please input the topic title. The body can be empty if the title expresses the full idea")}
|
||||
>
|
||||
{this.state.form.title}
|
||||
</textarea>
|
||||
|
@ -281,8 +269,7 @@ class NewBox extends React.Component {
|
|||
</div>
|
||||
<div>
|
||||
{/* markdown editor */}
|
||||
{!this.state.form.editorType ||
|
||||
this.state.form.editorType === "markdown" ? (
|
||||
{!this.state.form.editorType || this.state.form.editorType === "markdown" ? (
|
||||
<div
|
||||
style={{
|
||||
textAlign: "left",
|
||||
|
@ -291,12 +278,7 @@ class NewBox extends React.Component {
|
|||
lineHeight: "120%",
|
||||
}}
|
||||
>
|
||||
<textarea
|
||||
style={{ visibility: "hidden", display: "none" }}
|
||||
maxLength="20000"
|
||||
id="editor"
|
||||
name="content"
|
||||
/>
|
||||
<textarea style={{ visibility: "hidden", display: "none" }} maxLength="20000" id="editor" name="content" />
|
||||
<div className={`cm-long-content`}>
|
||||
<CodeMirror
|
||||
editorDidMount={(editor) => Tools.attachEditor(editor)}
|
||||
|
@ -329,10 +311,7 @@ class NewBox extends React.Component {
|
|||
)}
|
||||
</div>
|
||||
{/* select node */}
|
||||
<div
|
||||
className="cell"
|
||||
style={{ display: "flex", justifyContent: "space-between" }}
|
||||
>
|
||||
<div className="cell" style={{ display: "flex", justifyContent: "space-between" }}>
|
||||
<Select2
|
||||
value={this.getIndexFromNodeId(this.state.form.nodeId)}
|
||||
style={{
|
||||
|
@ -387,8 +366,7 @@ class NewBox extends React.Component {
|
|||
<TagsInput
|
||||
inputProps={{
|
||||
maxLength: "8",
|
||||
placeholder:
|
||||
"After adding tags press Enter,only add up to four tags,the length of each tag is up to 8",
|
||||
placeholder: "After adding tags press Enter,only add up to four tags,the length of each tag is up to 8",
|
||||
}}
|
||||
maxTags="4"
|
||||
value={this.state.tags}
|
||||
|
@ -398,20 +376,13 @@ class NewBox extends React.Component {
|
|||
<div className="cell">
|
||||
<div className="fr">
|
||||
<span id="error_message" />
|
||||
<button
|
||||
type="button"
|
||||
className="super normal button"
|
||||
onClick={this.publishTopic.bind(this)}
|
||||
>
|
||||
<button type="button" className="super normal button" onClick={this.publishTopic.bind(this)}>
|
||||
<li className="fa fa-paper-plane" />
|
||||
{i18next.t("new:Publish")}
|
||||
</button>
|
||||
</div>
|
||||
<div>
|
||||
<button
|
||||
className="super normal button"
|
||||
onClick={this.enablePreview.bind(this)}
|
||||
>
|
||||
<button className="super normal button" onClick={this.enablePreview.bind(this)}>
|
||||
<li className="fa fa-eye" />
|
||||
{i18next.t("new:Preview")}
|
||||
</button>
|
||||
|
@ -420,14 +391,7 @@ class NewBox extends React.Component {
|
|||
<div className="inner" id="topic_preview">
|
||||
<div className="topic_content">
|
||||
{/* preview in markdown */}
|
||||
<div className="markdown_body">
|
||||
{!this.state.isPreviewEnabled ? null : (
|
||||
<ReactMarkdown
|
||||
source={this.state.form.body}
|
||||
escapeHtml={false}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
<div className="markdown_body">{!this.state.isPreviewEnabled ? null : <ReactMarkdown source={this.state.form.body} escapeHtml={false} />}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -50,11 +50,11 @@ class NewNodeTopicBox extends React.Component {
|
|||
width: "",
|
||||
editor: [
|
||||
{
|
||||
text: i18next.t("new:markdown"),
|
||||
text: i18next.t("new:Markdown"),
|
||||
id: 0,
|
||||
},
|
||||
{
|
||||
text: i18next.t("new:richtext"),
|
||||
text: i18next.t("new:RichText"),
|
||||
id: 1,
|
||||
},
|
||||
],
|
||||
|
@ -157,16 +157,12 @@ class NewNodeTopicBox extends React.Component {
|
|||
|
||||
return (
|
||||
<div className="problem" onClick={() => this.clearMessage()}>
|
||||
{i18next.t(
|
||||
"error:Please resolve the following issues before creating a new topic"
|
||||
)}
|
||||
{i18next.t("error:Please resolve the following issues before creating a new topic")}
|
||||
<ul>
|
||||
{problems.map((problem, i) => {
|
||||
return <li>{problem}</li>;
|
||||
})}
|
||||
{this.state.message !== "" ? (
|
||||
<li>{i18next.t(`error:${this.state.message}`)}</li>
|
||||
) : null}
|
||||
{this.state.message !== "" ? <li>{i18next.t(`error:${this.state.message}`)}</li> : null}
|
||||
</ul>
|
||||
</div>
|
||||
);
|
||||
|
@ -202,14 +198,7 @@ class NewNodeTopicBox extends React.Component {
|
|||
)}
|
||||
<div className="inner" id="topic_preview">
|
||||
<div className="topic_content">
|
||||
<div className="markdown_body">
|
||||
{!this.state.isPreviewEnabled ? null : (
|
||||
<ReactMarkdown
|
||||
source={this.state.form.body}
|
||||
escapeHtml={false}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
<div className="markdown_body">{!this.state.isPreviewEnabled ? null : <ReactMarkdown source={this.state.form.body} escapeHtml={false} />}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -221,12 +210,8 @@ class NewNodeTopicBox extends React.Component {
|
|||
<div className="header">
|
||||
<Link to="/">{Setting.getForumName()}</Link>
|
||||
<span className="chevron"> › </span>
|
||||
<Link to={`/go/${encodeURIComponent(this.props.nodeId)}`}>
|
||||
{" "}
|
||||
{this.state.nodeInfo?.name}{" "}
|
||||
</Link>
|
||||
<span className="chevron"> › </span>{" "}
|
||||
{i18next.t("new:New Topic")}
|
||||
<Link to={`/go/${encodeURIComponent(this.props.nodeId)}`}> {this.state.nodeInfo?.name} </Link>
|
||||
<span className="chevron"> › </span> {i18next.t("new:New Topic")}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -246,15 +231,12 @@ class NewNodeTopicBox extends React.Component {
|
|||
onChange={(event) => {
|
||||
this.updateFormField("title", event.target.value);
|
||||
}}
|
||||
placeholder={i18next.t(
|
||||
"new:Please input the topic title. The body can be empty if the title expresses the full idea"
|
||||
)}
|
||||
placeholder={i18next.t("new:Please input the topic title. The body can be empty if the title expresses the full idea")}
|
||||
>
|
||||
{this.state.form.title}
|
||||
</textarea>
|
||||
<div className="sep10"></div>
|
||||
{!this.state.form.editorType ||
|
||||
this.state.form.editorType === "markdown" ? (
|
||||
{!this.state.form.editorType || this.state.form.editorType === "markdown" ? (
|
||||
<div
|
||||
style={{
|
||||
overflow: "hidden",
|
||||
|
@ -309,29 +291,16 @@ class NewNodeTopicBox extends React.Component {
|
|||
)}
|
||||
<div className="sep10"></div>
|
||||
<div style={{ display: "flex", justifyContent: "space-between" }}>
|
||||
<input
|
||||
type="submit"
|
||||
value={i18next.t("node:Publish")}
|
||||
className="super normal button"
|
||||
onClick={this.publishTopic.bind(this)}
|
||||
/>
|
||||
<input type="submit" value={i18next.t("node:Publish")} className="super normal button" onClick={this.publishTopic.bind(this)} />
|
||||
{this.renderEditorSelect()}
|
||||
</div>
|
||||
</div>
|
||||
<div className="inner">
|
||||
<div className="fr">
|
||||
<a
|
||||
href="/settings/ignore/node/12"
|
||||
className={`${this.state.nodeInfo.id}`}
|
||||
>
|
||||
<a href="/settings/ignore/node/12" className={`${this.state.nodeInfo.id}`}>
|
||||
{i18next.t("node:Ignore this node")}
|
||||
</a>
|
||||
{" "}
|
||||
<span className="fade">
|
||||
{i18next.t(
|
||||
"node:Topics in the ignored nodes will not appear on the homepage."
|
||||
)}
|
||||
</span>
|
||||
<span className="fade">{i18next.t("node:Topics in the ignored nodes will not appear on the homepage.")}</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
@ -359,12 +328,12 @@ class NewNodeTopicBox extends React.Component {
|
|||
if (index === 0) {
|
||||
this.updateFormField("editorType", "markdown");
|
||||
this.setState({
|
||||
placeholder: i18next.t("new:markdown"),
|
||||
placeholder: i18next.t("new:Markdown"),
|
||||
});
|
||||
} else {
|
||||
this.updateFormField("editorType", "richtext");
|
||||
this.setState({
|
||||
placeholder: i18next.t("new:richtext"),
|
||||
placeholder: i18next.t("new:RichText"),
|
||||
});
|
||||
}
|
||||
}}
|
||||
|
@ -412,8 +381,7 @@ class NewNodeTopicBox extends React.Component {
|
|||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{!this.state.form.editorType ||
|
||||
this.state.form.editorType === "markdown" ? (
|
||||
{!this.state.form.editorType || this.state.form.editorType === "markdown" ? (
|
||||
<div
|
||||
style={{
|
||||
overflow: "hidden",
|
||||
|
@ -426,9 +394,7 @@ class NewNodeTopicBox extends React.Component {
|
|||
>
|
||||
<div className={`cm-long-content`}>
|
||||
<CodeMirror
|
||||
editorDidMount={(editor) =>
|
||||
Tools.attachEditor(editor)
|
||||
}
|
||||
editorDidMount={(editor) => Tools.attachEditor(editor)}
|
||||
onPaste={() => Tools.uploadMdFile()}
|
||||
value={this.state.form.body}
|
||||
onDrop={() => Tools.uploadMdFile()}
|
||||
|
@ -472,19 +438,14 @@ class NewNodeTopicBox extends React.Component {
|
|||
{Setting.PcBrowser ? (
|
||||
<div>
|
||||
<span>
|
||||
<input
|
||||
ref={this.auto}
|
||||
type="checkbox"
|
||||
onChange={this.autoTag.bind(this)}
|
||||
/>
|
||||
<input ref={this.auto} type="checkbox" onChange={this.autoTag.bind(this)} />
|
||||
Auto Tag
|
||||
</span>
|
||||
{!this.state.autoTag ? (
|
||||
<TagsInput
|
||||
inputProps={{
|
||||
maxLength: "8",
|
||||
placeholder:
|
||||
"After adding tags press Enter,only add up to four tags,the length of each tag is up to 8",
|
||||
placeholder: "After adding tags press Enter,only add up to four tags,the length of each tag is up to 8",
|
||||
}}
|
||||
maxTags="4"
|
||||
value={this.state.tags}
|
||||
|
@ -493,25 +454,15 @@ class NewNodeTopicBox extends React.Component {
|
|||
) : null}
|
||||
</div>
|
||||
) : null}
|
||||
<td
|
||||
style={{ display: "flex", justifyContent: "space-between" }}
|
||||
>
|
||||
<td style={{ display: "flex", justifyContent: "space-between" }}>
|
||||
<div>
|
||||
<input type="hidden" name="once" />
|
||||
<button
|
||||
type="button"
|
||||
className="super normal button"
|
||||
onClick={this.enablePreview.bind(this)}
|
||||
>
|
||||
<button type="button" className="super normal button" onClick={this.enablePreview.bind(this)}>
|
||||
<li className="fa fa-eye"></li>
|
||||
{i18next.t("newNodeTopic:Preview")}{" "}
|
||||
</button>{" "}
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
className="super normal button"
|
||||
onClick={this.publishTopic.bind(this)}
|
||||
>
|
||||
<button type="submit" className="super normal button" onClick={this.publishTopic.bind(this)}>
|
||||
<li className="fa fa-paper-plane"></li>
|
||||
{i18next.t("newNodeTopic:Publish")}{" "}
|
||||
</button>{" "}
|
||||
|
|
|
@ -44,11 +44,11 @@ class NewReplyBox extends React.Component {
|
|||
message: null,
|
||||
editor: [
|
||||
{
|
||||
text: i18next.t("new:markdown"),
|
||||
text: i18next.t("new:Markdown"),
|
||||
id: 0,
|
||||
},
|
||||
{
|
||||
text: i18next.t("new:richtext"),
|
||||
text: i18next.t("new:RichText"),
|
||||
id: 1,
|
||||
},
|
||||
],
|
||||
|
@ -338,12 +338,12 @@ class NewReplyBox extends React.Component {
|
|||
if (index === 0) {
|
||||
this.updateFormField("editorType", "markdown");
|
||||
this.setState({
|
||||
placeholder: i18next.t("new:markdown"),
|
||||
placeholder: i18next.t("new:Markdown"),
|
||||
});
|
||||
} else {
|
||||
this.updateFormField("editorType", "richtext");
|
||||
this.setState({
|
||||
placeholder: i18next.t("new:richtext"),
|
||||
placeholder: i18next.t("new:RichText"),
|
||||
});
|
||||
}
|
||||
}}
|
||||
|
|
|
@ -27,39 +27,15 @@ class SelectLanguageBox extends React.Component {
|
|||
render() {
|
||||
return (
|
||||
<div align="center">
|
||||
<div
|
||||
className="box"
|
||||
style={{ width: Setting.PcBrowser ? "600px" : "auto" }}
|
||||
>
|
||||
<div className="box" style={{ width: Setting.PcBrowser ? "600px" : "auto" }}>
|
||||
<div className="header">
|
||||
<Link to="/">{Setting.getForumName()}</Link>{" "}
|
||||
<span className="chevron"> › </span> Select Default Editor
|
||||
/ 选择默认编辑器
|
||||
<Link to="/">{Setting.getForumName()}</Link> <span className="chevron"> › </span> Select Default Editor / 选择默认编辑器
|
||||
</div>
|
||||
<div className="cell">
|
||||
{Setting.PcBrowser ? (
|
||||
<span>
|
||||
Please select the Default Editor you would like to use on{" "}
|
||||
{Setting.getForumName()}
|
||||
</span>
|
||||
) : (
|
||||
<span>
|
||||
Please select the Default Editor you would like to use:
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<a
|
||||
href="javascript:void(0);"
|
||||
onClick={() => Setting.changeEditorType("markdown")}
|
||||
className={"lang-selector"}
|
||||
>
|
||||
{i18next.t("new:MarkDown")}
|
||||
<div className="cell">{Setting.PcBrowser ? <span>Please select the Default Editor you would like to use on {Setting.getForumName()}</span> : <span>Please select the Default Editor you would like to use:</span>}</div>
|
||||
<a href="javascript:void(0);" onClick={() => Setting.changeEditorType("markdown")} className={"lang-selector"}>
|
||||
{i18next.t("new:Markdown")}
|
||||
</a>
|
||||
<a
|
||||
href="javascript:void(0);"
|
||||
onClick={() => Setting.changeEditorType("richtext")}
|
||||
className={"lang-selector"}
|
||||
>
|
||||
<a href="javascript:void(0);" onClick={() => Setting.changeEditorType("richtext")} className={"lang-selector"}>
|
||||
{i18next.t("new:RichText")}
|
||||
</a>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue