From 82ece2bf7502356c642db764f44c4e83613f4c25 Mon Sep 17 00:00:00 2001 From: fly_mc Date: Tue, 19 Nov 2024 02:53:22 +0800 Subject: [PATCH] fix locales --- locales/en-US.yml | 42 +++++++++++++++++++++--------------------- locales/index.js | 36 +++++++++++++++--------------------- locales/ja-JP.yml | 32 ++++++++++++++++++++++++++++++++ locales/zh-CN.yml | 38 +++++++++++++++++++------------------- locales/zh-TW.yml | 38 +++++++++++++++++++------------------- 5 files changed, 106 insertions(+), 80 deletions(-) diff --git a/locales/en-US.yml b/locales/en-US.yml index ea31764ae..f66a7f242 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -1283,27 +1283,6 @@ fromX: "From {x}" genEmbedCode: "Generate embed code" noteOfThisUser: "Notes by this user" clipNoteLimitExceeded: "No more notes can be added to this clip." -timeTravel: "Time Travel" -timeTravelDescription: "Show posts before this date." -undoPostForm: "Undo" -clearPostForm: "Clear" -pariPlusInfo: "Pari Plus! customized Misskey~!" -pariPlusSystemSettings: "Pari Plus! system settings" -pariPlusNoteSettings: "Pari Plus! note settings" -pariPlusAppearanceSettings: "Pari Plus! appearance settings" -pariPlusFontPicker: "Default fonts" -enableRenderingOptimization: "Enable rendering optimization" -autoTranslateButton: "Display translation function on notes in different languages" -showDetailTimeWhenHover: "Hover the timestamp of the note to expand the detailed time" -noteClickToOpen: "Click to open note details" -enableFallbackReactButton: "Enable fallback reaction button" -enableMFMCheatsheet: "Enable MFM Cheatsheet in post form" -enableUndoClearPostForm: "Enable undo & clear button in post form" -disableReactionsViewer: "Disable emoji reactions viewer" -collapsedUnexpectedLangs: "Collapse notes using unexpected languages" -emojiAutoSpacing: "Automatically add spaces when inserting emoji" -autoSpacing: "Auto Spacing" -autoSpacingDescription: "Adding spaces between CJK and English characters" performance: "Performance" modified: "Modified" discard: "Discard" @@ -2840,6 +2819,27 @@ _selfXssPrevention: _followRequest: recieved: "Requests received" sent: "Requests sent" +timeTravel: "Time Travel" +timeTravelDescription: "Show posts before this date." +undoPostForm: "Undo" +clearPostForm: "Clear" +pariPlusInfo: "Pari Plus! customized Misskey~!" +pariPlusSystemSettings: "Pari Plus! system settings" +pariPlusNoteSettings: "Pari Plus! note settings" +pariPlusAppearanceSettings: "Pari Plus! appearance settings" +pariPlusFontPicker: "Default fonts" +enableRenderingOptimization: "Enable rendering optimization" +autoTranslateButton: "Display translation function on notes in different languages" +showDetailTimeWhenHover: "Hover the timestamp of the note to expand the detailed time" +noteClickToOpen: "Click to open note details" +enableFallbackReactButton: "Enable fallback reaction button" +enableMFMCheatsheet: "Enable MFM Cheatsheet in post form" +enableUndoClearPostForm: "Enable undo & clear button in post form" +disableReactionsViewer: "Disable emoji reactions viewer" +collapsedUnexpectedLangs: "Collapse notes using unexpected languages" +emojiAutoSpacing: "Automatically add spaces when inserting emoji" +autoSpacing: "Auto Spacing" +autoSpacingDescription: "Adding spaces between CJK and English characters" insertNewNotes: "Insert new notes at current position" insertNewNotesDescription: "Insert new notes at the current position while scrolling timeline." clickToShowInstanceTickerWindow: "Click InstanceTicker to show instance info" diff --git a/locales/index.js b/locales/index.js index ecb9e97fe..091d216de 100644 --- a/locales/index.js +++ b/locales/index.js @@ -72,27 +72,21 @@ export function build() { }; removeEmpty(locales); - return Object.entries(locales) - .reduce((a, [k, v]) => (a[k] = (() => { - const [lang] = k.split('-'); - switch (k) { - case 'en-US': - return v; - case 'ja-JP': - return merge(locales['en-US'], v); - case 'ja-KS': - return merge(locales['en-US'], locales['ja-JP'], v); - case 'zh-CN': - case 'zh-TW': - return merge(locales['en-US'], v); - default: - const base = Object.keys(v).some(key => - !locales['en-US'][key] && locales['ja-JP'][key] - ) ? merge(locales['en-US'], locales['ja-JP']) : locales['en-US']; - - return merge(base, v); - } - })(), a), {}); + return Object.entries(locales) + .reduce((a, [k, v]) => (a[k] = (() => { + const [lang] = k.split('-'); + switch (k) { + case 'ja-JP': return v; + case 'ja-KS': + case 'en-US': return merge(locales['ja-JP'], v); + default: return merge( + locales['ja-JP'], + locales['en-US'], + locales[`${lang}-${primaries[lang]}`] ?? {}, + v + ); + } + })(), a), {}); } export default build(); diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 599053575..35583beac 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -2827,3 +2827,35 @@ _selfXssPrevention: _followRequest: recieved: "受け取った申請" sent: "送った申請" + +timeTravel: "Time Travel" +timeTravelDescription: "Show posts before this date." +undoPostForm: "Undo" +clearPostForm: "Clear" +pariPlusInfo: "Pari Plus! customized Misskey~!" +pariPlusSystemSettings: "Pari Plus! system settings" +pariPlusNoteSettings: "Pari Plus! note settings" +pariPlusAppearanceSettings: "Pari Plus! appearance settings" +pariPlusFontPicker: "Default fonts" +enableRenderingOptimization: "Enable rendering optimization" +autoTranslateButton: "Display translation function on notes in different languages" +showDetailTimeWhenHover: "Hover the timestamp of the note to expand the detailed time" +noteClickToOpen: "Click to open note details" +enableFallbackReactButton: "Enable fallback reaction button" +enableMFMCheatsheet: "Enable MFM Cheatsheet in post form" +enableUndoClearPostForm: "Enable undo & clear button in post form" +disableReactionsViewer: "Disable emoji reactions viewer" +collapsedUnexpectedLangs: "Collapse notes using unexpected languages" +emojiAutoSpacing: "Automatically add spaces when inserting emoji" +autoSpacing: "Auto Spacing" +autoSpacingDescription: "Adding spaces between CJK and English characters" +insertNewNotes: "Insert new notes at current position" +insertNewNotesDescription: "Insert new notes at the current position while scrolling timeline." +clickToShowInstanceTickerWindow: "Click InstanceTicker to show instance info" +defaultLike: "Default like reaction" +_dataRequest: + lable: "Data Export" + title: "Request Data" + warn: "Data requests are only possible every 3 days." + text: "Once the data is ready to download, an email will be sent to the email address registered to this account." + button: "Request" diff --git a/locales/zh-CN.yml b/locales/zh-CN.yml index b32ee911d..f0f61121a 100644 --- a/locales/zh-CN.yml +++ b/locales/zh-CN.yml @@ -1291,25 +1291,6 @@ signinWithPasskey: "使用通行密钥登录" unknownWebAuthnKey: "此通行密钥未注册。" passkeyVerificationFailed: "验证通行密钥失败。" passkeyVerificationSucceededButPasswordlessLoginDisabled: "通行密钥验证成功,但账户未开启无密码登录。" -timeTravel: "时光机" -timeTravelDescription: "显示该日期以前的帖子" -pariPlusInfo: "Pari Plus! 定制 Misskey~!" -pariPlusSystemSettings: "Pari Plus! 系统设置" -pariPlusNoteSettings: "Pari Plus! 帖文设置" -pariPlusAppearanceSettings: "Pari Plus! 外观设置" -pariPlusFontPicker: "默认字体" -enableRenderingOptimization: "启用渲染优化" -autoTranslateButton: "在不同语言的帖文上显示翻译功能" -showDetailTimeWhenHover: "悬浮/长按帖文时间戳时,展开详细时间" -noteClickToOpen: "点击展开帖文详情" -enableFallbackReactButton: "开启Fallback回应按钮" -enableMFMCheatsheet: "在帖文编辑框中启用MFM Cheatsheet" -enableUndoClearPostForm: "在帖文编辑框中启用撤销/清空按钮" -disableReactionsViewer: "禁用帖文表情回应显示" -collapsedUnexpectedLangs: "折叠非期望语言的帖文" -emojiAutoSpacing: "在插入 Emoji 时自动添加空格" -autoSpacing: "自动空格" -autoSpacingDescription: "在CJK字符和英文字符中添加空格" messageToFollower: "给关注者的消息" target: "对象" testCaptchaWarning: "此功能为测试 CAPTCHA 用。请勿在正式环境中使用。" @@ -2839,6 +2820,25 @@ _selfXssPrevention: _followRequest: recieved: "收到的请求" sent: "发送的请求" +timeTravel: "时光机" +timeTravelDescription: "显示该日期以前的帖子" +pariPlusInfo: "Pari Plus! 定制 Misskey~!" +pariPlusSystemSettings: "Pari Plus! 系统设置" +pariPlusNoteSettings: "Pari Plus! 帖文设置" +pariPlusAppearanceSettings: "Pari Plus! 外观设置" +pariPlusFontPicker: "默认字体" +enableRenderingOptimization: "启用渲染优化" +autoTranslateButton: "在不同语言的帖文上显示翻译功能" +showDetailTimeWhenHover: "悬浮/长按帖文时间戳时,展开详细时间" +noteClickToOpen: "点击展开帖文详情" +enableFallbackReactButton: "开启Fallback回应按钮" +enableMFMCheatsheet: "在帖文编辑框中启用MFM Cheatsheet" +enableUndoClearPostForm: "在帖文编辑框中启用撤销/清空按钮" +disableReactionsViewer: "禁用帖文表情回应显示" +collapsedUnexpectedLangs: "折叠非期望语言的帖文" +emojiAutoSpacing: "在插入 Emoji 时自动添加空格" +autoSpacing: "自动空格" +autoSpacingDescription: "在CJK字符和英文字符中添加空格" insertNewNotes: "在当前位置插入新帖文" insertNewNotesDescription: "將新收到的帖文插入到正在浏览的位置。" clickToShowInstanceTickerWindow: "点击 InstanceTicker 显示实例信息窗口" diff --git a/locales/zh-TW.yml b/locales/zh-TW.yml index 8a2702533..fb809b4a7 100644 --- a/locales/zh-TW.yml +++ b/locales/zh-TW.yml @@ -1291,25 +1291,6 @@ signinWithPasskey: "使用密碼金鑰登入" unknownWebAuthnKey: "未註冊的金鑰。" passkeyVerificationFailed: "驗證金鑰失敗。" passkeyVerificationSucceededButPasswordlessLoginDisabled: "雖然驗證金鑰成功,但是無密碼登入的方式是停用的。" -timeTravel: "時光機" -timeTravelDescription: "回到指定的日期" -pariPlusInfo: "Pari Plus! 自訂 Misskey~!" -pariPlusSystemSettings: "Pari Plus! 系統設定" -pariPlusNoteSettings: "Pari Plus! 貼文設定" -pariPlusAppearanceSettings: "Pari Plus! 外觀設定" -pariPlusFontPicker: "預設字體" -enableRenderingOptimization: "啓用渲染優化" -autoTranslateButton: "在不同語言的貼文上顯示翻譯功能" -showDetailTimeWhenHover: "長按貼文時間戳記時展開詳細時間" -noteClickToOpen: "點擊展開貼文詳情" -enableFallbackReactButton: "啓用Fallback回應鍵" -enableMFMCheatsheet: "在貼文編輯框中啓用MFM Cheatsheet" -enableUndoClearPostForm: "在貼文編輯框中啓用撤回/清除按鈕" -disableReactionsViewer: "禁用貼文表情回應顯示" -collapsedUnexpectedLangs: "省略顯示非期望語言的貼文" -emojiAutoSpacing: "在插入 Emoji 時自動添加前後間距" -autoSpacing: "自動間距" -autoSpacingDescription: "在CJK字符和英文字符中添加間距" messageToFollower: "給追隨者的訊息" target: "目標 " testCaptchaWarning: "此功能用於 CAPTCHA 的測試。請勿在正式環境中使用。" @@ -2838,6 +2819,25 @@ _selfXssPrevention: _followRequest: recieved: "收到的請求" sent: "送出的請求" +timeTravel: "時光機" +timeTravelDescription: "回到指定的日期" +pariPlusInfo: "Pari Plus! 自訂 Misskey~!" +pariPlusSystemSettings: "Pari Plus! 系統設定" +pariPlusNoteSettings: "Pari Plus! 貼文設定" +pariPlusAppearanceSettings: "Pari Plus! 外觀設定" +pariPlusFontPicker: "預設字體" +enableRenderingOptimization: "啓用渲染優化" +autoTranslateButton: "在不同語言的貼文上顯示翻譯功能" +showDetailTimeWhenHover: "長按貼文時間戳記時展開詳細時間" +noteClickToOpen: "點擊展開貼文詳情" +enableFallbackReactButton: "啓用Fallback回應鍵" +enableMFMCheatsheet: "在貼文編輯框中啓用MFM Cheatsheet" +enableUndoClearPostForm: "在貼文編輯框中啓用撤回/清除按鈕" +disableReactionsViewer: "禁用貼文表情回應顯示" +collapsedUnexpectedLangs: "省略顯示非期望語言的貼文" +emojiAutoSpacing: "在插入 Emoji 時自動添加前後間距" +autoSpacing: "自動間距" +autoSpacingDescription: "在CJK字符和英文字符中添加間距" insertNewNotes: "在當前位置插入新貼文" insertNewNotesDescription: "將剛剛收到的貼文插入到正在瀏覽的位置。" clickToShowInstanceTickerWindow: "點擊 InstanceTicker 顯示實例資訊視窗"