Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
VG-MOB-Translation-GET
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
Gigarthan Vijayakumaran
VG-MOB-Translation-GET
Commits
578d3d6a
Commit
578d3d6a
authored
May 29, 2020
by
Gigarthan Vijayakumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Translations
parent
dbd27c9f
Pipeline
#7512
failed with stages
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
fillEmptyKeys.js
fillEmptyKeys.js
+1
-1
index.js
index.js
+3
-2
No files found.
fillEmptyKeys.js
View file @
578d3d6a
...
...
@@ -2,7 +2,7 @@ function fillEmptyValuesWithEnglish(data, usData) {
const
translations
=
{};
for
(
const
[
key
,
value
]
of
Object
.
entries
(
data
))
{
if
(
value
[
key
]
)
{
if
(
value
)
{
translations
[
key
]
=
value
;
}
else
{
translations
[
key
]
=
usData
[
key
];
...
...
index.js
View file @
578d3d6a
...
...
@@ -3,10 +3,11 @@ const fs = require("fs");
const
api
=
require
(
"./api"
);
const
fillEmptyKeys
=
require
(
"./fillEmptyKeys"
);
(
async
function
()
{
(
async
function
()
{
try
{
const
token
=
await
api
.
login
();
const
translationsResp
=
await
api
.
getTranslation
(
token
);
console
.
log
(
"translationsResp"
,
translationsResp
);
for
(
const
[
key
,
value
]
of
Object
.
entries
(
translationsResp
))
{
try
{
...
...
@@ -31,7 +32,7 @@ function writeToFile(fileName, data) {
fs
.
writeFile
(
`./translations/
${
fileName
}
.json`
,
JSON
.
stringify
(
data
),
err
=>
{
(
err
)
=>
{
if
(
err
)
{
return
reject
(
err
);
}
...
...
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