Skip to content

Commit

Permalink
feat(AI摘要功能支持多语言):
Browse files Browse the repository at this point in the history
  • Loading branch information
qixing-jk committed Dec 22, 2024
1 parent 611a7d1 commit fcf0ca4
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 4 deletions.
6 changes: 4 additions & 2 deletions components/AISummary.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import styles from './AISummary.module.css'
import { useEffect, useState } from 'react'
import { useGlobal } from '@/lib/global'

const AISummary = ({ aiSummary }) => {
const [summary, setSummary] = useState('生成中...')
const { locale } = useGlobal()
const [summary, setSummary] = useState(locale.AI_SUMMARY.GENERATING + '...')

useEffect(() => {
showAiSummaryAnimation(aiSummary, setSummary)
Expand All @@ -24,7 +26,7 @@ const AISummary = ({ aiSummary }) => {
/>
</svg>
</div>
<div className={styles['ai-title']}>AI智能摘要</div>
<div className={styles['ai-title']}>{locale.AI_SUMMARY.NAME}</div>
<div className={styles['ai-tag']}>GPT</div>
</div>
<div className={styles['ai-content']}>
Expand Down
4 changes: 4 additions & 0 deletions lib/lang/en-US.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,9 @@ export default {
SUBSCRIBE: 'Subscribe',
MSG: 'Get the latest news and articles to your inbox every month.',
EMAIL: 'Email'
},
AI_SUMMARY: {
NAME: 'AI intelligent summary',
GENERATING: 'Generating'
}
}
9 changes: 7 additions & 2 deletions lib/lang/fr-FR.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@ export default {
URL_COPIED: "L'URL est copé!",
TABLE_OF_CONTENTS: 'Sommaire',
RELATE_POSTS: 'Article similaire',
COPYRIGHT: 'Droit d\'auteur',
COPYRIGHT: "Droit d'auteur",
AUTHOR: 'Auteur',
URL: 'Link',
ANALYTICS: 'Analytique',
POSTS: 'Articles',
ARTICLE: 'Article(s)',
VISITORS: 'Visiteurs',
VIEWS: 'Views',
COPYRIGHT_NOTICE: 'Attribution - Pas d’Utilisation Commerciale - Partage dans les Mêmes Conditions 4.0 International (CC BY-NC-SA 4.0)',
COPYRIGHT_NOTICE:
'Attribution - Pas d’Utilisation Commerciale - Partage dans les Mêmes Conditions 4.0 International (CC BY-NC-SA 4.0)',
RESULT_OF_SEARCH: 'Résultats',
ARTICLE_DETAIL: 'Plus de détails',
PASSWORD_ERROR: 'Mot de passe est incorrect!',
Expand All @@ -50,5 +51,9 @@ export default {
POST: {
BACK: 'Page precedente',
TOP: 'Haut'
},
AI_SUMMARY: {
NAME: "Résumé intelligent par l'IA",
GENERATING: 'Génération en cours'
}
}
4 changes: 4 additions & 0 deletions lib/lang/ja-JP.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,9 @@ export default {
POST: {
BACK: '前のページに戻る',
TOP: '上に戻る'
},
AI_SUMMARY: {
NAME: 'AIインテリジェントサマリー',
GENERATING: '生成中'
}
}
4 changes: 4 additions & 0 deletions lib/lang/tr-TR.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,9 @@ export default {
POST: {
BACK: 'Geri',
TOP: 'Yukarı'
},
AI_SUMMARY: {
NAME: 'Yapay Zeka Akıllı Özet',
GENERATING: 'Oluşturuluyor'
}
}
4 changes: 4 additions & 0 deletions lib/lang/zh-CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,9 @@ export default {
SUBSCRIBE: '邮件订阅',
MSG: '订阅以获取每月更新的新闻和文章,直接发送至您的邮箱。',
EMAIL: '邮箱'
},
AI_SUMMARY: {
NAME: 'AI智能摘要',
GENERATING: '生成中'
}
}
4 changes: 4 additions & 0 deletions lib/lang/zh-HK.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,9 @@ export default {
POST: {
BACK: '返回',
TOP: '回到頂端'
},
AI_SUMMARY: {
NAME: 'AI智能摘要',
GENERATING: '生成中'
}
}
4 changes: 4 additions & 0 deletions lib/lang/zh-TW.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,9 @@ export default {
POST: {
BACK: '返回',
TOP: '回到頂端'
},
AI_SUMMARY: {
NAME: 'AI智能摘要',
GENERATING: '生成中'
}
}

0 comments on commit fcf0ca4

Please sign in to comment.