Skip to content

Added Russian localization and README-ru.md #2068

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: i18n
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
321 changes: 321 additions & 0 deletions README-ru.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion server/middleware/language.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func LanguageHandler() gin.HandlerFunc {

// fmt.Printf("Accept-Language value is: %s\r\n", lang)
var oldLang = global.GVA_CONFIG.Language.Language
if lang != "" && (lang == "en" || lang == "zh" || lang == "ar") { // currently we support en, zh, ar languages only
if lang != "" && (lang == "en" || lang == "zh" || lang == "ar" || lang == "ru") { // currently we support en, zh, ar, ru languages only
global.GVA_CONFIG.Language.Language = lang
} else {
global.GVA_CONFIG.Language.Language = "en"
Expand Down
534 changes: 534 additions & 0 deletions server/resource/lang/ru.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions server/utils/translate/translator.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type Translator struct {
// t.bundle.MustLoadMessageFile("./lang/en.json")
// t.bundle.MustLoadMessageFile("./lang/zh.json")
// t.bundle.MustLoadMessageFile("./lang/ar.json")
// t.bundle.MustLoadMessageFile("./lang/ru.json")
// t.localizer = i18n.NewLocalizer(t.bundle, initLang) // should add additionl check here
// t.IsInit = true
// // end of adding
Expand Down
4 changes: 3 additions & 1 deletion web/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import zh from 'element-plus/dist/locale/zh-cn.mjs'
import en from 'element-plus/dist/locale/en.mjs'
import ar from 'element-plus/dist/locale/ar.mjs'
import ru from 'element-plus/dist/locale/ru.mjs'
import zh_tw from 'element-plus/dist/locale/zh-tw.mjs'
import { useAppStore } from '@/pinia'
import { useI18n } from 'vue-i18n'
Expand All @@ -26,7 +27,8 @@
'zh-cn': zh,
'zh-TW': zh_tw,
en: en,
ar: ar
ar: ar,
ru: ru
}

const { locale } = useI18n()
Expand Down
1 change: 1 addition & 0 deletions web/src/assets/flags/ru.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 9 additions & 2 deletions web/src/components/i18n/selectLanguage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,18 @@
/>繁體中文
</el-dropdown-item>
<el-dropdown-item :disabled="$i18n.locale === 'ar'" command="ar"
><img
><img
alt="العربية"
class="w-8 mr-1"
src="@/assets/flags/ar.svg"
/>العربية
/>العربية
</el-dropdown-item>
<el-dropdown-item :disabled="$i18n.locale === 'ru'" command="ru"
><img
alt="Русский"
class="w-8 mr-1"
src="@/assets/flags/ru.svg"
/>العربية
</el-dropdown-item>
</el-dropdown-menu>
</template>
Expand Down
4 changes: 4 additions & 0 deletions web/src/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import enLocale from './locales/en.json'
import zhLocale from './locales/zh.json'
import zhtwLocale from './locales/zh-TW.json'
import arLocale from './locales/ar.json'
import ruLocale from './locales/ru.json'
import Cookies from 'js-cookie'

const messages = {
Expand All @@ -17,6 +18,9 @@ const messages = {
},
ar: {
...arLocale
},
ru: {
...ruLocale
}
}

Expand Down
1,125 changes: 1,125 additions & 0 deletions web/src/locales/ru.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion web/src/view/systemTools/formCreate/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import zh from './locale/zh_cn.js' // 导入中文语言包
import zh_tw from './locale/zh_tw.js' // 导入中文语言包
import ar from './locale/ar.js'
import ru from './locale/ru.js'
import { useI18n } from 'vue-i18n' // 导入中文语言包

const { locale } = useI18n()
Expand All @@ -30,7 +31,8 @@
'zh-cn': zh,
'zh-TW': zh_tw,
en: en,
ar: ar
ar: ar,
ru: ru
}

const designer = ref(null)
Expand Down
Loading