Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wzj-java
uni-app
提交
df3f7dc1
U
uni-app
项目概览
wzj-java
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
df3f7dc1
编写于
8月 26, 2021
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: Language -> Locale
上级
5260b0bf
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
16 addition
and
24 deletion
+16
-24
lib/apis.js
lib/apis.js
+2
-2
packages/webpack-uni-pages-loader/lib/platforms/app-plus/index.js
.../webpack-uni-pages-loader/lib/platforms/app-plus/index.js
+1
-1
packages/webpack-uni-pages-loader/lib/platforms/h5.js
packages/webpack-uni-pages-loader/lib/platforms/h5.js
+3
-3
src/core/helpers/i18n/index.js
src/core/helpers/i18n/index.js
+5
-5
src/core/helpers/promise.js
src/core/helpers/promise.js
+1
-1
src/core/service/api/ui/language.js
src/core/service/api/ui/language.js
+0
-12
src/core/service/api/ui/locale.js
src/core/service/api/ui/locale.js
+4
-0
未找到文件。
lib/apis.js
浏览文件 @
df3f7dc1
...
...
@@ -183,8 +183,8 @@ const ui = [
'
setTopWindowStyle
'
,
'
setLeftWindowStyle
'
,
'
setRightWindowStyle
'
,
'
getL
anguag
e
'
,
'
setL
anguag
e
'
'
getL
ocal
e
'
,
'
setL
ocal
e
'
]
const
event
=
[
...
...
packages/webpack-uni-pages-loader/lib/platforms/app-plus/index.js
浏览文件 @
df3f7dc1
...
...
@@ -128,7 +128,7 @@ module.exports = function (pagesJson, userManifestJson, isAppView) {
name
:
userManifestJson
.
versionName
,
code
:
userManifestJson
.
versionCode
},
language
:
userManifestJson
.
l
anguag
e
language
:
userManifestJson
.
l
ocal
e
},
{
plus
:
userManifestJson
[
'
app-plus
'
]
}
...
...
packages/webpack-uni-pages-loader/lib/platforms/h5.js
浏览文件 @
df3f7dc1
...
...
@@ -438,8 +438,8 @@ module.exports = function (pagesJson, manifestJson, loader) {
qqMapKey
=
sdkConfigs
.
maps
.
qqmap
.
key
}
let
l
anguage
=
manifestJson
.
languag
e
l
anguage
=
language
&&
language
.
toUpperCase
()
!==
'
AUTO
'
?
languag
e
:
''
let
l
ocale
=
manifestJson
.
local
e
l
ocale
=
locale
&&
locale
.
toUpperCase
()
!==
'
AUTO
'
?
local
e
:
''
return
`
import Vue from 'vue'
...
...
@@ -455,7 +455,7 @@ global.__uniConfig.debug = ${manifestJson.debug === true};
global.__uniConfig.networkTimeout =
${
JSON
.
stringify
(
networkTimeoutConfig
)}
;
global.__uniConfig.sdkConfigs =
${
JSON
.
stringify
(
sdkConfigs
)}
;
global.__uniConfig.qqMapKey =
${
JSON
.
stringify
(
qqMapKey
)}
;
global.__uniConfig.l
anguage =
${
JSON
.
stringify
(
languag
e
)}
;
global.__uniConfig.l
ocale =
${
JSON
.
stringify
(
local
e
)}
;
global.__uniConfig.nvue =
${
JSON
.
stringify
({
'
flex-direction
'
:
getFlexDirection
(
manifestJson
[
'
app-plus
'
])
})}
global.__uniConfig.__webpack_chunk_load__ = __webpack_chunk_load__
${
genRegisterPageVueComponentsCode
(
pageComponents
)}
...
...
src/core/helpers/i18n/index.js
浏览文件 @
df3f7dc1
...
...
@@ -16,19 +16,19 @@ const messages = {
'
zh-Hant
'
:
zhHant
}
let
l
anguag
e
let
l
ocal
e
if
(
__PLATFORM__
===
'
h5
'
)
{
l
anguage
=
(
__uniConfig
.
languag
e
||
navigator
.
language
)
l
ocale
=
(
__uniConfig
.
local
e
||
navigator
.
language
)
}
else
if
(
__PLATFORM__
===
'
app-plus
'
)
{
if
(
typeof
weex
===
'
object
'
)
{
l
anguag
e
=
weex
.
requireModule
(
'
plus
'
).
getLanguage
()
l
ocal
e
=
weex
.
requireModule
(
'
plus
'
).
getLanguage
()
}
}
else
{
l
anguag
e
=
uni
.
getSystemInfoSync
().
language
l
ocal
e
=
uni
.
getSystemInfoSync
().
language
}
export
const
i18n
=
initVueI18n
(
l
anguag
e
,
__PLATFORM__
===
'
app-plus
'
||
__PLATFORM__
===
'
h5
'
?
messages
:
{})
export
const
i18n
=
initVueI18n
(
l
ocal
e
,
__PLATFORM__
===
'
app-plus
'
||
__PLATFORM__
===
'
h5
'
?
messages
:
{})
export
const
t
=
i18n
.
t
export
const
i18nMixin
=
i18n
.
mixin
=
{
beforeCreate
()
{
...
...
src/core/helpers/promise.js
浏览文件 @
df3f7dc1
...
...
@@ -8,7 +8,7 @@ import {
}
from
'
./interceptor
'
const
SYNC_API_RE
=
/^
\$
|Window$|WindowStyle$|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getL
anguage|setLanguag
e/
/^
\$
|Window$|WindowStyle$|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getL
ocale|setLocal
e/
const
CONTEXT_API_RE
=
/^create|Manager$/
...
...
src/core/service/api/ui/language.js
已删除
100644 → 0
浏览文件 @
5260b0bf
import
{
getLocale
,
setLocale
}
from
'
uni-core/helpers/i18n
'
export
function
getLanguage
()
{
return
getLocale
()
}
export
function
setLanguage
(
locale
)
{
return
setLocale
(
locale
)
}
src/core/service/api/ui/locale.js
0 → 100644
浏览文件 @
df3f7dc1
export
{
getLocale
,
setLocale
}
from
'
uni-core/helpers/i18n
'
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录