Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
fj-captcha-vue
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
郑磊
fj-captcha-vue
Commits
da5a81a4
Commit
da5a81a4
authored
Jul 01, 2024
by
郑磊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新语言判断逻辑
parent
535f1b63
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
96 additions
and
95 deletions
+96
-95
fj-captcha-web.js
browser/fj-captcha-web.js
+1
-1
index.js
esm/index.js
+88
-88
index.ts
src/core/locales/index.ts
+7
-6
No files found.
browser/fj-captcha-web.js
View file @
da5a81a4
This diff is collapsed.
Click to expand it.
esm/index.js
View file @
da5a81a4
This diff is collapsed.
Click to expand it.
src/core/locales/index.ts
View file @
da5a81a4
...
...
@@ -54,17 +54,18 @@ export function getLanguage(language?: string): string {
}
//如果是中文那就判断是简体还是繁体
if
(
availableLanguages
.
includes
(
language
))
{
return
language
if
(
language
===
'zh'
||
language
.
startsWith
(
'zh-'
))
{
if
(
availableLanguages
.
includes
(
language
))
{
return
language
}
//中文就默认用简体
return
'zh-cn'
}
//都不是就继续循环
}
//到这里表示既不是英文,也不包含任何中文标识,那么判断标识里有没有中文,有就用简体中文,没有就用英文
if
(
languages
.
some
((
t
)
=>
t
===
'zh'
||
t
.
startsWith
(
'zh-'
)))
{
return
'zh-cn'
}
//到这里表示既不是英文,也不包含任何中文标识,那就用英文
return
'en'
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment