From d428102a67f7bb4236dcfd06bdf18b7d328159db Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 29 Mar 2023 14:11:18 +0800 Subject: [PATCH] [FEAT](i18n): Add support for Russian language (ru) (#75) --- src/i18n/index.ts | 6 +++++- src/i18n/ru.json | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 src/i18n/ru.json diff --git a/src/i18n/index.ts b/src/i18n/index.ts index 079e05e..5f285db 100644 --- a/src/i18n/index.ts +++ b/src/i18n/index.ts @@ -10,6 +10,7 @@ import pt_br from '../i18n/pt_br.json' assert { type: 'json' }; import vi_VN from '../i18n/vi_VN.json' assert { type: 'json' }; import es_ES from '../i18n/es_ES.json' assert { type: 'json' }; import sv from '../i18n/sv.json' assert { type: 'json' }; +import ru from '../i18n/ru.json' assert { type: 'json' }; export enum I18nLocals { 'en' = 'en', @@ -23,6 +24,7 @@ export enum I18nLocals { 'pt_br' = 'pt_br', 'es_ES' = 'es_ES', 'sv' = 'sv', + 'ru' = 'ru', }; export const i18n = { @@ -37,7 +39,8 @@ export const i18n = { pt_br, vi_VN, es_ES, - sv + sv, + ru, }; export const I18N_CONFIG_ALIAS: { [key: string]: string[] } = { @@ -53,6 +56,7 @@ export const I18N_CONFIG_ALIAS: { [key: string]: string[] } = { en: ['en', 'English', 'english'], es_ES: ['es_ES', 'Spanish', 'español'], sv: ['sv', 'Swedish', 'Svenska'], + ru: ['ru', 'Russian', 'русский'], }; export function getI18nLocal(value: string): string | boolean { diff --git a/src/i18n/ru.json b/src/i18n/ru.json new file mode 100644 index 0000000..d7dce1d --- /dev/null +++ b/src/i18n/ru.json @@ -0,0 +1,6 @@ +{ + "localLanguage": "русский", + "commitFix": "fix(server.ts): изменение регистра переменной порта с нижнего регистра port на верхний регистр PORT", + "commitFeat": "feat(server.ts): добавлена поддержка переменной окружения process.env.PORT", + "commitDescription": "Переменная port теперь называется PORT, что улучшает согласованность с соглашениями об именовании констант. Поддержка переменной окружения позволяет приложению быть более гибким, запускаясь на любом доступном порту, указанном с помощью переменной окружения process.env.PORT." +} \ No newline at end of file