diff options
Diffstat (limited to 'src/i18n')
| -rw-r--r-- | src/i18n/en.json | 63 | ||||
| -rw-r--r-- | src/i18n/eo.json | 2 | ||||
| -rw-r--r-- | src/i18n/messages.js | 26 | ||||
| -rw-r--r-- | src/i18n/zh.json | 49 |
4 files changed, 130 insertions, 10 deletions
diff --git a/src/i18n/en.json b/src/i18n/en.json index 5b97bdcd..bc3c3082 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -137,6 +137,10 @@ "login": "Log in", "description": "Log in with OAuth", "logout": "Log out", + "logout_confirm_title": "Logout confirmation", + "logout_confirm": "Do you really want to logout?", + "logout_confirm_accept_button": "Logout", + "logout_confirm_cancel_button": "Do not logout", "password": "Password", "placeholder": "e.g. lain", "register": "Register", @@ -313,9 +317,13 @@ "email_required": "cannot be left blank", "password_required": "cannot be left blank", "password_confirmation_required": "cannot be left blank", - "password_confirmation_match": "should be the same as password" + "password_confirmation_match": "should be the same as password", + "birthday_required": "cannot be left blank", + "birthday_min_age": "must be on or before {date}" }, - "email_language": "In which language do you want to receive emails from the server?" + "email_language": "In which language do you want to receive emails from the server?", + "birthday": "Birthday:", + "birthday_optional": "Birthday (optional):" }, "remote_user_resolver": { "remote_user_resolver": "Remote user resolver", @@ -336,6 +344,10 @@ "select_all": "Select all" }, "settings": { + "add_language": "Add fallback language", + "remove_language": "Remove", + "primary_language": "Primary language:", + "fallback_language": "Fallback language {index}:", "app_name": "App name", "expert_mode": "Show advanced", "save": "Save changes", @@ -417,6 +429,16 @@ "composing": "Composing", "confirm_new_password": "Confirm new password", "current_password": "Current password", + "confirm_dialogs": "Ask for confirmation when", + "confirm_dialogs_repeat": "repeating a status", + "confirm_dialogs_unfollow": "unfollowing a user", + "confirm_dialogs_block": "blocking a user", + "confirm_dialogs_mute": "muting a user", + "confirm_dialogs_delete": "deleting a status", + "confirm_dialogs_logout": "logging out", + "confirm_dialogs_approve_follow": "approving a follower", + "confirm_dialogs_deny_follow": "denying a follower", + "confirm_dialogs_remove_follower": "removing a follower", "mutes_and_blocks": "Mutes and Blocks", "data_import_export_tab": "Data import / export", "default_vis": "Default visibility scope", @@ -511,6 +533,10 @@ "name": "Label", "value": "Content" }, + "birthday": { + "label": "Birthday", + "show_birthday": "Show my birthday" + }, "account_privacy": "Privacy", "use_contain_fit": "Don't crop the attachment in thumbnails", "name": "Name", @@ -844,6 +870,10 @@ "status": { "favorites": "Favorites", "repeats": "Repeats", + "repeat_confirm": "Do you really want to repeat this status?", + "repeat_confirm_title": "Repeat confirmation", + "repeat_confirm_accept_button": "Repeat", + "repeat_confirm_cancel_button": "Do not repeat", "delete": "Delete status", "edit": "Edit status", "edited_at": "(last edited {time})", @@ -853,6 +883,9 @@ "bookmark": "Bookmark", "unbookmark": "Unbookmark", "delete_confirm": "Do you really want to delete this status?", + "delete_confirm_title": "Delete confirmation", + "delete_confirm_accept_button": "Delete", + "delete_confirm_cancel_button": "Keep", "reply_to": "Reply to", "mentions": "Mentions", "replies_list": "Replies:", @@ -899,10 +932,22 @@ }, "user_card": { "approve": "Approve", + "approve_confirm_title": "Approve confirmation", + "approve_confirm_accept_button": "Approve", + "approve_confirm_cancel_button": "Do not approve", + "approve_confirm": "Do you want to approve {user}'s follow request?", "block": "Block", "blocked": "Blocked!", + "block_confirm_title": "Block confirmation", + "block_confirm": "Do you really want to block {user}?", + "block_confirm_accept_button": "Block", + "block_confirm_cancel_button": "Do not block", "deactivated": "Deactivated", "deny": "Deny", + "deny_confirm_title": "Deny confirmation", + "deny_confirm_accept_button": "Deny", + "deny_confirm_cancel_button": "Do not deny", + "deny_confirm": "Do you want to deny {user}'s follow request?", "edit_profile": "Edit profile", "favorites": "Favorites", "follow": "Follow", @@ -910,6 +955,10 @@ "follow_sent": "Request sent!", "follow_progress": "Requesting…", "follow_unfollow": "Unfollow", + "unfollow_confirm_title": "Unfollow confirmation", + "unfollow_confirm": "Do you really want to unfollow {user}?", + "unfollow_confirm_accept_button": "Unfollow", + "unfollow_confirm_cancel_button": "Do not unfollow", "followees": "Following", "followers": "Followers", "following": "Following!", @@ -921,9 +970,18 @@ "message": "Message", "mute": "Mute", "muted": "Muted", + "mute_confirm_title": "Mute confirmation", + "mute_confirm": "Do you really want to mute {user}?", + "mute_confirm_accept_button": "Mute", + "mute_confirm_cancel_button": "Do not mute", + "mute_duration_prompt": "Mute this user for (0 for indefinite time):", "per_day": "per day", "remote_follow": "Remote follow", "remove_follower": "Remove follower", + "remove_follower_confirm_title": "Remove follower confirmation", + "remove_follower_confirm_accept_button": "Remove", + "remove_follower_confirm_cancel_button": "Keep", + "remove_follower_confirm": "Do you really want to remove {user} from your followers?", "report": "Report", "statuses": "Statuses", "subscribe": "Subscribe", @@ -937,6 +995,7 @@ "hide_repeats": "Hide repeats", "show_repeats": "Show repeats", "bot": "Bot", + "birthday": "Born {birthday}", "admin_menu": { "moderation": "Moderation", "grant_admin": "Grant Admin", diff --git a/src/i18n/eo.json b/src/i18n/eo.json index 3596065c..e013edee 100644 --- a/src/i18n/eo.json +++ b/src/i18n/eo.json @@ -603,7 +603,7 @@ "use_websockets": "Uzi teĥnikaron «websockets» (tuja ĝisdatigo)", "mention_link_display_full_for_remote": "plene nur je uzantoj foraj (ekz. {'@'}zozo{'@'}ekzemplo.org)", "expert_mode": "Montri altnivelajn", - "setting_server_side": "Ĉi tiu agordo estas ligita al via profilo, kaj efektiviĝon en ĉiuj viaj salutoj kaj klientoj", + "setting_server_side": "Ĉi tiu agordo estas ligita al via profilo, kaj efektiviĝos en ĉiuj viaj salutoj kaj klientoj", "post_look_feel": "Aspekto de afiŝoj", "mention_links": "Menciaj ligiloj", "email_language": "Lingvo de leteroj ricevotaj de la servilo", diff --git a/src/i18n/messages.js b/src/i18n/messages.js index 74a89ca8..849d98fd 100644 --- a/src/i18n/messages.js +++ b/src/i18n/messages.js @@ -7,8 +7,11 @@ // sed -i -e "s/'//gm" -e 's/"/\\"/gm' -re 's/^( +)(.+?): ((.+?))?(,?)(\{?)$/\1"\2": "\4"/gm' -e 's/\"\{\"/{/g' -e 's/,"$/",/g' file.json // There's only problem that apostrophe character ' gets replaced by \\ so you have to fix it manually, sorry. +import { isEqual } from 'lodash' import { languages, langCodeToJsonName } from './languages.js' +const ULTIMATE_FALLBACK_LOCALE = 'en' + const hasLanguageFile = (code) => languages.includes(code) const loadLanguageFile = (code) => { @@ -25,11 +28,26 @@ const messages = { en: require('./en.json').default }, setLanguage: async (i18n, language) => { - if (hasLanguageFile(language)) { - const messages = await loadLanguageFile(language) - i18n.setLocaleMessage(language, messages.default) + const languages = (Array.isArray(language) ? language : [language]).filter(k => k) + + if (!languages.includes(ULTIMATE_FALLBACK_LOCALE)) { + languages.push(ULTIMATE_FALLBACK_LOCALE) + } + const [first, ...rest] = languages + + if (first === i18n.locale && isEqual(rest, i18n.fallbackLocale)) { + return } - i18n.locale = language + + for (const lang of languages) { + if (hasLanguageFile(lang)) { + const messages = await loadLanguageFile(lang) + i18n.setLocaleMessage(lang, messages.default) + } + } + + i18n.fallbackLocale = rest + i18n.locale = first } } diff --git a/src/i18n/zh.json b/src/i18n/zh.json index cf5f384c..8f0b04bd 100644 --- a/src/i18n/zh.json +++ b/src/i18n/zh.json @@ -53,7 +53,13 @@ "direct": "私讯", "private": "仅关注者", "unlisted": "列外" - } + }, + "scroll_to_top": "滚动至顶", + "generic_error_message": "发生一个错误:{0}", + "never_show_again": "不再显示", + "undo": "撤销", + "yes": "是", + "no": "否" }, "image_cropper": { "crop_picture": "裁剪图片", @@ -109,7 +115,12 @@ "chats": "聊天", "timelines": "时间线", "bookmarks": "书签", - "home_timeline": "主页时间线" + "home_timeline": "主页时间线", + "lists": "列表", + "edit_finish": "完成编辑", + "mobile_notifications": "打开通知(有未读的)", + "mobile_notifications_close": "关闭通知", + "announcements": "公告" }, "notifications": { "broken_favorite": "未知的状态,正在搜索中…", @@ -890,7 +901,18 @@ "search_emoji": "搜索表情符号", "emoji": "表情符号", "load_all": "加载所有表情符号(共 {emojiAmount} 个)", - "load_all_hint": "最先加载的 {saneAmount} 表情符号,加载全部表情符号可能会带来性能问题。" + "load_all_hint": "最先加载的 {saneAmount} 表情符号,加载全部表情符号可能会带来性能问题。", + "unicode_groups": { + "flags": "旗帜", + "food-and-drink": "饮食", + "objects": "物件", + "people-and-body": "人和身体", + "symbols": "符号", + "travel-and-places": "旅行和地点", + "activities": "活动", + "animals-and-nature": "动物和自然" + }, + "regional_indicator": "地区指示符 {letter}" }, "about": { "mrf": { @@ -958,5 +980,26 @@ "delete": "删除", "message_user": "发消息给 {nickname}", "you": "你:" + }, + "announcements": { + "page_header": "公告", + "title": "公告", + "mark_as_read_action": "标为已读", + "post_form_header": "发布公告", + "post_placeholder": "在这里输入公告内容...", + "post_action": "发布", + "post_error": "错误:{error}", + "close_error": "关闭", + "delete_action": "删除", + "start_time_prompt": "起始时间: ", + "end_time_prompt": "终止时间: ", + "all_day_prompt": "这是全天的事件", + "published_time_display": "发表于 {time}", + "start_time_display": "开始于 {time}", + "end_time_display": "结束于 {time}", + "edit_action": "编辑", + "submit_edit_action": "提交", + "cancel_edit_action": "取消", + "inactive_message": "这个公告不活跃" } } |
