Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
funkwhale
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
EorlBruder
funkwhale
Commits
35dda16a
Verified
Commit
35dda16a
authored
Apr 16, 2018
by
Agate
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compile and bundle translations in CI
parent
fd6ab881
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
2 deletions
+17
-2
.gitignore
.gitignore
+2
-0
.gitlab-ci.yml
.gitlab-ci.yml
+2
-0
front/build/i18n.js
front/build/i18n.js
+11
-1
front/package.json
front/package.json
+2
-1
po/.gitkeep
po/.gitkeep
+0
-0
No files found.
.gitignore
View file @
35dda16a
...
...
@@ -87,3 +87,5 @@ docs/_build
data/
.env
po/*.po
.gitlab-ci.yml
View file @
35dda16a
...
...
@@ -68,6 +68,8 @@ build_front:
script
:
-
yarn install
-
yarn run i18n-extract
-
yarn run i18n-compile
-
yarn run build
cache
:
key
:
"
$CI_PROJECT_ID__front_dependencies"
...
...
front/build/i18n.js
View file @
35dda16a
...
...
@@ -29,6 +29,17 @@ fs.readdir(poDir, (err, files) => {
console
.
log
(
err
)
}
else
{
console
.
log
(
`
Wrote translation file:
${
output
}
`
)
if
(
lang
===
'
en
'
)
{
// for english, we need to specify that json values are equal to the keys.
// otherwise we end up with empty strings on the front end for english
var
contents
=
fs
.
readFileSync
(
output
)
var
jsonContent
=
JSON
.
parse
(
contents
)
var
finalContent
=
{}
Object
.
keys
(
jsonContent
).
forEach
(
function
(
key
)
{
finalContent
[
key
]
=
key
})
fs
.
writeFile
(
output
,
JSON
.
stringify
(
finalContent
))
}
}
})
})
...
...
@@ -36,4 +47,3 @@ fs.readdir(poDir, (err, files) => {
}
}
})
front/package.json
View file @
35dda16a
...
...
@@ -8,7 +8,8 @@
"dev"
:
"node build/dev-server.js"
,
"start"
:
"node build/dev-server.js"
,
"build"
:
"node build/build.js"
,
"i18n-extract"
:
"find src/ -name '*.vue' | xargs vendor/vue-i18n-xgettext/index.js"
,
"i18n-extract"
:
"find src/ -name '*.vue' | xargs vendor/vue-i18n-xgettext/index.js > ../po/en.po"
,
"i18n-compile"
:
"node build/i18n.js"
,
"unit"
:
"cross-env BABEL_ENV=test karma start test/unit/karma.conf.js --single-run"
,
"unit-watch"
:
"cross-env BABEL_ENV=test karma start test/unit/karma.conf.js"
,
"e2e"
:
"node test/e2e/runner.js"
,
...
...
po/.gitkeep
0 → 100644
View file @
35dda16a
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