Skip to content
Projects
Groups
Snippets
Help
Sign in / Register
Toggle navigation
Minds Frontend
Project overview
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
400
Merge Requests
56
CI / CD
Security & Compliance
Packages
Wiki
Snippets
Members
Collapse sidebar
Close sidebar
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Frontend
Commits
09e8059c
Commit
09e8059c
authored
23 minutes ago
by
Marcelo Rivera
Browse files
Options
Download
(fix): reverted lint on tasks/extract.i18n.xlf.ts
parent
3f3f6fb9
feat/homepage-redesign
1 merge request
!623
Homepage redesign
Pipeline
#98192390
running with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
20 deletions
+14
-20
tasks/extract.i18n.xlf.ts
View file @
09e8059c
import
{
argv
}
from
'
yargs
'
;
import
{
execSync
,
StdioOptions
}
from
'
child_process
'
;
import
{
execSync
}
from
'
child_process
'
;
import
{
join
}
from
'
path
'
;
import
{
readFileSync
,
statSync
,
unlinkSync
,
writeFileSync
}
from
'
fs
'
;
...
...
@@ -13,10 +13,10 @@ let run = (cmd: string, env: any = {}, outputAsResult: boolean = true) => {
opts
=
{
env
:
{
...
process
.
env
,
...
env
,
...
env
},
maxBuffer
:
1024
*
1024
,
stdio
:
<
StdioOptions
>
(
outputAsResult
?
'
pipe
'
:
'
inherit
'
),
stdio
:
outputAsResult
?
'
pipe
'
:
'
inherit
'
};
if
(
shell
)
{
...
...
@@ -42,22 +42,19 @@ function transform(source, output) {
let
fileContent
=
readFileSync
(
source
).
toString
();
fileContent
=
fileContent
.
replace
(
/
\&
#10;/g
,
'
\n
'
)
.
replace
(
/
\&
#13;/g
,
'
\n
'
)
.
replace
(
/<x
\s
+
(
.*
?)\s
*
\/
>/g
,
'
{{$1}}
'
)
.
replace
(
/
\&
#10;/g
,
"
\n
"
)
.
replace
(
/
\&
#13;/g
,
"
\n
"
)
.
replace
(
/<x
\s
+
(
.*
?)\s
*
\/
>/g
,
"
{{$1}}
"
)
.
replace
(
/{{id="INTERPOLATION" equiv-text="
[^
"
]
+"}}/g
,
'
%1$s
'
)
.
replace
(
/{{id="INTERPOLATION_
([
0-9
]
+
)
" equiv-text="
[^
"
]
+"}}/g
,
(
substring
,
match_1
)
=>
{
const
idx
=
parseInt
(
match_1
)
+
1
;
.
replace
(
/{{id="INTERPOLATION_
([
0-9
]
+
)
" equiv-text="
[^
"
]
+"}}/g
,
(
substring
,
match_1
)
=>
{
const
idx
=
parseInt
(
match_1
)
+
1
;
if
(
idx
<
2
)
{
process
.
exit
(
1
);
}
return
`%
${
idx
}
$s`
;
if
(
idx
<
2
)
{
process
.
exit
(
1
);
}
);
return
`%
${
idx
}
$s`
;
});
writeFileSync
(
output
,
fileContent
);
}
...
...
@@ -66,10 +63,7 @@ function transform(source, output) {
export
=
()
=>
cb
=>
{
run
(
`node_modules/.bin/ng xi18n --i18nFormat xlf`
,
{},
false
);
transform
(
join
(
APP_SRC
,
'
messages.xlf
'
),
join
(
APP_SRC
,
'
locale
'
,
argv
.
output
||
'
Default.xliff
'
)
);
transform
(
join
(
APP_SRC
,
'
messages.xlf
'
),
join
(
APP_SRC
,
'
locale
'
,
argv
.
output
||
'
Default.xliff
'
));
unlinkSync
(
join
(
APP_SRC
,
'
messages.xlf
'
));
cb
();
...
...
This diff is collapsed.
Please
register
or
sign in
to comment