feat: improve mobile experience

This commit is contained in:
codytseng
2025-01-02 21:57:14 +08:00
parent 8ec0d46d58
commit 3946e603b3
98 changed files with 2508 additions and 1058 deletions

View File

@@ -4,7 +4,9 @@ export default {
About: 'About',
'New post': 'New post',
Post: 'Post',
Home: 'Home',
'Relay settings': 'Relay settings',
Settings: 'Settings',
SidebarRelays: 'Relays',
Refresh: 'Refresh',
Profile: 'Profile',
@@ -44,9 +46,8 @@ export default {
'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',
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',
@@ -67,16 +68,14 @@ export default {
'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',
'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.':
@@ -87,9 +86,21 @@ export default {
'reload notes': 'reload notes',
'Logged in Accounts': 'Logged in Accounts',
'Add an Account': 'Add an Account',
Accounts: 'Accounts',
'More options': 'More options',
'Add client tag': 'Add client tag',
'Show others this was sent via Jumble': 'Show others this was sent via Jumble'
'Show others this was sent via Jumble': 'Show others this was sent via Jumble',
'Are you sure you want to logout?': 'Are you sure you want to logout?',
'relay feeds': 'relay feeds',
edit: 'edit',
Languages: 'Languages',
English: 'English',
Chinese: 'Chinese',
Theme: 'Theme',
System: 'System',
Light: 'Light',
Dark: 'Dark',
Temporary: 'Temporary',
'Choose a relay collection': 'Choose a relay collection',
'Switch account': 'Switch account'
}
}

View File

@@ -1,9 +1,8 @@
import dayjs from 'dayjs'
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,
@@ -11,7 +10,21 @@ const resources = {
}
i18n
.use(LanguageDetector)
.use({
type: 'languageDetector',
detect: function () {
const lng = localStorage.getItem('i18nextLng')
if (lng === 'zh' || lng === 'en') {
return lng
}
return undefined
},
cacheUserLanguage: function (lng: string) {
if (lng === 'zh' || lng === 'en') {
localStorage.setItem('i18nextLng', lng)
}
}
})
.use(initReactI18next)
.init({
fallbackLng: 'en',

View File

@@ -4,7 +4,9 @@ export default {
About: '关于',
'New post': '发布新笔记',
Post: '发布笔记',
Home: '主页',
'Relay settings': '服务器设置',
Settings: '设置',
SidebarRelays: '服务器',
Refresh: '刷新列表',
Profile: '个人资料',
@@ -44,9 +46,8 @@ export default {
'switch to light theme': '切换到浅色主题',
'switch to dark theme': '切换到深色主题',
'switch to system theme': '切换到系统主题',
note: '笔记',
Note: '笔记',
"username's following": '{{username}} 的关注',
following: '关注',
Login: '登录',
'Follows you': '关注了你',
'relay collection name already exists': '服务器组名已存在',
@@ -67,15 +68,13 @@ export default {
'no replies': '暂无回复',
'Reply to': '回复',
Search: '搜索',
search: '搜索',
'The relays you are connected to do not support search': '您连接的服务器不支持搜索',
'supports search': '支持搜索',
'Show more...': '查看更多...',
'all users': '所有用户',
'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.':
@@ -86,9 +85,21 @@ export default {
'reload notes': '重新加载笔记',
'Logged in Accounts': '已登录账户',
'Add an Account': '添加账户',
Accounts: '多帐户',
'More options': '更多选项',
'Add client tag': '添加客户端标签',
'Show others this was sent via Jumble': '告诉别人这是通过 Jumble 发送的'
'Show others this was sent via Jumble': '告诉别人这是通过 Jumble 发送的',
'Are you sure you want to logout?': '确定要退出登录吗?',
'relay feeds': '服务器信息流',
edit: '编辑',
Languages: '语言',
English: '英语',
Chinese: '中文',
Theme: '主题',
System: '系统',
Light: '浅色',
Dark: '深色',
Temporary: '临时',
'Choose a relay collection': '选择一个服务器组',
'Switch account': '切换账户'
}
}