Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
funkwhale
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Giger
funkwhale
Commits
35dda16a
Verified
Commit
35dda16a
authored
6 years ago
by
Eliot Berriot
Browse files
Options
Downloads
Patches
Plain Diff
Compile and bundle translations in CI
parent
fd6ab881
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
.gitignore
+2
-0
2 additions, 0 deletions
.gitignore
.gitlab-ci.yml
+2
-0
2 additions, 0 deletions
.gitlab-ci.yml
front/build/i18n.js
+11
-1
11 additions, 1 deletion
front/build/i18n.js
front/package.json
+2
-1
2 additions, 1 deletion
front/package.json
po/.gitkeep
+0
-0
0 additions, 0 deletions
po/.gitkeep
with
17 additions
and
2 deletions
.gitignore
+
2
−
0
View file @
35dda16a
...
...
@@ -87,3 +87,5 @@ docs/_build
data/
.env
po/*.po
This diff is collapsed.
Click to expand it.
.gitlab-ci.yml
+
2
−
0
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"
...
...
This diff is collapsed.
Click to expand it.
front/build/i18n.js
+
11
−
1
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) => {
}
}
})
This diff is collapsed.
Click to expand it.
front/package.json
+
2
−
1
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"
,
...
...
This diff is collapsed.
Click to expand it.
po/.gitkeep
0 → 100644
+
0
−
0
View file @
35dda16a
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment