Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
GGCE
GGCE Web
Commits
c8aafe4f
Commit
c8aafe4f
authored
Feb 24, 2020
by
Viacheslav Pavlov
Browse files
fixed duplicate detector
parent
ae6e41e5
Changes
2
Hide whitespace changes
Inline
Side-by-side
packages/client/package.json
View file @
c8aafe4f
...
...
@@ -6,6 +6,7 @@
"clean"
:
"rimraf lib"
,
"build"
:
"yarn run i18nGenerate && tsc"
,
"i18nGenerate"
:
"gg-i18n --moduleName=client"
,
"i18nFindDuplicate"
:
"gg-i18n-dd"
,
"test"
:
"jest"
},
"dependencies"
:
{
...
...
packages/i18n/src/tools/duplicateDetector.ts
View file @
c8aafe4f
...
...
@@ -5,6 +5,8 @@ const fileStream = require('fs');
const
path
=
require
(
'
path
'
);
const
readlineSync
=
require
(
'
readline-sync
'
);
const
rootDirectory
=
process
.
cwd
();
class
II18n
{
public
filePath
:
string
;
public
key
:
string
;
...
...
@@ -27,7 +29,7 @@ const duplicates = new Map<string, II18n[]>();
async
function
main
()
{
console
.
log
(
'
Running...
'
);
const
dupes
=
fastGlob
([
'
../../**
/locales/en/common.json
'
,
'
../../**
/src/**/translations.json
'
,
'
../../**
/src/translations.json
'
])
const
dupes
=
fastGlob
([
`
${
rootDirectory
}
/locales/en/common.json
`
,
`
${
rootDirectory
}
/src/**/translations.json
`
,
`
${
rootDirectory
}
/src/translations.json
`
])
.
then
((
paths
)
=>
paths
.
filter
((
path
)
=>
!
path
.
includes
(
'
node_modules
'
)).
map
((
path
)
=>
testFile
(
path
)));
console
.
log
(
'
Awawiting results...
'
,
dupes
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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