Skip to content

Commit 1c96a9b

Browse files
committed
feat: i18n update
1 parent 3a21221 commit 1c96a9b

File tree

4 files changed

+156
-70
lines changed

4 files changed

+156
-70
lines changed

‎src/locales/en.js

+33-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
export const en = {
1+
const en = {
22
app: {
33
name: "LeetCode Cheatsheet",
4+
preview: "Preview",
5+
copyMdOrigin: "Click to copy MarkDown origin",
46
fullScreen: "Full Screen (Press ESC to exit)",
57
toUse: "To Use",
68
custom: "Custom",
@@ -55,6 +57,7 @@ export const en = {
5557
savingProblem: "Saving problem information, please wait~",
5658
githubAPIError:
5759
"Failed to use Github API, has been switched to normal mode, normal mode can only automatically bring in the problem name, problem address and solution language.",
60+
notYet: "Not yet",
5861
},
5962
problem: {
6063
743: "743. Network Delay Time",
@@ -93,13 +96,38 @@ export const en = {
9396
incrementalUsage: "Incremental Usage",
9497
explain1:
9598
"The editing function is not supported. If you need to edit, you can do so indirectly by first \"use\", then \"save\", and finally \"delete\" the original data.",
96-
explain2: "Templates can be used incrementally. Click the drop-down triangle of 'to use' and select Incremental Usage.",
97-
explain3: "The template will be generated according to the position of your mouse. For example, if your mouse is at point (100, 100), the template will be offset by (100, 100) units as a whole. If the template is not exactly at (100, 100), it means that the template itself was not created with (0, 0) as the top-left corner. When creating custom templates, it's important to keep this in mind.",
99+
explain2:
100+
"Templates can be used incrementally. Click the drop-down triangle of 'to use' and select Incremental Usage.",
101+
explain3:
102+
"The template will be generated according to the position of your mouse. For example, if your mouse is at point (100, 100), the template will be offset by (100, 100) units as a whole. If the template is not exactly at (100, 100), it means that the template itself was not created with (0, 0) as the top-left corner. When creating custom templates, it's important to keep this in mind.",
98103
explain4: "You can also choose to use the native excalidraw directly ",
99104
},
100105

101106
explanationTemplate: {
102107
name: "Explanation Template",
108+
goToTheWebsiteToUse: "Go to the website to use",
109+
problemAddress: "Problem Address",
110+
problemDesc: "Problem Description",
111+
preKnowledge: "Pre Knowledge",
112+
company: "Company",
113+
thinking: "Thinking",
114+
keyPoints: "Key Points",
115+
languageSupport: "Language Support",
116+
complexityAnalysis: "Complexity Analysis",
117+
complexityDeclare: "Let n be the length of the array.",
118+
timeComplexity: "Time Complexity",
119+
spaceComplexity: "Space Complexity",
120+
howToUse: "How to use it?",
121+
programmingLanguage: "Programming Language:",
122+
commonFormulas: "Common formulas (click to copy):",
123+
noBackup: "No backup file found",
124+
restore: "Restore last edit content",
125+
backupTips:
126+
"The explanation is backed up every five seconds. If you accidentally refresh the browser, you can click the restore button below to restore it. Since it is an overwrite backup, only the last edited content will be saved.",
127+
afterUpdateTemplateTips:
128+
"More explanation templates will be provided later.",
129+
afterUpdateThemeTips:
130+
"More themes and user-defined themes will be supported later.",
103131
},
104132
complexityQuickCheck: {
105133
name: "Complexity Quick Check",
@@ -117,4 +145,5 @@ export const en = {
117145
name: "About Me",
118146
},
119147
};
120-
export default en;
148+
// export default en;
149+
module.exports = en;

‎src/locales/zh.js

+27-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
export const cn = {
1+
const zh = {
22
app: {
33
name: "力扣加加",
4+
preview: "预览",
5+
copyMdOrigin:"点击复制 MarkDown 原文",
46
fullScreen: "全屏模式(退出请按 ESC)",
57
toUse: "去使用",
68
custom: "自定义",
@@ -52,6 +54,7 @@ export const cn = {
5254
savingProblem: "正在存储题目信息,请稍后~",
5355
githubAPIError:
5456
"使用 Github API 失败,已为您切换为普通模式,普通模式仅可自动带入题目名称,题目地址以及题解语言。",
57+
notYet:"暂无",
5558
},
5659
problem: {
5760
743: "743. 网络延迟时间",
@@ -96,6 +99,27 @@ export const cn = {
9699

97100
explanationTemplate: {
98101
name: "题解模板",
102+
goToTheWebsiteToUse: "去网站使用",
103+
problemAddress: "题目地址",
104+
problemDesc: "题目描述",
105+
preKnowledge: "前置知识",
106+
company: "公司",
107+
thinking: "思路",
108+
keyPoints: "关键点",
109+
languageSupport: "语言支持",
110+
complexityAnalysis: "复杂度分析",
111+
complexityDeclare: "令 n 为数组长度。",
112+
timeComplexity: "时间复杂度",
113+
spaceComplexity: "空间复杂度",
114+
howToUse: "如何使用?",
115+
programmingLanguage: "编程语言:1",
116+
commonFormulas: "常用公式(点击可��制):",
117+
noBackup: "没有找到任何备份文件",
118+
restore: "恢复上次编辑内容",
119+
backupTips: "题解每五秒备份一次,如果你不小心刷新了浏览器可以点击下方的恢复按钮还原。由于是覆盖式备份,因此仅会保存最后一次编辑的内容。",
120+
afterUpdateTemplateTips: "后续考虑提供更多题解模板。",
121+
afterUpdateThemeTips:"后续考虑支持更多主题,以及用户自定义主题。"
122+
99123
},
100124
complexityQuickCheck: {
101125
name: "复杂度速查",
@@ -113,4 +137,5 @@ export const cn = {
113137
name: "关于我",
114138
},
115139
};
116-
export default cn;
140+
// export default zh;
141+
module.exports = zh;

‎src/roadmap/roadmap.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ const roadmaps = {
7979
],
8080
code: {
8181
language: "py",
82-
text: `代码参考:代码模板 - 二分法`,
82+
text: "代码参考:代码模板 - 二分法",
8383
},
8484
keys: [
8585
`

0 commit comments

Comments
 (0)