feat: add some i18n translations

This commit is contained in:
codytseng
2025-06-24 23:21:14 +08:00
parent 2298254903
commit 3d2f19427a
15 changed files with 29 additions and 16 deletions

View File

@@ -58,11 +58,9 @@ export default function TranslateButton({
if (/[\u4e00-\u9fff]/.test(cleanText)) { if (/[\u4e00-\u9fff]/.test(cleanText)) {
return i18n.language !== 'zh' return i18n.language !== 'zh'
} }
if (/[\u0600-\u06ff]/.test(cleanText)) { if (/[\u0600-\u06ff]/.test(cleanText)) {
return i18n.language !== 'ar' return i18n.language !== 'ar'
} }
if (/[\u0400-\u04ff]/.test(cleanText)) { if (/[\u0400-\u04ff]/.test(cleanText)) {
return i18n.language !== 'ru' return i18n.language !== 'ru'
} }

View File

@@ -273,6 +273,7 @@ export default {
'انقر على متابعة لإخفاء {{type}} من المستخدمين غير الموثوقين.', 'انقر على متابعة لإخفاء {{type}} من المستخدمين غير الموثوقين.',
'Trusted users include people you follow and people they follow.': 'Trusted users include people you follow and people they follow.':
'المستخدمون الموثوقون هم الأشخاص الذين تتابعهم والأشخاص الذين يتابعونهم.', 'المستخدمون الموثوقون هم الأشخاص الذين تتابعهم والأشخاص الذين يتابعونهم.',
Continue: 'متابعة' Continue: 'متابعة',
'Successfully updated mute list': 'تم تحديث قائمة الكتم بنجاح'
} }
} }

View File

@@ -280,6 +280,7 @@ export default {
'Klicke auf Weiter, um {{type}} von nicht vertrauenswürdigen Benutzern auszublenden.', 'Klicke auf Weiter, um {{type}} von nicht vertrauenswürdigen Benutzern auszublenden.',
'Trusted users include people you follow and people they follow.': 'Trusted users include people you follow and people they follow.':
'Vertrauenswürdige Benutzer sind Personen, denen du folgst, und Personen, denen sie folgen.', 'Vertrauenswürdige Benutzer sind Personen, denen du folgst, und Personen, denen sie folgen.',
Continue: 'Weiter' Continue: 'Weiter',
'Successfully updated mute list': 'Stummschalteliste erfolgreich aktualisiert'
} }
} }

View File

@@ -273,6 +273,7 @@ export default {
'Click continue to hide {{type}} from untrusted users.', 'Click continue to hide {{type}} from untrusted users.',
'Trusted users include people you follow and people they follow.': 'Trusted users include people you follow and people they follow.':
'Trusted users include people you follow and people they follow.', 'Trusted users include people you follow and people they follow.',
Continue: 'Continue' Continue: 'Continue',
'Successfully updated mute list': 'Successfully updated mute list'
} }
} }

View File

@@ -278,6 +278,7 @@ export default {
'Haz clic en continuar para ocultar {{type}} de usuarios no confiables.', 'Haz clic en continuar para ocultar {{type}} de usuarios no confiables.',
'Trusted users include people you follow and people they follow.': 'Trusted users include people you follow and people they follow.':
'Los usuarios confiables incluyen a las personas que sigues y a las personas que ellos siguen.', 'Los usuarios confiables incluyen a las personas que sigues y a las personas que ellos siguen.',
Continue: 'Continuar' Continue: 'Continuar',
'Successfully updated mute list': 'Lista de silenciamiento actualizada con éxito'
} }
} }

View File

@@ -278,6 +278,7 @@ export default {
'Cliquez sur continuer pour masquer les {{type}} des utilisateurs non fiables.', 'Cliquez sur continuer pour masquer les {{type}} des utilisateurs non fiables.',
'Trusted users include people you follow and people they follow.': 'Trusted users include people you follow and people they follow.':
'Les utilisateurs de confiance incluent les personnes que vous suivez et les personnes quelles suivent.', 'Les utilisateurs de confiance incluent les personnes que vous suivez et les personnes quelles suivent.',
Continue: 'Continuer' Continue: 'Continuer',
'Successfully updated mute list': 'Liste de sourdine mise à jour avec succès'
} }
} }

View File

@@ -277,6 +277,7 @@ export default {
'Clicca su continua per nascondere {{type}} da utenti non fidati.', 'Clicca su continua per nascondere {{type}} da utenti non fidati.',
'Trusted users include people you follow and people they follow.': 'Trusted users include people you follow and people they follow.':
'Gli utenti fidati includono le persone che segui e le persone che seguono loro.', 'Gli utenti fidati includono le persone che segui e le persone che seguono loro.',
Continue: 'Continua' Continue: 'Continua',
'Successfully updated mute list': 'Lista di silenziamento aggiornata con successo'
} }
} }

View File

@@ -275,6 +275,7 @@ export default {
'信頼されていないユーザーからの{{type}}を非表示にするには続行をクリックしてください。', '信頼されていないユーザーからの{{type}}を非表示にするには続行をクリックしてください。',
'Trusted users include people you follow and people they follow.': 'Trusted users include people you follow and people they follow.':
'信頼できるユーザーには、あなたがフォローしている人とその人がフォローしている人が含まれます。', '信頼できるユーザーには、あなたがフォローしている人とその人がフォローしている人が含まれます。',
Continue: '続行' Continue: '続行',
'Successfully updated mute list': 'ミュートリストの更新に成功しました'
} }
} }

View File

@@ -276,6 +276,7 @@ export default {
'Kliknij kontynuuj, aby ukryć {{type}} od nieznanych użytkowników.', 'Kliknij kontynuuj, aby ukryć {{type}} od nieznanych użytkowników.',
'Trusted users include people you follow and people they follow.': 'Trusted users include people you follow and people they follow.':
'Zaufani użytkownicy to osoby, które obserwujesz i osoby, które oni obserwują.', 'Zaufani użytkownicy to osoby, które obserwujesz i osoby, które oni obserwują.',
Continue: 'Kontynuuj' Continue: 'Kontynuuj',
'Successfully updated mute list': 'Sukces aktualizacji listy zablokowanych użytkowników'
} }
} }

View File

@@ -276,6 +276,7 @@ export default {
'Clique em continuar para ocultar {{type}} de usuários não confiáveis.', 'Clique em continuar para ocultar {{type}} de usuários não confiáveis.',
'Trusted users include people you follow and people they follow.': 'Trusted users include people you follow and people they follow.':
'Usuários confiáveis incluem pessoas que você segue e pessoas que elas seguem.', 'Usuários confiáveis incluem pessoas que você segue e pessoas que elas seguem.',
Continue: 'Continuar' Continue: 'Continuar',
'Successfully updated mute list': 'Lista de silenciados atualizada com sucesso'
} }
} }

View File

@@ -277,6 +277,7 @@ export default {
'Clique em continuar para esconder {{type}} de usuários não confiáveis.', 'Clique em continuar para esconder {{type}} de usuários não confiáveis.',
'Trusted users include people you follow and people they follow.': 'Trusted users include people you follow and people they follow.':
'Usuários confiáveis incluem pessoas que você segue e pessoas que elas seguem.', 'Usuários confiáveis incluem pessoas que você segue e pessoas que elas seguem.',
Continue: 'Continuar' Continue: 'Continuar',
'Successfully updated mute list': 'Lista de silenciados atualizada com sucesso'
} }
} }

View File

@@ -278,6 +278,7 @@ export default {
'Нажмите "Продолжить", чтобы скрыть {{type}} от недоверенных пользователей.', 'Нажмите "Продолжить", чтобы скрыть {{type}} от недоверенных пользователей.',
'Trusted users include people you follow and people they follow.': 'Trusted users include people you follow and people they follow.':
'Доверенные пользователи включают людей, на которых вы подписаны, и людей, на которых они подписаны.', 'Доверенные пользователи включают людей, на которых вы подписаны, и людей, на которых они подписаны.',
Continue: 'Продолжить' Continue: 'Продолжить',
'Successfully updated mute list': 'Успешно обновлен список заглушенных пользователей'
} }
} }

View File

@@ -272,6 +272,7 @@ export default {
'คลิกดำเนินการต่อเพื่อซ่อน {{type}} จากผู้ใช้ที่ไม่น่าเชื่อถือ', 'คลิกดำเนินการต่อเพื่อซ่อน {{type}} จากผู้ใช้ที่ไม่น่าเชื่อถือ',
'Trusted users include people you follow and people they follow.': 'Trusted users include people you follow and people they follow.':
'ผู้ใช้ที่เชื่อถือได้รวมถึงผู้ที่คุณติดตามและผู้ที่พวกเขาติดตาม', 'ผู้ใช้ที่เชื่อถือได้รวมถึงผู้ที่คุณติดตามและผู้ที่พวกเขาติดตาม',
Continue: 'ดำเนินการต่อ' Continue: 'ดำเนินการต่อ',
'Successfully updated mute list': 'อัปเดตรายการปิดเสียงสำเร็จ'
} }
} }

View File

@@ -273,6 +273,7 @@ export default {
'点击继续隐藏来自不受信任用户的{{type}}。', '点击继续隐藏来自不受信任用户的{{type}}。',
'Trusted users include people you follow and people they follow.': 'Trusted users include people you follow and people they follow.':
'受信任的用户包括您关注的人和他们关注的人。', '受信任的用户包括您关注的人和他们关注的人。',
Continue: '继续' Continue: '继续',
'Successfully updated mute list': '成功更新屏蔽列表'
} }
} }

View File

@@ -8,6 +8,7 @@ import { createContext, useCallback, useContext, useEffect, useMemo, useState }
import { toast } from 'sonner' import { toast } from 'sonner'
import { z } from 'zod' import { z } from 'zod'
import { useNostr } from './NostrProvider' import { useNostr } from './NostrProvider'
import { useTranslation } from 'react-i18next'
type TMuteListContext = { type TMuteListContext = {
mutePubkeys: string[] mutePubkeys: string[]
@@ -32,6 +33,7 @@ export const useMuteList = () => {
} }
export function MuteListProvider({ children }: { children: React.ReactNode }) { export function MuteListProvider({ children }: { children: React.ReactNode }) {
const { t } = useTranslation()
const { const {
pubkey: accountPubkey, pubkey: accountPubkey,
muteListEvent, muteListEvent,
@@ -110,7 +112,7 @@ export function MuteListProvider({ children }: { children: React.ReactNode }) {
} }
const newMuteListDraftEvent = createMuteListDraftEvent(tags, content) const newMuteListDraftEvent = createMuteListDraftEvent(tags, content)
const event = await publish(newMuteListDraftEvent) const event = await publish(newMuteListDraftEvent)
toast.success('Successfully updated mute list') toast.success(t('Successfully updated mute list'))
return event return event
} }