feat: add some i18n translation

This commit is contained in:
codytseng
2025-06-24 22:54:44 +08:00
parent a834e76522
commit 2121ca7556
13 changed files with 196 additions and 20 deletions

View File

@@ -13,6 +13,7 @@ import { Button, buttonVariants } from '@/components/ui/button'
import { useUserTrust } from '@/providers/UserTrustProvider' import { useUserTrust } from '@/providers/UserTrustProvider'
import { VariantProps } from 'class-variance-authority' import { VariantProps } from 'class-variance-authority'
import { Shield, ShieldCheck } from 'lucide-react' import { Shield, ShieldCheck } from 'lucide-react'
import { useTranslation } from 'react-i18next'
export default function HideUntrustedContentButton({ export default function HideUntrustedContentButton({
type, type,
@@ -21,6 +22,7 @@ export default function HideUntrustedContentButton({
type: 'interactions' | 'notifications' type: 'interactions' | 'notifications'
size?: VariantProps<typeof buttonVariants>['size'] size?: VariantProps<typeof buttonVariants>['size']
}) { }) {
const { t } = useTranslation()
const { const {
hideUntrustedInteractions, hideUntrustedInteractions,
hideUntrustedNotifications, hideUntrustedNotifications,
@@ -33,6 +35,8 @@ export default function HideUntrustedContentButton({
const updateEnabled = const updateEnabled =
type === 'interactions' ? updateHideUntrustedInteractions : updateHideUntrustedNotifications type === 'interactions' ? updateHideUntrustedInteractions : updateHideUntrustedNotifications
const typeText = t(type)
return ( return (
<AlertDialog> <AlertDialog>
<AlertDialogTrigger asChild> <AlertDialogTrigger asChild>
@@ -47,21 +51,25 @@ export default function HideUntrustedContentButton({
<AlertDialogContent> <AlertDialogContent>
<AlertDialogHeader> <AlertDialogHeader>
<AlertDialogTitle> <AlertDialogTitle>
{enabled ? 'Show' : 'Hide'} untrusted {type} {enabled
? t('Show untrusted {type}', { type: typeText })
: t('Hide untrusted {type}', { type: typeText })}
</AlertDialogTitle> </AlertDialogTitle>
<AlertDialogDescription> <AlertDialogDescription>
{enabled {enabled
? `Currently hiding ${type} from untrusted users. ` ? t('Currently hiding {type} from untrusted users.', { type: typeText })
: `Currently showing all ${type}. `} : t('Currently showing all {type}.', { type: typeText })}{' '}
Trusted users include people you follow and people they follow. {t('Trusted users include people you follow and people they follow.')}{' '}
{enabled {enabled
? ` Click continue to show all ${type}.` ? t('Click continue to show all {type}.', { type: typeText })
: ` Click continue to hide ${type} from untrusted users.`} : t('Click continue to hide {type} from untrusted users.', { type: typeText })}
</AlertDialogDescription> </AlertDialogDescription>
</AlertDialogHeader> </AlertDialogHeader>
<AlertDialogFooter> <AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel> <AlertDialogCancel>{t('Cancel')}</AlertDialogCancel>
<AlertDialogAction onClick={() => updateEnabled(!enabled)}>Continue</AlertDialogAction> <AlertDialogAction onClick={() => updateEnabled(!enabled)}>
{t('Continue')}
</AlertDialogAction>
</AlertDialogFooter> </AlertDialogFooter>
</AlertDialogContent> </AlertDialogContent>
</AlertDialog> </AlertDialog>

View File

@@ -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.':
'مفتاح API الحالي الخاص بك سيصبح غير صالح على الفور، وأي تطبيقات تستخدمه ستتوقف عن العمل حتى تقوم بتحديثها بالمفتاح الجديد.', 'مفتاح 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: 'متابعة'
} }
} }

View File

@@ -266,6 +266,20 @@ export default {
Warning: 'Warnung', 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.': '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.', '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'
} }
} }

View File

@@ -259,6 +259,20 @@ export default {
Warning: 'Warning', 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.':
'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'
} }
} }

View File

@@ -264,6 +264,20 @@ export default {
Warning: 'Advertencia', 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.': '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.', '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'
} }
} }

View File

@@ -264,6 +264,20 @@ export default {
Warning: 'Avertissement', 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.': '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 lutilisent cesseront de fonctionner jusquà ce que vous les mettiez à jour avec la nouvelle clé.', 'Votre clé API actuelle deviendra immédiatement invalide, et toutes les applications qui lutilisent 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 quelles suivent.',
Continue: 'Continuer'
} }
} }

View File

@@ -263,6 +263,20 @@ export default {
Warning: 'Attenzione', 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.': '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.', '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'
} }
} }

View File

@@ -260,6 +260,21 @@ 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.':
'現在のAPIキーはすぐに無効になり、それを使用しているアプリケーションは新しいキーで更新するまで動作しなくなります。', '現在の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: '続行'
} }
} }

View File

@@ -262,6 +262,20 @@ export default {
Warning: 'Ostrzeżenie', 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.': '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.', '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'
} }
} }

View File

@@ -262,6 +262,20 @@ export default {
Warning: 'Aviso', 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.': '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.', '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'
} }
} }

View File

@@ -263,6 +263,20 @@ export default {
Warning: 'Aviso', 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.': '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.', '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'
} }
} }

View File

@@ -264,6 +264,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.':
'Ваш текущий API-ключ станет недействительным немедленно, и любые приложения, использующие его, перестанут работать, пока вы не обновите их новым ключом.', 'Ваш текущий 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: 'Продолжить'
} }
} }

View File

@@ -260,6 +260,19 @@ 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.':
'您当前的 API key 将立即失效,任何使用它的应用程序将停止工作,直到您用新 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: '继续'
} }
} }