chore: improve translations

This commit is contained in:
codytseng 2025-11-16 14:35:34 +08:00
parent dada8c83b5
commit cde0b49e2e
19 changed files with 149 additions and 24 deletions

View file

@ -74,7 +74,7 @@ export function useMenuActions({
const items = []
if (pubkey && event.pubkey === pubkey) {
items.push({
label: <div className="text-left"> {t('Write relays')}</div>,
label: <div className="text-left"> {t('Optimal relays')}</div>,
onClick: async () => {
closeDrawer()
const promise = async () => {
@ -86,10 +86,12 @@ export function useMenuActions({
toast.promise(promise, {
loading: t('Republishing...'),
success: () => {
return t('Successfully republish to your write relays')
return t(
"Successfully republish to optimal relays (your write relays and mentioned users' read relays)"
)
},
error: (err) => {
return t('Failed to republish to your write relays: {{error}}', {
return t('Failed to republish to optimal relays: {{error}}', {
error: err.message
})
}

View file

@ -7,6 +7,7 @@ import {
DropdownMenuSeparator,
DropdownMenuTrigger
} from '@/components/ui/dropdown-menu'
import { Label } from '@/components/ui/label'
import { Separator } from '@/components/ui/separator'
import { isProtectedEvent } from '@/lib/event'
import { simplifyUrl } from '@/lib/url'
@ -67,7 +68,7 @@ export default function PostRelaySelector({
if (postTargetItems.length === 1) {
const item = postTargetItems[0]
if (item.type === 'writeRelays') {
return t('Write relays')
return t('Optimal relays')
}
if (item.type === 'relay') {
return simplifyUrl(item.url)
@ -89,7 +90,7 @@ export default function PostRelaySelector({
return count
}, 0)
if (hasWriteRelays) {
return t('Write relays and {{count}} other relays', { count: relayCount })
return t('Optimal relays and {{count}} other relays', { count: relayCount })
}
return t('{{count}} relays', { count: relayCount })
}, [postTargetItems])
@ -207,7 +208,7 @@ export default function PostRelaySelector({
return (
<>
<div className="flex items-center gap-2">
{t('Post to')}
<Label>{t('Post to')}</Label>
<Button
variant="outline"
className="px-2 flex-1 max-w-fit justify-start"
@ -234,7 +235,7 @@ export default function PostRelaySelector({
return (
<DropdownMenu>
<div className="flex items-center gap-2">
{t('Post to')}
<Label>{t('Post to')}</Label>
<DropdownMenuTrigger asChild>
<Button variant="outline" className="px-2 flex-1 max-w-fit justify-start">
<div className="truncate">{description}</div>