Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scratch-www
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
scratch-www
Commits
4f704a3a
Commit
4f704a3a
authored
Jan 14, 2016
by
Matthew Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make error output optional for filestream
parent
ceec694b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
bin/build-locales
bin/build-locales
+7
-3
No files found.
bin/build-locales
View file @
4f704a3a
...
...
@@ -54,6 +54,10 @@ if (!args.length) {
process
.
stdout
.
write
(
'
A destination directory must be specified.
'
);
process
.
exit
(
1
);
}
var
verbose
=
false
;
if
(
args
.
length
>
1
)
{
verbose
=
(
args
[
1
]
===
'
-v
'
)
?
true
:
false
;
}
var
poUiDir
=
path
.
resolve
(
__dirname
,
'
../node_modules/scratchr2_translations/ui
'
);
var
outputDir
=
path
.
resolve
(
__dirname
,
'
../
'
,
args
[
0
]);
...
...
@@ -122,14 +126,14 @@ glob(poUiDir + '/*', function (err, files) {
var
jsTranslations
=
po2icu
.
poFileToICUSync
(
lang
,
jsFile
);
translations
=
localeCompare
.
mergeNewTranslations
(
translations
,
jsTranslations
,
idsWithICU
,
md5WithIds
);
}
catch
(
err
)
{
process
.
stdout
.
write
(
lang
+
'
:
'
+
err
+
'
\n
'
);
if
(
verbose
)
process
.
stdout
.
write
(
lang
+
'
:
'
+
err
+
'
\n
'
);
}
try
{
var
pyTranslations
=
po2icu
.
poFileToICUSync
(
lang
,
pyFile
);
translations
=
localeCompare
.
mergeNewTranslations
(
translations
,
pyTranslations
,
idsWithICU
,
md5WithIds
);
}
catch
(
err
)
{
process
.
stdout
.
write
(
lang
+
'
:
'
+
err
+
'
\n
'
);
if
(
verbose
)
process
.
stdout
.
write
(
lang
+
'
:
'
+
err
+
'
\n
'
);
}
// add new translations to locale object
...
...
@@ -152,6 +156,6 @@ glob(poUiDir + '/*', function (err, files) {
var
viewTranslations
=
merge
(
viewLocales
[
view
],
generalLocales
);
var
objectString
=
JSON
.
stringify
(
viewTranslations
);
var
fileString
=
'
window._messages =
'
+
objectString
+
'
;
'
;
fs
.
writeFileSync
(
outputDir
+
'
/
'
+
view
+
'
.js
'
,
fileString
);
fs
.
writeFileSync
(
outputDir
+
'
/
'
+
view
+
'
.
intl.
js
'
,
fileString
);
}
});
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