Skip to content

Commit 455eaee

Browse files
committed
chore: better i18n
1 parent c0df297 commit 455eaee

File tree

6 files changed

+36
-37
lines changed

6 files changed

+36
-37
lines changed

src/_locales/en/main.json

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,25 @@
1818
"Custom ChatGPT Web API Url": "Custom ChatGPT Web API Url",
1919
"Custom ChatGPT Web API Path": "Custom ChatGPT Web API Path",
2020
"Custom OpenAI API Url": "Custom OpenAI API Url",
21-
"Custom Site Regex:": "Custom Site Regex:",
22-
"Exclusively use Custom Site Regex for website matching,": "Exclusively use Custom Site Regex for website matching,",
23-
"ignoring built-in rules": "ignoring built-in rules",
24-
"Input Query:": "Input Query:",
25-
"Append Query:": "Append Query:",
26-
"Prepend Query:": "Prepend Query:",
21+
"Custom Site Regex": "Custom Site Regex",
22+
"Exclusively use Custom Site Regex for website matching, ignoring built-in rules": "Exclusively use Custom Site Regex for website matching, ignoring built-in rules",
23+
"Input Query": "Input Query",
24+
"Append Query": "Append Query",
25+
"Prepend Query": "Prepend Query",
2726
"Wechat Pay": "Wechat Pay",
2827
"Type your question here\nEnter to send, shift + enter to break line": "Type your question here\nEnter to send, shift + enter to break line",
2928
"Wait for the answer to finish and then continue here": "Wait for the answer to finish and then continue here",
3029
"Ask ChatGPT": "Ask ChatGPT",
3130
"No Input Found": "No Input Found",
32-
"You:": "You:",
31+
"You": "You",
3332
"Collapse": "Collapse",
3433
"Expand": "Expand",
3534
"Stop": "Stop",
3635
"Continue on official website": "Continue on official website",
37-
"Error:": "Error:",
36+
"Error": "Error",
3837
"Copy": "Copy",
39-
"Question:": "Question:",
40-
"Answer:": "Answer:",
38+
"Question": "Question",
39+
"Answer": "Answer",
4140
"Waiting for response...": "Waiting for response...",
4241
"Close the Window": "Close the Window",
4342
"Pin the Window": "Pin the Window",

src/_locales/zh-hans/main.json

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,25 @@
1818
"Custom ChatGPT Web API Url": "自定义的ChatGPT网页API地址",
1919
"Custom ChatGPT Web API Path": "自定义的ChatGPT网页API路径",
2020
"Custom OpenAI API Url": "自定义的OpenAI API地址",
21-
"Custom Site Regex:": "自定义站点正则匹配:",
22-
"Exclusively use Custom Site Regex for website matching,": "只使用自定义站点正则匹配,",
23-
"ignoring built-in rules": "忽略内置站点规则",
24-
"Input Query:": "输入的查询选择器:",
25-
"Append Query:": "挂载到末尾的查询选择器:",
26-
"Prepend Query:": "插入到开头的查询选择器:",
21+
"Custom Site Regex": "自定义站点正则匹配",
22+
"Exclusively use Custom Site Regex for website matching, ignoring built-in rules": "只使用自定义站点正则匹配, 忽略内置站点规则",
23+
"Input Query": "输入的查询选择器",
24+
"Append Query": "挂载到末尾的查询选择器",
25+
"Prepend Query": "插入到开头的查询选择器",
2726
"Wechat Pay": "微信打赏",
2827
"Type your question here\nEnter to send, shift + enter to break line": "在此输入你的问题\n回车 发送, shift+回车 换行",
2928
"Wait for the answer to finish and then continue here": "等待回答完成, 然后在此继续",
3029
"Ask ChatGPT": "询问ChatGPT",
3130
"No Input Found": "无输入",
32-
"You:": ":",
31+
"You": "",
3332
"Collapse": "折叠",
3433
"Expand": "展开",
3534
"Stop": "停止",
3635
"Continue on official website": "在官网继续",
37-
"Error:": "错误:",
36+
"Error": "错误",
3837
"Copy": "复制",
39-
"Question:": "问题:",
40-
"Answer:": "回答:",
38+
"Question": "问题",
39+
"Answer": "回答",
4140
"Waiting for response...": "等待响应...",
4241
"Close the Window": "关闭窗口",
4342
"Pin the Window": "固定窗口",

src/_locales/zh-hant/main.json

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,25 @@
1818
"Custom ChatGPT Web API Url": "自定義的ChatGPT網頁API地址",
1919
"Custom ChatGPT Web API Path": "自定義的ChatGPT網頁API路徑",
2020
"Custom OpenAI API Url": "自定義的OpenAI API地址",
21-
"Custom Site Regex:": "自定義站點正則匹配:",
22-
"Exclusively use Custom Site Regex for website matching,": "只使用自定義站點正則匹配,",
23-
"ignoring built-in rules": "忽略內置站點規則",
24-
"Input Query:": "輸入的查詢選擇器:",
25-
"Append Query:": "掛載到末尾的查詢選擇器:",
26-
"Prepend Query:": "插入到開頭的查詢選擇器:",
21+
"Custom Site Regex": "自定義站點正則匹配",
22+
"Exclusively use Custom Site Regex for website matching, ignoring built-in rules": "只使用自定義站點正則匹配, 忽略內置站點規則",
23+
"Input Query": "輸入的查詢選擇器",
24+
"Append Query": "掛載到末尾的查詢選擇器",
25+
"Prepend Query": "插入到開頭的查詢選擇器",
2726
"Wechat Pay": "微信打賞",
2827
"Type your question here\nEnter to send, shift + enter to break line": "在此輸入你的問題\n回車 發送, shift+回車 換行",
2928
"Wait for the answer to finish and then continue here": "等待回答完成, 然後在此繼續",
3029
"Ask ChatGPT": "詢問ChatGPT",
3130
"No Input Found": "無輸入",
32-
"You:": ":",
31+
"You": "",
3332
"Collapse": "折疊",
3433
"Expand": "展開",
3534
"Stop": "停止",
3635
"Continue on official website": "在官網繼續",
37-
"Error:": "錯誤:",
36+
"Error": "錯誤",
3837
"Copy": "復製",
39-
"Question:": "問題:",
40-
"Answer:": "回答:",
38+
"Question": "問題",
39+
"Answer": "回答",
4140
"Waiting for response...": "等待響應...",
4241
"Close the Window": "關閉窗口",
4342
"Pin the Window": "固定窗口",

src/components/ConversationCard/index.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,9 @@ function ConversationCard(props) {
230230
onClick={() => {
231231
let output = ''
232232
session.conversationRecords.forEach((data) => {
233-
output += `Question:\n\n${data.question}\n\nAnswer:\n\n${data.answer}\n\n<hr/>\n\n`
233+
output += `${t('Question')}:\n\n${data.question}\n\n${t('Answer')}:\n\n${
234+
data.answer
235+
}\n\n<hr/>\n\n`
234236
})
235237
const blob = new Blob([output], { type: 'text/plain;charset=utf-8' })
236238
FileSaver.saveAs(blob, 'conversation.md')

src/components/ConversationItem/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function ConversationItem({ type, content, session, done, port }) {
1515
return (
1616
<div className={type} dir="auto">
1717
<div className="gpt-header">
18-
<p>{t('You:')}</p>
18+
<p>{t('You')}:</p>
1919
<div style="display: flex; gap: 15px;">
2020
<CopyButton contentFn={() => content} size={14} />
2121
{!collapsed ? (
@@ -104,7 +104,7 @@ export function ConversationItem({ type, content, session, done, port }) {
104104
return (
105105
<div className={type} dir="auto">
106106
<div className="gpt-header">
107-
<p>{t('Error:')}</p>
107+
<p>{t('Error')}:</p>
108108
<div style="display: flex; gap: 15px;">
109109
<CopyButton contentFn={() => content} size={14} />
110110
{!collapsed ? (

src/popup/Popup.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ function AdvancedPart({ config, updateConfig }) {
288288
/>
289289
</label>
290290
<label>
291-
{t('Custom Site Regex:')}
291+
{t('Custom Site Regex')}
292292
<input
293293
type="text"
294294
value={config.siteRegex}
@@ -311,7 +311,7 @@ function AdvancedPart({ config, updateConfig }) {
311311
</label>
312312
<br />
313313
<label>
314-
{t('Input Query:')}
314+
{t('Input Query')}
315315
<input
316316
type="text"
317317
value={config.inputQuery}
@@ -322,7 +322,7 @@ function AdvancedPart({ config, updateConfig }) {
322322
/>
323323
</label>
324324
<label>
325-
{t('Append Query:')}
325+
{t('Append Query')}
326326
<input
327327
type="text"
328328
value={config.appendQuery}
@@ -333,7 +333,7 @@ function AdvancedPart({ config, updateConfig }) {
333333
/>
334334
</label>
335335
<label>
336-
{t('Prepend Query:')}
336+
{t('Prepend Query')}
337337
<input
338338
type="text"
339339
value={config.prependQuery}

0 commit comments

Comments
 (0)