From 2121ca75561395dbc1d05fcb5063d48a170c594c Mon Sep 17 00:00:00 2001 From: codytseng Date: Tue, 24 Jun 2025 22:54:44 +0800 Subject: [PATCH] feat: add some i18n translation --- .../HideUntrustedContentButton/index.tsx | 24 ++++++++++++------- src/i18n/locales/ar.ts | 16 ++++++++++++- src/i18n/locales/de.ts | 16 ++++++++++++- src/i18n/locales/en.ts | 16 ++++++++++++- src/i18n/locales/es.ts | 16 ++++++++++++- src/i18n/locales/fr.ts | 16 ++++++++++++- src/i18n/locales/it.ts | 16 ++++++++++++- src/i18n/locales/ja.ts | 17 ++++++++++++- src/i18n/locales/pl.ts | 16 ++++++++++++- src/i18n/locales/pt-BR.ts | 16 ++++++++++++- src/i18n/locales/pt-PT.ts | 16 ++++++++++++- src/i18n/locales/ru.ts | 16 ++++++++++++- src/i18n/locales/zh.ts | 15 +++++++++++- 13 files changed, 196 insertions(+), 20 deletions(-) diff --git a/src/components/HideUntrustedContentButton/index.tsx b/src/components/HideUntrustedContentButton/index.tsx index 61773ed3..99e45cba 100644 --- a/src/components/HideUntrustedContentButton/index.tsx +++ b/src/components/HideUntrustedContentButton/index.tsx @@ -13,6 +13,7 @@ import { Button, buttonVariants } from '@/components/ui/button' import { useUserTrust } from '@/providers/UserTrustProvider' import { VariantProps } from 'class-variance-authority' import { Shield, ShieldCheck } from 'lucide-react' +import { useTranslation } from 'react-i18next' export default function HideUntrustedContentButton({ type, @@ -21,6 +22,7 @@ export default function HideUntrustedContentButton({ type: 'interactions' | 'notifications' size?: VariantProps['size'] }) { + const { t } = useTranslation() const { hideUntrustedInteractions, hideUntrustedNotifications, @@ -33,6 +35,8 @@ export default function HideUntrustedContentButton({ const updateEnabled = type === 'interactions' ? updateHideUntrustedInteractions : updateHideUntrustedNotifications + const typeText = t(type) + return ( @@ -47,21 +51,25 @@ export default function HideUntrustedContentButton({ - {enabled ? 'Show' : 'Hide'} untrusted {type} + {enabled + ? t('Show untrusted {type}', { type: typeText }) + : t('Hide untrusted {type}', { type: typeText })} {enabled - ? `Currently hiding ${type} from untrusted users. ` - : `Currently showing all ${type}. `} - Trusted users include people you follow and people they follow. + ? t('Currently hiding {type} from untrusted users.', { type: typeText }) + : t('Currently showing all {type}.', { type: typeText })}{' '} + {t('Trusted users include people you follow and people they follow.')}{' '} {enabled - ? ` Click continue to show all ${type}.` - : ` Click continue to hide ${type} from untrusted users.`} + ? t('Click continue to show all {type}.', { type: typeText }) + : t('Click continue to hide {type} from untrusted users.', { type: typeText })} - Cancel - updateEnabled(!enabled)}>Continue + {t('Cancel')} + updateEnabled(!enabled)}> + {t('Continue')} + diff --git a/src/i18n/locales/ar.ts b/src/i18n/locales/ar.ts index e243a1f4..291cfb63 100644 --- a/src/i18n/locales/ar.ts +++ b/src/i18n/locales/ar.ts @@ -259,6 +259,20 @@ export default { Warning: 'تحذير', 'Your current API key will become invalid immediately, and any applications using it will stop working until you update them with the new key.': 'مفتاح API الحالي الخاص بك سيصبح غير صالح على الفور، وأي تطبيقات تستخدمه ستتوقف عن العمل حتى تقوم بتحديثها بالمفتاح الجديد.', - 'Service address': 'عنوان الخدمة' + 'Service address': 'عنوان الخدمة', + Pay: 'دفع', + interactions: 'التفاعلات', + notifications: 'الإشعارات', + 'Show untrusted {type}': 'إظهار {{type}} غير الموثوق', + 'Hide untrusted {type}': 'إخفاء {{type}} غير الموثوق', + 'Currently hiding {type} from untrusted users.': + 'حاليًا إخفاء {{type}} من المستخدمين غير الموثوقين.', + 'Currently showing all {type}.': 'حاليًا عرض جميع {{type}}.', + 'Click continue to show all {type}.': 'انقر على متابعة لعرض جميع {{type}}.', + 'Click continue to hide {type} from untrusted users.': + 'انقر على متابعة لإخفاء {{type}} من المستخدمين غير الموثوقين.', + 'Trusted users include people you follow and people they follow.': + 'المستخدمون الموثوقون هم الأشخاص الذين تتابعهم والأشخاص الذين يتابعونهم.', + Continue: 'متابعة' } } diff --git a/src/i18n/locales/de.ts b/src/i18n/locales/de.ts index 30c428ff..76f2469f 100644 --- a/src/i18n/locales/de.ts +++ b/src/i18n/locales/de.ts @@ -266,6 +266,20 @@ export default { Warning: 'Warnung', 'Your current API key will become invalid immediately, and any applications using it will stop working until you update them with the new key.': 'Dein aktueller API-Schlüssel wird sofort ungültig, und alle Anwendungen, die ihn verwenden, werden nicht mehr funktionieren, bis du sie mit dem neuen Schlüssel aktualisierst.', - 'Service address': 'Service-Adresse' + 'Service address': 'Service-Adresse', + Pay: 'Bezahlen', + interactions: 'Interaktionen', + notifications: 'Benachrichtigungen', + 'Show untrusted {type}': 'Untrusted {{type}} anzeigen', + 'Hide untrusted {type}': 'Untrusted {{type}} ausblenden', + 'Currently hiding {type} from untrusted users.': + 'Derzeit werden {{type}} von nicht vertrauenswürdigen Benutzern ausgeblendet.', + 'Currently showing all {type}.': 'Derzeit werden alle {{type}} angezeigt.', + 'Click continue to show all {type}.': 'Klicke auf Weiter, um alle {{type}} anzuzeigen.', + 'Click continue to hide {type} from untrusted users.': + 'Klicke auf Weiter, um {{type}} von nicht vertrauenswürdigen Benutzern auszublenden.', + 'Trusted users include people you follow and people they follow.': + 'Vertrauenswürdige Benutzer sind Personen, denen du folgst, und Personen, denen sie folgen.', + Continue: 'Weiter' } } diff --git a/src/i18n/locales/en.ts b/src/i18n/locales/en.ts index 935337aa..8cfea414 100644 --- a/src/i18n/locales/en.ts +++ b/src/i18n/locales/en.ts @@ -259,6 +259,20 @@ export default { Warning: 'Warning', 'Your current API key will become invalid immediately, and any applications using it will stop working until you update them with the new key.': 'Your current API key will become invalid immediately, and any applications using it will stop working until you update them with the new key.', - 'Service address': 'Service address' + 'Service address': 'Service address', + Pay: 'Pay', + interactions: 'interactions', + notifications: 'notifications', + 'Show untrusted {type}': 'Show untrusted {{type}}', + 'Hide untrusted {type}': 'Hide untrusted {{type}}', + 'Currently hiding {type} from untrusted users.': + 'Currently hiding {{type}} from untrusted users.', + 'Currently showing all {type}.': 'Currently showing all {{type}}.', + 'Click continue to show all {type}.': 'Click continue to show all {{type}}.', + '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.', + Continue: 'Continue' } } diff --git a/src/i18n/locales/es.ts b/src/i18n/locales/es.ts index b8715905..c91c0f70 100644 --- a/src/i18n/locales/es.ts +++ b/src/i18n/locales/es.ts @@ -264,6 +264,20 @@ export default { Warning: 'Advertencia', 'Your current API key will become invalid immediately, and any applications using it will stop working until you update them with the new key.': 'Tu clave API actual se volverá inválida de inmediato, y cualquier aplicación que la use dejará de funcionar hasta que las actualices con la nueva clave.', - 'Service address': 'Dirección del servicio' + 'Service address': 'Dirección del servicio', + Pay: 'Pagar', + interactions: 'interacciones', + notifications: 'notificaciones', + 'Show untrusted {type}': 'Mostrar {{type}} no confiables', + 'Hide untrusted {type}': 'Ocultar {{type}} no confiables', + 'Currently hiding {type} from untrusted users.': + 'Actualmente ocultando {{type}} de usuarios no confiables.', + 'Currently showing all {type}.': 'Actualmente mostrando todas las {{type}}.', + 'Click continue to show all {type}.': 'Haz clic en continuar para mostrar todas las {{type}}.', + 'Click continue to hide {type} from untrusted users.': + 'Haz clic en continuar para ocultar {{type}} de usuarios no confiables.', + '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.', + Continue: 'Continuar' } } diff --git a/src/i18n/locales/fr.ts b/src/i18n/locales/fr.ts index 6d709777..aebf321e 100644 --- a/src/i18n/locales/fr.ts +++ b/src/i18n/locales/fr.ts @@ -264,6 +264,20 @@ export default { Warning: 'Avertissement', 'Your current API key will become invalid immediately, and any applications using it will stop working until you update them with the new key.': 'Votre clé API actuelle deviendra immédiatement invalide, et toutes les applications qui l’utilisent cesseront de fonctionner jusqu’à ce que vous les mettiez à jour avec la nouvelle clé.', - 'Service address': 'Adresse du service' + 'Service address': 'Adresse du service', + Pay: 'Payer', + interactions: 'interactions', + notifications: 'notifications', + 'Show untrusted {type}': 'Afficher les {{type}} non fiables', + 'Hide untrusted {type}': 'Cacher les {{type}} non fiables', + 'Currently hiding {type} from untrusted users.': + 'Actuellement, les {{type}} des utilisateurs non fiables sont masquées.', + 'Currently showing all {type}.': 'Actuellement, tous les {{type}} sont affichés.', + 'Click continue to show all {type}.': 'Cliquez sur continuer pour afficher tous les {{type}}.', + 'Click continue to hide {type} from untrusted users.': + 'Cliquez sur continuer pour masquer les {{type}} des utilisateurs non fiables.', + 'Trusted users include people you follow and people they follow.': + 'Les utilisateurs de confiance incluent les personnes que vous suivez et les personnes qu’elles suivent.', + Continue: 'Continuer' } } diff --git a/src/i18n/locales/it.ts b/src/i18n/locales/it.ts index 20a3378d..9b54bfbb 100644 --- a/src/i18n/locales/it.ts +++ b/src/i18n/locales/it.ts @@ -263,6 +263,20 @@ export default { Warning: 'Attenzione', 'Your current API key will become invalid immediately, and any applications using it will stop working until you update them with the new key.': 'La tua attuale chiave API diventerà immediatamente non valida e tutte le applicazioni che la utilizzano smetteranno di funzionare finché non le aggiornerai con la nuova chiave.', - 'Service address': 'Indirizzo del servizio' + 'Service address': 'Indirizzo del servizio', + Pay: 'Paga', + interactions: 'interazioni', + notifications: 'notifiche', + 'Show untrusted {type}': 'Mostra {{type}} non fidati', + 'Hide untrusted {type}': 'Nascondi {{type}} non fidati', + 'Currently hiding {type} from untrusted users.': + 'Attualmente nascondo {{type}} da utenti non fidati.', + 'Currently showing all {type}.': 'Attualmente mostro tutti {{type}}.', + 'Click continue to show all {type}.': 'Clicca su continua per mostrare tutti {{type}}.', + 'Click continue to hide {type} from untrusted users.': + 'Clicca su continua per nascondere {{type}} da utenti non fidati.', + 'Trusted users include people you follow and people they follow.': + 'Gli utenti fidati includono le persone che segui e le persone che seguono loro.', + Continue: 'Continua' } } diff --git a/src/i18n/locales/ja.ts b/src/i18n/locales/ja.ts index 688f0129..1f78f433 100644 --- a/src/i18n/locales/ja.ts +++ b/src/i18n/locales/ja.ts @@ -260,6 +260,21 @@ export default { Warning: '警告', 'Your current API key will become invalid immediately, and any applications using it will stop working until you update them with the new key.': '現在のAPIキーはすぐに無効になり、それを使用しているアプリケーションは新しいキーで更新するまで動作しなくなります。', - 'Service address': 'サービスアドレス' + 'Service address': 'サービスアドレス', + Pay: '支払う', + interactions: 'インタラクション', + notifications: '通知', + 'Show untrusted {type}': '信頼されていない{{type}}を表示', + 'Hide untrusted {type}': '信頼されていない{{type}}を非表示', + 'Currently hiding {type} from untrusted users.': + '現在、信頼されていないユーザーからの{{type}}を非表示にしています。', + 'Currently showing all {type}.': '現在、すべての{{type}}を表示しています。', + 'Click continue to show all {type}.': + 'すべての{{type}}を表示するには続行をクリックしてください。', + 'Click continue to hide {type} from untrusted users.': + '信頼されていないユーザーからの{{type}}を非表示にするには続行をクリックしてください。', + 'Trusted users include people you follow and people they follow.': + '信頼できるユーザーには、あなたがフォローしている人とその人がフォローしている人が含まれます。', + Continue: '続行' } } diff --git a/src/i18n/locales/pl.ts b/src/i18n/locales/pl.ts index 37b7f5a3..09dfd868 100644 --- a/src/i18n/locales/pl.ts +++ b/src/i18n/locales/pl.ts @@ -262,6 +262,20 @@ export default { Warning: 'Ostrzeżenie', 'Your current API key will become invalid immediately, and any applications using it will stop working until you update them with the new key.': 'Twój obecny klucz API stanie się nieaktywny natychmiast, a wszystkie aplikacje korzystające z niego przestaną działać, dopóki nie zaktualizujesz ich nowym kluczem.', - 'Service address': 'Adres usługi' + 'Service address': 'Adres usługi', + Pay: 'Zapłać', + interactions: 'Interakcje', + notifications: 'Powiadomienia', + 'Show untrusted {type}': 'Pokaż nieznane {{type}}', + 'Hide untrusted {type}': 'Ukryj nieznane {{type}}', + 'Currently hiding {type} from untrusted users.': + 'Obecnie ukrywasz {{type}} od nieznanych użytkowników.', + 'Currently showing all {type}.': 'Obecnie wyświetlasz wszystkie {{type}}.', + 'Click continue to show all {type}.': 'Kliknij kontynuuj, aby wyświetlić wszystkie {{type}}.', + 'Click continue to hide {type} from untrusted users.': + 'Kliknij kontynuuj, aby ukryć {{type}} od nieznanych użytkowników.', + 'Trusted users include people you follow and people they follow.': + 'Zaufani użytkownicy to osoby, które obserwujesz i osoby, które oni obserwują.', + Continue: 'Kontynuuj' } } diff --git a/src/i18n/locales/pt-BR.ts b/src/i18n/locales/pt-BR.ts index bd7ff87b..026e68b8 100644 --- a/src/i18n/locales/pt-BR.ts +++ b/src/i18n/locales/pt-BR.ts @@ -262,6 +262,20 @@ export default { Warning: 'Aviso', 'Your current API key will become invalid immediately, and any applications using it will stop working until you update them with the new key.': 'Sua chave API atual se tornará inválida imediatamente, e qualquer aplicativo que a utilize deixará de funcionar até que você os atualize com a nova chave.', - 'Service address': 'Endereço do serviço' + 'Service address': 'Endereço do serviço', + Pay: 'Pagar', + interactions: 'interações', + notifications: 'notificações', + 'Show untrusted {type}': 'Mostrar {{type}} não confiáveis', + 'Hide untrusted {type}': 'Ocultar {{type}} não confiáveis', + 'Currently hiding {type} from untrusted users.': + 'Atualmente ocultando {{type}} de usuários não confiáveis.', + 'Currently showing all {type}.': 'Atualmente mostrando todas as {{type}}.', + 'Click continue to show all {type}.': 'Clique em continuar para mostrar todas as {{type}}.', + 'Click continue to hide {type} from untrusted users.': + 'Clique em continuar para ocultar {{type}} de usuários não confiáveis.', + 'Trusted users include people you follow and people they follow.': + 'Usuários confiáveis incluem pessoas que você segue e pessoas que elas seguem.', + Continue: 'Continuar' } } diff --git a/src/i18n/locales/pt-PT.ts b/src/i18n/locales/pt-PT.ts index 1c53c61f..17c5a339 100644 --- a/src/i18n/locales/pt-PT.ts +++ b/src/i18n/locales/pt-PT.ts @@ -263,6 +263,20 @@ export default { Warning: 'Aviso', 'Your current API key will become invalid immediately, and any applications using it will stop working until you update them with the new key.': 'Sua chave API atual se tornará inválida imediatamente, e qualquer aplicativo que a utilize deixará de funcionar até que você os atualize com a nova chave.', - 'Service address': 'Endereço do serviço' + 'Service address': 'Endereço do serviço', + Pay: 'Pagar', + interactions: 'interações', + notifications: 'notificações', + 'Show untrusted {type}': 'Mostrar {{type}} não confiáveis', + 'Hide untrusted {type}': 'Esconder {{type}} não confiáveis', + 'Currently hiding {type} from untrusted users.': + 'Atualmente escondendo {{type}} de usuários não confiáveis.', + 'Currently showing all {type}.': 'Atualmente mostrando todos os {{type}}.', + 'Click continue to show all {type}.': 'Clique em continuar para mostrar todos os {{type}}.', + 'Click continue to hide {type} from untrusted users.': + 'Clique em continuar para esconder {{type}} de usuários não confiáveis.', + 'Trusted users include people you follow and people they follow.': + 'Usuários confiáveis incluem pessoas que você segue e pessoas que elas seguem.', + Continue: 'Continuar' } } diff --git a/src/i18n/locales/ru.ts b/src/i18n/locales/ru.ts index 07360732..4c6da7d8 100644 --- a/src/i18n/locales/ru.ts +++ b/src/i18n/locales/ru.ts @@ -264,6 +264,20 @@ export default { Warning: 'Предупреждение', 'Your current API key will become invalid immediately, and any applications using it will stop working until you update them with the new key.': 'Ваш текущий API-ключ станет недействительным немедленно, и любые приложения, использующие его, перестанут работать, пока вы не обновите их новым ключом.', - 'Service address': 'Адрес сервиса' + 'Service address': 'Адрес сервиса', + Pay: 'Оплатить', + interactions: 'взаимодействия', + notifications: 'уведомления', + 'Show untrusted {type}': 'Показать недоверенные {{type}}', + 'Hide untrusted {type}': 'Скрыть недоверенные {{type}}', + 'Currently hiding {type} from untrusted users.': + 'В настоящее время скрываются {{type}} от недоверенных пользователей.', + 'Currently showing all {type}.': 'В настоящее время отображаются все {{type}}.', + 'Click continue to show all {type}.': 'Нажмите "Продолжить", чтобы показать все {{type}}.', + 'Click continue to hide {type} from untrusted users.': + 'Нажмите "Продолжить", чтобы скрыть {{type}} от недоверенных пользователей.', + 'Trusted users include people you follow and people they follow.': + 'Доверенные пользователи включают людей, на которых вы подписаны, и людей, на которых они подписаны.', + Continue: 'Продолжить' } } diff --git a/src/i18n/locales/zh.ts b/src/i18n/locales/zh.ts index b06a5f93..9e90eb32 100644 --- a/src/i18n/locales/zh.ts +++ b/src/i18n/locales/zh.ts @@ -260,6 +260,19 @@ export default { Warning: '警告', 'Your current API key will become invalid immediately, and any applications using it will stop working until you update them with the new key.': '您当前的 API key 将立即失效,任何使用它的应用程序将停止工作,直到您用新 key 更新它们。', - 'Service address': '服务地址' + 'Service address': '服务地址', + Pay: '支付', + interactions: '互动', + notifications: '通知', + 'Show untrusted {type}': '显示不受信任的{{type}}', + 'Hide untrusted {type}': '隐藏不受信任的{{type}}', + 'Currently hiding {type} from untrusted users.': '当前隐藏来自不受信任用户的{{type}}。', + 'Currently showing all {type}.': '当前显示所有{{type}}。', + 'Click continue to show all {type}.': '点击继续显示所有{{type}}。', + 'Click continue to hide {type} from untrusted users.': + '点击继续隐藏来自不受信任用户的{{type}}。', + 'Trusted users include people you follow and people they follow.': + '受信任的用户包括您关注的人和他们关注的人。', + Continue: '继续' } }