Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-app-operator-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
lanbaoming
jiedao-app-operator-master
Commits
df1fc6b9
Commit
df1fc6b9
authored
Dec 28, 2022
by
dragondean@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善collectIon8nMesages.js
parent
767a9c65
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2161 additions
and
4 deletions
+2161
-4
collectI18nMessages.js
collectI18nMessages.js
+9
-3
en_US.json
src/i18n/languages/en_US.json
+2152
-1
No files found.
collectI18nMessages.js
View file @
df1fc6b9
const
fs
=
require
(
'
fs
'
);
const
root
=
"
./src
"
const
savePath
=
"
./
i18n-messages.txt
"
const
savePath
=
"
./
src/i18n/languages/en_US.json
"
let
allFiles
=
[]
function
getFiles
(
dir
){
...
...
@@ -29,6 +29,12 @@ allFiles.forEach(file => {
messages
.
add
(
item
[
1
])
}
})
fs
.
writeFileSync
(
"
./i18n-messages.txt
"
,
Array
.
from
(
messages
).
join
(
"
\n
"
))
let
obj
=
require
(
savePath
)
Array
.
from
(
messages
).
forEach
(
word
=>
{
if
(
!
obj
[
word
])
obj
[
word
]
=
""
})
fs
.
writeFileSync
(
savePath
,
JSON
.
stringify
(
obj
,
null
,
4
))
console
.
log
(
messages
)
console
.
warn
(
`共提取
${
messages
.
size
}
个待翻译内容,保存于
${
savePath
}
`
)
\ No newline at end of file
console
.
warn
(
`本次共提取
${
messages
.
size
}
个待翻译内容,保存于
${
savePath
}
`
)
\ No newline at end of file
src/i18n/languages/en_US.json
View file @
df1fc6b9
This diff is collapsed.
Click to expand it.
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