Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-mall
Project
Project
Details
Activity
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
shenshaokai
jinfa-mall
Commits
938707e9
Commit
938707e9
authored
Mar 04, 2022
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: 补充缺失文件
parent
a07b106a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
genarateLocales.js
scripts/genarateLocales.js
+37
-0
No files found.
scripts/genarateLocales.js
0 → 100644
View file @
938707e9
const
path
=
require
(
'path'
)
const
fs
=
require
(
'fs'
)
const
translateContainer
=
require
(
'../locales'
)
const
app
=
process
.
env
.
app
if
(
!
app
)
{
throw
`国际化文件找不到 app ->
${
app
}
`
}
const
workPath
=
path
.
resolve
(
__dirname
,
`../apps/
${
app
}
`
,
'locales.json'
)
const
commonTranslateContainer
=
translateContainer
.
common
const
appTranslateContainer
=
translateContainer
[
app
]
const
translateContent
=
{
"zh-CN"
:
{
...
commonTranslateContainer
[
'zh-CN'
],
...
appTranslateContainer
[
'zh-CN'
]
},
"en-US"
:
{
...
commonTranslateContainer
[
"en-US"
],
...
appTranslateContainer
[
"en-US"
]
},
"ko-KR"
:
{
...
commonTranslateContainer
[
"ko-KR"
],
...
appTranslateContainer
[
"ko-KR"
]
},
}
fs
.
writeFile
(
workPath
,
JSON
.
stringify
(
translateContent
),
function
(
err
)
{
if
(
err
)
{
throw
err
}
console
.
log
(
`
${
app
}
国际化文件写入成功`
)
})
\ No newline at end of file
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