mirror of
https://gitee.com/viarotel-org/escrcpy.git
synced 2024-12-02 03:07:35 +08:00
fix: 🐛 Automatically apply local languages
This commit is contained in:
parent
891fe72588
commit
0cc8208dd1
@ -13,5 +13,3 @@ process.env.IS_PACKAGED = JSON.stringify(app.isPackaged)
|
||||
process.env.DESKTOP_PATH = app.getPath('desktop')
|
||||
|
||||
process.env.CWD = process.cwd()
|
||||
|
||||
process.env.LOCALE = process.env.LANG?.split('.')?.[0] || 'zh_CN'
|
||||
|
@ -1,14 +1,13 @@
|
||||
import { createI18n } from 'vue-i18n'
|
||||
import messages from '@intlify/unplugin-vue-i18n/messages'
|
||||
|
||||
const locale
|
||||
= window.appStore?.get('common.language')
|
||||
|| window.electron?.process?.env?.LOCALE
|
||||
export const locale
|
||||
= window.appStore?.get('common.language') || window.navigator.language
|
||||
|
||||
export const i18n = createI18n({
|
||||
allowComposition: false,
|
||||
locale,
|
||||
fallbackLocale: 'en_US',
|
||||
fallbackLocale: 'en-US',
|
||||
messages,
|
||||
fallbackWarn: false,
|
||||
missingWarn: false,
|
||||
|
@ -13,9 +13,9 @@
|
||||
|
||||
"common.language.name": "Language",
|
||||
"common.language.placeholder": "Select language",
|
||||
"common.language.zh_CN": "中文",
|
||||
"common.language.zh_TW": "繁體中文",
|
||||
"common.language.en_US": "English",
|
||||
"common.language.zh-CN": "中文",
|
||||
"common.language.zh-TW": "繁體中文",
|
||||
"common.language.en-US": "English",
|
||||
|
||||
"close.quit": "Quit",
|
||||
"close.quit.cancel": "Cancel quit",
|
@ -13,9 +13,9 @@
|
||||
|
||||
"common.language.name": "语言",
|
||||
"common.language.placeholder": "选择你需要的语言",
|
||||
"common.language.zh_CN": "中文",
|
||||
"common.language.zh_TW": "繁體中文",
|
||||
"common.language.en_US": "English",
|
||||
"common.language.zh-CN": "中文",
|
||||
"common.language.zh-TW": "繁體中文",
|
||||
"common.language.en-US": "English",
|
||||
|
||||
"close.quit": "退出",
|
||||
"close.quit.cancel": "取消退出",
|
@ -13,9 +13,9 @@
|
||||
|
||||
"common.language.name": "語言",
|
||||
"common.language.placeholder": "選擇你要的語言",
|
||||
"common.language.zh_CN": "中文",
|
||||
"common.language.zh_TW": "繁體中文",
|
||||
"common.language.en_US": "English",
|
||||
"common.language.zh-CN": "中文",
|
||||
"common.language.zh-TW": "繁體中文",
|
||||
"common.language.en-US": "English",
|
||||
|
||||
"close.quit": "結束",
|
||||
"close.quit.cancel": "取消結束",
|
@ -1,8 +1,8 @@
|
||||
import { locale } from '$/locales/index.js'
|
||||
|
||||
const { adbPath, scrcpyPath, gnirehtetPath, desktopPath }
|
||||
= window?.electron?.configs || {}
|
||||
|
||||
const defaultLanguage = window.electron?.process?.env?.LOCALE
|
||||
|
||||
export default {
|
||||
label: 'preferences.common.name',
|
||||
field: 'common',
|
||||
@ -33,20 +33,20 @@ export default {
|
||||
label: 'common.language.name',
|
||||
field: 'language',
|
||||
type: 'LanguageSelect',
|
||||
value: defaultLanguage,
|
||||
value: locale,
|
||||
placeholder: 'common.language.placeholder',
|
||||
options: [
|
||||
{
|
||||
label: 'common.language.zh_CN',
|
||||
value: 'zh_CN',
|
||||
label: 'common.language.zh-CN',
|
||||
value: 'zh-CN',
|
||||
},
|
||||
{
|
||||
label: 'common.language.zh_TW',
|
||||
value: 'zh_TW',
|
||||
label: 'common.language.zh-TW',
|
||||
value: 'zh-TW',
|
||||
},
|
||||
{
|
||||
label: 'common.language.en_US',
|
||||
value: 'en_US',
|
||||
label: 'common.language.en-US',
|
||||
value: 'en-US',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user