mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-06-03 23:01:47 +08:00
🔨 Refactor: setting-page ui
This commit is contained in:
@@ -29,3 +29,5 @@ export const PICGO_TOGGLE_PLUGIN = 'PICGO_TOGGLE_PLUGIN'
|
||||
export const PASTE_TEXT = 'PASTE_TEXT'
|
||||
export const SET_MINI_WINDOW_POS = 'SET_MINI_WINDOW_POS'
|
||||
export const RENAME_FILE_NAME = 'RENAME_FILE_NAME'
|
||||
export const SHOW_MAIN_PAGE_QRCODE = 'SHOW_MAIN_PAGE_QRCODE'
|
||||
export const SHOW_MAIN_PAGE_DONATION = 'SHOW_MAIN_PAGE_DONATION'
|
||||
|
||||
@@ -5,23 +5,15 @@ const languageList = {
|
||||
'zh-CN': ZH_CN
|
||||
}
|
||||
|
||||
const lowercaseKeys = (obj: any) =>
|
||||
Object.keys(obj).reduce((acc: any, key: string) => {
|
||||
acc[key.toLowerCase()] = obj[key]
|
||||
return acc
|
||||
}, {})
|
||||
|
||||
// FIXME: @picgo/i18n no lowecase
|
||||
const objectAdapter = new ObjectAdapter(lowercaseKeys(languageList))
|
||||
const objectAdapter = new ObjectAdapter(languageList)
|
||||
|
||||
const i18n = new I18n({
|
||||
adapter: objectAdapter,
|
||||
defaultLanguage: 'zh-cn'
|
||||
defaultLanguage: 'zh-CN'
|
||||
})
|
||||
|
||||
// FIXME: @picgo/i18n args should be optional
|
||||
const T = (key: ILocalesKey, args: IStringKeyMap = {}): string => {
|
||||
return i18n.translate(key, args)!
|
||||
return i18n.translate(key, args) || ''
|
||||
}
|
||||
|
||||
export { i18n, T }
|
||||
|
||||
@@ -23,6 +23,7 @@ export const ZH_CN = {
|
||||
CONFIG_THING: '配置${c}',
|
||||
FIND_NEW_VERSION: '发现新版本',
|
||||
NO_MORE_NOTICE: '以后不再提醒',
|
||||
SHOW_DEVTOOLS: '打开开发者工具',
|
||||
|
||||
// ---renderer i18n---
|
||||
CHOOSE_YOUR_DEFAULT_PICBED: '选择 ${d} 作为你默认图床:',
|
||||
|
||||
Reference in New Issue
Block a user