feat: translation (#389)

This commit is contained in:
Cody Tseng
2025-06-23 23:52:21 +08:00
committed by GitHub
parent e2e115ebeb
commit df9066eae0
43 changed files with 1466 additions and 47 deletions

View File

@@ -1,3 +1,4 @@
import { useTranslatedEvent } from '@/hooks'
import {
EmbeddedEmojiParser,
EmbeddedEventParser,
@@ -19,8 +20,8 @@ import { Event } from 'nostr-tools'
import { memo } from 'react'
import {
EmbeddedHashtag,
EmbeddedMention,
EmbeddedLNInvoice,
EmbeddedMention,
EmbeddedNormalUrl,
EmbeddedNote,
EmbeddedWebsocketUrl
@@ -31,7 +32,8 @@ import VideoPlayer from '../VideoPlayer'
import WebPreview from '../WebPreview'
const Content = memo(({ event, className }: { event: Event; className?: string }) => {
const nodes = parseContent(event.content, [
const translatedEvent = useTranslatedEvent(event.id)
const nodes = parseContent(translatedEvent?.content ?? event.content, [
EmbeddedImageParser,
EmbeddedVideoParser,
EmbeddedNormalUrlParser,