Skip to content

Commit

Permalink
feat(i18n): add Russian language support (#402)
Browse files Browse the repository at this point in the history
* feat(i18n): add Russian language support

Added Russian translations to the application, including localization for app content, common phrases, external resources, language settings, and shortcuts.

* fix: import format

* feat: support lang/*.json

* fix: Lowercase to uppercase

* update

Signed-off-by: Innei <[email protected]>

---------

Signed-off-by: Innei <[email protected]>
Co-authored-by: Innei <[email protected]>
  • Loading branch information
upupnoah and Innei authored Sep 20, 2024
1 parent 972ff76 commit 0745ac0
Show file tree
Hide file tree
Showing 21 changed files with 532 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"severity": "off"
}
],
"cSpell.words": ["rsshub"],
"cSpell.words": ["rsshub", "Русский"],
"editor.foldingImportsByDefault": true,
"commentTranslate.hover.enabled": false,
"typescript.tsdk": "node_modules/typescript/lib",
Expand Down
17 changes: 16 additions & 1 deletion apps/renderer/src/@types/constants.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
const langs = ["ja", "zh-CN", "zh-TW", "pt", "fr", "ar-DZ", "ar-SA", "ar-MA", "zh-HK"]
const langs = [
"ja",
"zh-CN",
"zh-TW",
"pt",
"fr",
"ar-DZ",
"ar-SA",
"ar-MA",
"zh-HK",
"fi",
"it",
"ru",
"es",
]
export const currentSupportedLanguages = ["en", ...langs.sort()]
export const dayjsLocaleImportMap = {
en: ["en", () => import("dayjs/locale/en")],
["zh-CN"]: ["zh-cn", () => import("dayjs/locale/zh-cn")],
["ja"]: ["ja", () => import("dayjs/locale/ja")],
["ru"]: ["ru", () => import("dayjs/locale/ru")],
["fi"]: ["fi", () => import("dayjs/locale/fi")],
["it"]: ["it", () => import("dayjs/locale/it")],
["ar-DZ"]: ["ar-dz", () => import("dayjs/locale/ar-dz")],
Expand Down
3 changes: 3 additions & 0 deletions apps/renderer/src/@types/default-resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import common_fr from "../../../../locales/common/fr.json"
import common_it from "../../../../locales/common/it.json"
import common_ja from "../../../../locales/common/ja.json"
import common_pt from "../../../../locales/common/pt.json"
import common_ru from "../../../../locales/common/ru.json"
import common_zhCN from "../../../../locales/common/zh-CN.json"
import common_zhTW from "../../../../locales/common/zh-TW.json"
import errors_en from "../../../../locales/errors/en.json"
Expand All @@ -23,6 +24,7 @@ import lang_fr from "../../../../locales/lang/fr.json"
import lang_it from "../../../../locales/lang/it.json"
import lang_ja from "../../../../locales/lang/ja.json"
import lang_pt from "../../../../locales/lang/pt.json"
import lang_ru from "../../../../locales/lang/ru.json"
import lang_zhCN from "../../../../locales/lang/zh-CN.json"
import lang_zhTW from "../../../../locales/lang/zh-TW.json"
import settings_en from "../../../../locales/settings/en.json"
Expand Down Expand Up @@ -52,6 +54,7 @@ export const defaultResources = {
lang: lang_ja,
common: common_ja,
},
ru: { lang: lang_ru, common: common_ru },
fi: { lang: lang_fi, common: common_fi },
it: { lang: lang_it, common: common_it },
"ar-DZ": { lang: lang_ardz, common: common_ardz },
Expand Down
207 changes: 207 additions & 0 deletions locales/app/ru.json

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions locales/common/ru.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"app.copied_to_clipboard": "Скопировано в буфер обмена",
"cancel": "Отменить",
"confirm": "Подтвердить",
"ok": "ОК",
"quantifier.piece": "",
"time.last_night": "Прошлой ночью",
"time.the_night_before_last": "Позапрошлой ночью",
"time.today": "Сегодня",
"time.yesterday": "Вчера",
"tips.load-lng-error": "Не удалось загрузить языковой пакет",
"words.back": "Назад",
"words.copy": "Копировать",
"words.edit": "Редактировать",
"words.entry": "Запись",
"words.id": "ID",
"words.items_one": "Элемент",
"words.items_other": "Элементы",
"words.local": "локальный",
"words.record": "запись",
"words.record_one": "запись",
"words.record_other": "записи",
"words.result": "результат",
"words.result_one": "результат",
"words.result_other": "результаты",
"words.space": " ",
"words.which.all": "Все"
}
42 changes: 42 additions & 0 deletions locales/external/ru.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"feed": {
"follow_one": "подписка",
"follow_other": "подписки",
"followsAndReads": "{{subscriptionCount}} {{subscriptionNoun}} с {{readCount}} {{readNoun}} на {{appName}}",
"read_one": "чтение",
"read_other": "чтений"
},
"header": {
"app": "Приложение",
"download": "Скачать"
},
"invitation": {
"activate": "Активировать",
"codeOptions": {
"1": "Ищите пользователей для приглашения на альфа-тестирование.",
"2": "Присоединяйтесь к нашему серверу Discord для участия в раздачах.",
"3": "Подпишитесь на наш аккаунт X для участия в раздачах."
},
"earlyAccess": "В настоящее время Follow находится в раннем доступе и требует пригласительного кода для использования.",
"earlyAccessMessage": "😰 Извините, Follow находится в раннем доступе и требует пригласительного кода для использования.",
"generateButton": "Сгенерировать новый код",
"generateCost": "Вы можете потратить {{INVITATION_PRICE}} Power, чтобы сгенерировать пригласительный код для ваших друзей.",
"getCodeMessage": "Вы можете получить пригласительный код следующими способами:",
"title": "Пригласительный код"
},
"login": {
"backToWebApp": "Вернуться к веб-приложению",
"continueWithGitHub": "Продолжить через GitHub",
"continueWithGoogle": "Продолжить через Google",
"logInTo": "Войти в ",
"openApp": "Открыть приложение",
"redirecting": "Перенаправление",
"welcomeTo": "Добро пожаловать в "
},
"redirect": {
"continueInBrowser": "Продолжить в браузере",
"instruction": "Сейчас самое время открыть {{APP_NAME}} и безопасно закрыть эту страницу.",
"openApp": "Открыть {{APP_NAME}}",
"successMessage": "Вы успешно подключились к аккаунту {{APP_NAME}}."
}
}
2 changes: 2 additions & 0 deletions locales/lang/ar-DZ.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
"langs.en": "English",
"langs.es": "Español",
"langs.fr": "Français",
"langs.it": "Italiano",
"langs.ja": "日本語",
"langs.pt": "Português",
"langs.ru": "Русский",
"langs.zh-CN": "简体中文",
"langs.zh-HK": "繁體中文(香港)",
"langs.zh-TW": "繁體中文(台灣)",
Expand Down
2 changes: 2 additions & 0 deletions locales/lang/ar-SA.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
"langs.en": "English",
"langs.es": "Español",
"langs.fr": "Français",
"langs.it": "Italiano",
"langs.ja": "日本語",
"langs.pt": "Português",
"langs.ru": "Русский",
"langs.zh-CN": "简体中文",
"langs.zh-HK": "繁體中文(香港)",
"langs.zh-TW": "繁體中文(台灣)",
Expand Down
14 changes: 0 additions & 14 deletions locales/lang/ar-sa.json

This file was deleted.

1 change: 1 addition & 0 deletions locales/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"langs.it": "Italiano",
"langs.ja": "日本語",
"langs.pt": "Português",
"langs.ru": "Русский",
"langs.zh-CN": "简体中文",
"langs.zh-HK": "繁體中文(香港)",
"langs.zh-TW": "繁體中文(台灣)",
Expand Down
1 change: 1 addition & 0 deletions locales/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"langs.it": "Italiano",
"langs.ja": "日本語",
"langs.pt": "Português",
"langs.ru": "Русский",
"langs.zh-CN": "简体中文",
"langs.zh-HK": "繁體中文(香港)",
"langs.zh-TW": "繁體中文(台灣)",
Expand Down
1 change: 1 addition & 0 deletions locales/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"langs.it": "Italiano",
"langs.ja": "日本語",
"langs.pt": "Português",
"langs.ru": "Русский",
"langs.zh-CN": "简体中文",
"langs.zh-HK": "繁體中文(香港)",
"langs.zh-TW": "繁體中文(台灣)",
Expand Down
1 change: 1 addition & 0 deletions locales/lang/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"langs.it": "Italiano",
"langs.ja": "日本語",
"langs.pt": "Português",
"langs.ru": "Русский",
"langs.zh-CN": "简体中文",
"langs.zh-HK": "繁體中文(香港)",
"langs.zh-TW": "繁體中文(台灣)",
Expand Down
1 change: 1 addition & 0 deletions locales/lang/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"langs.it": "Italiano",
"langs.ja": "日本語",
"langs.pt": "Português",
"langs.ru": "Русский",
"langs.zh-CN": "简体中文",
"langs.zh-HK": "繁體中文(香港)",
"langs.zh-TW": "繁體中文(台灣)",
Expand Down
1 change: 1 addition & 0 deletions locales/lang/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"langs.it": "Italiano",
"langs.ja": "日本語",
"langs.pt": "Português",
"langs.ru": "Русский",
"langs.zh-CN": "简体中文",
"langs.zh-HK": "繁體中文(香港)",
"langs.zh-TW": "繁體中文(台灣)",
Expand Down
4 changes: 3 additions & 1 deletion locales/lang/ar-dz.json → locales/lang/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
"langs.en": "English",
"langs.es": "Español",
"langs.fr": "Français",
"langs.it": "Italiano",
"langs.ja": "日本語",
"langs.pt": "Português",
"langs.ru": "Русский",
"langs.zh-CN": "简体中文",
"langs.zh-HK": "繁體中文(香港)",
"langs.zh-TW": "繁體中文(台灣)",
"name": "العربية (الجزائر)"
"name": "Русский"
}
1 change: 1 addition & 0 deletions locales/lang/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"langs.it": "Italiano",
"langs.ja": "日本語",
"langs.pt": "Português",
"langs.ru": "Русский",
"langs.zh-CN": "简体中文",
"langs.zh-HK": "繁體中文(香港)",
"langs.zh-TW": "繁體中文(台灣)",
Expand Down
1 change: 1 addition & 0 deletions locales/lang/zh-HK.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"langs.it": "Italiano",
"langs.ja": "日本語",
"langs.pt": "Português",
"langs.ru": "Русский",
"langs.zh-CN": "简体中文",
"langs.zh-HK": "繁體中文(香港)",
"langs.zh-TW": "繁體中文(台灣)",
Expand Down
1 change: 1 addition & 0 deletions locales/lang/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"langs.it": "Italiano",
"langs.ja": "日本語",
"langs.pt": "Português",
"langs.ru": "Русский",
"langs.zh-CN": "简体中文",
"langs.zh-HK": "繁體中文(香港)",
"langs.zh-TW": "繁體中文(台灣)",
Expand Down
Loading

0 comments on commit 0745ac0

Please sign in to comment.