Skip to content

Commit

Permalink
Feature: 언어설정 한자 간체, 번체 추가 (#651)
Browse files Browse the repository at this point in the history
* feat: 중국어(번체) 추가

* feat: 언어설정에 한자간체, 한자번체 추가

* fix: ci 스크립트 CACHED_BUILD_PATHS 출력 추가
  • Loading branch information
dev-dong-su authored Mar 4, 2024
1 parent 0066076 commit b35053b
Show file tree
Hide file tree
Showing 12 changed files with 512 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ jobs:
run: |
ls -al
yarn workspace @gloddy/web build
- name: Output build cache key
run: echo "build_cache_key=${{ env.BUILD_CACHE_KEY }}" >> $GITHUB_OUTPUT

env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}

Expand Down
2 changes: 2 additions & 0 deletions packages/web/src/apis/openApi/apis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ export const postOpenAIAPI = async (messages: Message[]) => {
}
);

console.log(response.data.choices[0].message.content);

return JSON.parse(response.data.choices[0].message.content);
};
6 changes: 3 additions & 3 deletions packages/web/src/apis/openApi/mutations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ export const usePostTranslateGPT = () => {
targetLang: string;
}) => {
const userContent = title
? `Translate the following text to ${targetLang} and format the output as requested: { title: "${title}", content: "${content}" }`
: `Translate the following text to ${targetLang} and format the output as requested: { content: "${content}" }`;
? `Translate the following text to ${targetLang} and format the output as requested: { title: ${title}, content: ${content} }`
: `Translate the following text to ${targetLang} and format the output as requested: { content: ${content} }`;

const messages: Message[] = [
{
role: 'system',
content:
'You are a translator assistant that provides JSON output. Please ensure the translation output is in the format of {title: "translated text", content: "translated text"} if title is provided, otherwise just {content: "translated text"}.',
'You are a translator assistant that provides JSON output. Please ensure the translation output is in the format of {title: translated text, content: translated text} if title is provided, otherwise just {content: translated text}.',
},
{
role: 'user',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ export default function Language() {
<Spacing size={8} direction="horizontal" />
<span>English</span>
</Flex>
{/* Simplified Chinese */}
<Flex className="py-12" onClick={() => setLanguage('zh-CN')}>
<CircleCheckbox checked={language === 'zh-CN'} />
<Spacing size={8} direction="horizontal" />
<span>简体中文</span>
</Flex>
{/* Traditional Chinese */}
<Flex className="py-12" onClick={() => setLanguage('zh-TW')}>
<CircleCheckbox checked={language === 'zh-TW'} />
<Spacing size={8} direction="horizontal" />
<span>繁體中文</span>
</Flex>
<ButtonGroup>
<Button onClick={handleSubmit} disabled={prevLanguage === language}>
{t('confirm')}
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/app/i18n/locales/en/profile.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"deleteTrustScore": "When you leave, your trust score data within your\npersonal profile will be deleted and cannot be retrieved.",
"deleteGroupData": "Upon leaving, all data associated with your group activities\nwill be removed and cannot be retrieved.",

"agreeTerms": "I have understood the above information, and I agree to it.",
"agreeTerms": "I have understood the above information, and I agree to it.",
"privacyPolicy": "Your personal information will be securely disposed of following our privacy policy after withdrawal.",
"proceedDeletion": "Proceed with Deletion",
"feedback": "Did you encounter any inconveniences while using our service?\nWe are committed to making improvements based on your feedback.",
Expand Down
20 changes: 20 additions & 0 deletions packages/web/src/app/i18n/locales/zh-TW/common.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"time": "",
"nickname": "暱稱",
"male": "男性",
"female": "女性",
"grouping": "匹配",
"meeting": "我的會議",
"profile": "個人資料",
"community": "社區",
"notification": "通知",
"yes": "",
"no": "",
"명": "",
"next": "下一步",
"confirm": "確認",
"complete": "完成",
"reportMessage1": "舉報已收到。",
"reportMessage2": "我們將儘快處理。",
"blockMessage": "屏蔽已完成。"
}
60 changes: 60 additions & 0 deletions packages/web/src/app/i18n/locales/zh-TW/community.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"category": {
"All": "全部",
"K-POP": "K-POP",
"Q&A": "我想知道",
"Language": "語言交換"
},
"create": {
"headerTitle": "創建帖子",
"category": {
"name": "類別",
"K-POP": "K-POP",
"Q&A": "我想知道",
"Language": "語言交換"
},
"title": {
"placeholder": "帖子標題"
},
"content": {
"placeholder": "請至少寫20個字符的帖子。"
},
"submit": {
"label": "發布",
"content": "您確定要發布這篇帖子嗎?"
},
"cancel": {
"content": "您確定要取消寫帖子嗎?"
}
},
"detail": {
"likeCount": "",
"commentCount": "評論 {{commentCount}}個",
"block": "屏蔽帖子",
"block_content": "您確定要屏蔽這篇帖子嗎?",
"report": "舉報帖子",
"report_content": "您確定要舉報這篇帖子嗎?",
"delete": "刪除帖子",
"delete_content": "您確定要刪除這篇帖子嗎?",
"translate": "翻譯"
},
"comment": {
"placeholder_comment": "寫評論",
"placeholder_reply": "寫回復",
"commentLengthError": "* 請寫不超過150個字符。",
"firstComment": "來成為第一個評論的人吧!",
"blockComment": "這是一個被屏蔽的評論。",
"delete": {
"label": "刪除",
"content": "您確定要刪除這條評論嗎?"
},
"report": {
"label": "舉報",
"content": "您確定要舉報這條評論嗎?"
},
"block": {
"label": "屏蔽",
"content": "您確定要屏蔽這條評論嗎?"
}
}
}
128 changes: 128 additions & 0 deletions packages/web/src/app/i18n/locales/zh-TW/groupDetail.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
{
"more": "更多",
"fold": "折疊",
"group": {
"exit": {
"label": "退出群組",
"content": "您確定要退出該群組嗎?",
"description1": "一旦退出群組,",
"description2": "信任分數",
"description3": "將被扣除。"
},
"report": {
"label": "舉報",
"content": "您確定要舉報該群組嗎?"
},
"block": {
"label": "屏蔽",
"content": "您確定要屏蔽該群組嗎?"
}
},
"comment": {
"placeholder": "寫評論",
"commentLengthError": "* 請限制在150字以內。",
"firstComment": "快來發表第一條評論吧!",
"blockComment": "這條評論已被屏蔽。",
"delete": {
"label": "刪除",
"content": "您確定要刪除這條評論嗎?"
},
"report": {
"label": "舉報",
"content": "您確定要舉報這條評論嗎?"
},
"block": {
"label": "屏蔽",
"content": "您確定要屏蔽這條評論嗎?"
}
},
"article": {
"headerTitle": "文章",
"delete": {
"label": "刪除",
"content": "您確定要刪除這篇文章嗎?"
},
"report": {
"label": "舉報",
"content": "您確定要舉報這篇文章嗎?"
},
"block": {
"label": "屏蔽",
"content": "您確定要屏蔽這篇文章嗎?"
}
},
"notice": {
"headerTitle": "公告",
"delete": {
"label": "刪除",
"content": "您確定要刪除這條公告嗎?"
},
"report": {
"label": "舉報",
"content": "您確定要舉報這條公告嗎?"
},
"block": {
"label": "屏蔽",
"content": "您確定要屏蔽這條公告嗎?"
}
},
"details": {
"tab": "詳情",
"members": "群組成員 ({{memberCount}}/{{maxMemberCount}})",
"viewAll": "查看全部",
"meetDate": "聚會時間",
"place": "聚會地點",
"join": "加入聚會",
"wait": "等待批准"
},
"board": {
"tab": "留言板",
"notice": "公告",
"emptyNotice": "沒有註冊的公告。",
"commentCount": "評論 {{commentCount}}條"
},
"members": {
"headerTitle": "群組成員"
},
"manage": {
"headerTitle": "管理申請",
"empty": "還沒有申請。",
"description": "請查看想要加入群組的成員申請",
"refuse": {
"label": "拒絕",
"description": "過於匆忙的拒絕可能會錯過合適的申請者。",
"content": "您確定要拒絕這個申請嗎?"
},
"approve": {
"label": "批准",
"description": "以相互尊重創建健康的群組文化!",
"content": "您確定要批准這個申請嗎?"
}
},
"apply": {
"headerTitle": "填寫申請",
"description": "請填寫申請以加入群組。",
"introduce": "我是這樣的人!",
"reason": "我想參加聚會的原因",
"placeholder": "請輸入內容。",
"submit": {
"label": "申請",
"content": "您確定要提交申請嗎?",
"description": "提交申請後無法再進行修改。"
}
},
"writeArticle": {
"headerTitle": "寫文章",
"content": {
"placeholder": "請寫至少20個字符的文章。"
},
"notice": "將此文章設置為公告。",
"submit": {
"label": "發布",
"content": "您確定要發布這篇文章嗎?"
},
"cancel": {
"content": "您確定要取消寫文章嗎?"
}
}
}
46 changes: 46 additions & 0 deletions packages/web/src/app/i18n/locales/zh-TW/grouping.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"headerTitle": "匹配",
"create": {
"headerTitle": "創建群組",
"title": {
"label": "群組標題",
"placeholder": "請輸入標題。"
},
"content": {
"label": "群組資訊",
"placeholder": "請為活動撰寫介紹。"
},
"meetDate": {
"label": "日期和時間",
"placeholder": "設定會議的日期和時間。",
"year": "",
"month": ""
},
"time": {
"label": "開始時間",
"am": "上午",
"pm": "下午",
"hour": "小時",
"minute": "分鐘"
},
"place": {
"label": "地點",
"placeholder": "請設定會議的地點。",
"noResult": "未找到結果。"
},
"maxUser": {
"label": "參與人數"
},
"error": {
"time": "請設定一個比當前時間晚的時間。"
},
"continue": "繼續",
"submit": {
"label": "提交",
"message": "創建群組後無法進行更改。\n您希望繼續嗎?",
"ok": "",
"cancel": ""
}
},
"noGroup": "未找到群組。"
}
Loading

0 comments on commit b35053b

Please sign in to comment.