refactor: remove electron-related code

This commit is contained in:
codytseng
2024-12-21 23:20:30 +08:00
parent bed8df06e8
commit 2b1e6fe8f5
200 changed files with 2771 additions and 8432 deletions

89
src/i18n/en.ts Normal file
View File

@@ -0,0 +1,89 @@
export default {
translation: {
'Welcome! 🥳': 'Welcome! 🥳',
About: 'About',
'New post': 'New post',
Post: 'Post',
'Relay settings': 'Relay settings',
SidebarRelays: 'Relays',
Refresh: 'Refresh',
Profile: 'Profile',
Logout: 'Logout',
Following: 'Following',
reposted: 'reposted',
'just now': 'just now',
'n minutes ago': '{{n}} minutes ago',
'n m': '{{n}}m',
'n hours ago': '{{n}} hours ago',
'n h': '{{n}}h',
'n days ago': '{{n}} days ago',
'n d': '{{n}}d',
date: '{{timestamp, date}}',
Follow: 'Follow',
Unfollow: 'Unfollow',
'Follow failed': 'Follow failed',
'Unfollow failed': 'Unfollow failed',
'show new notes': 'show new notes',
'loading...': 'loading...',
'no more notes': 'no more notes',
'reply to': 'reply to',
reply: 'reply',
Reply: 'Reply',
'load more older replies': 'load more older replies',
'Write something...': 'Write something...',
Cancel: 'Cancel',
Mentions: 'Mentions',
'Failed to post': 'Failed to post',
'Post successful': 'Post successful',
'Your post has been published': 'Your post has been published',
Repost: 'Repost',
Quote: 'Quote',
'copy embedded code': 'copy embedded code',
'raw event': 'raw event',
Like: 'Like',
'switch to light theme': 'switch to light theme',
'switch to dark theme': 'switch to dark theme',
'switch to system theme': 'switch to system theme',
note: 'note',
"username's following": "{{username}}'s following",
following: 'following',
Login: 'Login',
'Follows you': 'Follows you',
'relay collection name already exists': 'relay collection name already exists',
'Relay Settings': 'Relay Settings',
'Relay collection name': 'Relay collection name',
'Add a new relay collection': 'Add a new relay collection',
Add: 'Add',
'n relays': '{{n}} relays',
Rename: 'Rename',
'Copy share link': 'Copy share link',
Delete: 'Delete',
'Relay already exists': 'Relay already exists',
'invalid relay URL': 'invalid relay URL',
'Add a new relay': 'Add a new relay',
back: 'back',
'Lost in the void': 'Lost in the void',
'Carry me home': 'Carry me home',
'no replies': 'no replies',
'Reply to': 'Reply to',
Search: 'Search',
search: 'search',
'The relays you are connected to do not support search':
'The relays you are connected to do not support search',
'supports search': 'supports search',
'Show more...': 'Show more...',
'all users': 'all users',
'Display replies': 'Display replies',
Notes: 'Notes',
'Notes & Replies': 'Notes & Replies',
notifications: 'notifications',
Notifications: 'Notifications',
'no more notifications': 'no more notifications',
'Using private key login is insecure. It is recommended to use a browser extension for login, such as alby, nostr-keyx or nos2x.':
'Using private key login is insecure. It is recommended to use a browser extension for login, such as alby, nostr-keyx or nos2x.',
'Login with Browser Extension': 'Login with Browser Extension',
'Login with Bunker': 'Login with Bunker',
'Login with Private Key': 'Login with Private Key',
'reload notes': 'reload notes'
}
}

31
src/i18n/index.ts Normal file
View File

@@ -0,0 +1,31 @@
import i18n from 'i18next'
import { initReactI18next } from 'react-i18next'
import LanguageDetector from 'i18next-browser-languagedetector'
import en from './en'
import zh from './zh'
import dayjs from 'dayjs'
const resources = {
en,
zh
}
i18n
.use(LanguageDetector)
.use(initReactI18next)
.init({
fallbackLng: 'en',
resources,
interpolation: {
escapeValue: false // react already safes from xss
}
})
i18n.services.formatter?.add('date', (timestamp, lng) => {
if (lng?.startsWith('zh')) {
return dayjs(timestamp).format('YYYY/MM/DD')
}
return dayjs(timestamp).format('MMM D, YYYY')
})
export default i18n

88
src/i18n/zh.ts Normal file
View File

@@ -0,0 +1,88 @@
export default {
translation: {
'Welcome! 🥳': '来都来了',
About: '关于',
'New post': '发布新笔记',
Post: '发布笔记',
'Relay settings': '服务器设置',
SidebarRelays: '服务器',
Refresh: '刷新列表',
Profile: '个人资料',
Logout: '退出登录',
Following: '关注',
reposted: '转发',
'just now': '刚刚',
'n minutes ago': '{{n}} 分钟前',
'n m': '{{n}}分',
'n hours ago': '{{n}} 小时前',
'n h': '{{n}}时',
'n days ago': '{{n}} 天前',
'n d': '{{n}}天',
date: '{{timestamp, date}}',
Follow: '关注',
Unfollow: '取消关注',
'Follow failed': '关注失败',
'Unfollow failed': '取消关注失败',
'show new notes': '显示新笔记',
'loading...': '加载中...',
'no more notes': '到底了',
'reply to': '回复',
reply: '回复',
Reply: '回复',
'load more older replies': '加载更多早期回复',
'Write something...': '写点什么...',
Cancel: '取消',
Mentions: '提及',
'Failed to post': '发布失败',
'Post successful': '发布成功',
'Your post has been published': '您的笔记已发布',
Repost: '转发',
Quote: '引用',
'copy embedded code': '复制嵌入代码',
'raw event': '原始事件',
Like: '点赞',
'switch to light theme': '切换到浅色主题',
'switch to dark theme': '切换到深色主题',
'switch to system theme': '切换到系统主题',
note: '笔记',
"username's following": '{{username}} 的关注',
following: '关注',
Login: '登录',
'Follows you': '关注了你',
'relay collection name already exists': '服务器组名已存在',
'Relay Settings': '服务器设置',
'Relay collection name': '服务器组名',
'Add a new relay collection': '添加新的服务器组',
Add: '添加',
'n relays': '{{n}} 个服务器',
Rename: '重命名',
'Copy share link': '复制分享链接',
Delete: '删除',
'Relay already exists': '服务器已存在',
'invalid relay URL': '无效的服务器地址',
'Add a new relay': '添加新的服务器',
back: '返回',
'Lost in the void': '迷失在虚空中',
'Carry me home': '带我回家',
'no replies': '暂无回复',
'Reply to': '回复',
Search: '搜索',
search: '搜索',
'The relays you are connected to do not support search': '您连接的服务器不支持搜索',
'supports search': '支持搜索',
'Show more...': '查看更多...',
'all users': '所有用户',
'Display replies': '显示回复',
Notes: '笔记',
'Notes & Replies': '笔记 & 回复',
notifications: '通知',
Notifications: '通知',
'no more notifications': '到底了',
'Using private key login is insecure. It is recommended to use a browser extension for login, such as alby, nostr-keyx or nos2x.':
'使用私钥登录是不安全的。建议使用浏览器插件进行登录,例如 alby、nostr-keyx 或 nos2x',
'Login with Browser Extension': '浏览器插件登录',
'Login with Bunker': 'Bunker 登录',
'Login with Private Key': '私钥登录',
'reload notes': '重新加载笔记'
}
}