Merge branch 'add-new-rake-task-for-gettext' into 'master'
Add new Rake task to simplify the compilation of PO files See merge request !11864
This commit is contained in:
commit
5cb8ad6c57
2 changed files with 9 additions and 2 deletions
|
@ -233,8 +233,7 @@ Let's suppose you want to add translations for a new language, let's say French.
|
|||
containing the translations:
|
||||
|
||||
```sh
|
||||
bundle exec rake gettext:pack
|
||||
bundle exec rake gettext:po_to_json
|
||||
bundle exec rake gettext:compile
|
||||
```
|
||||
|
||||
1. In order to see the translated content we need to change our preferred language
|
||||
|
|
|
@ -11,4 +11,12 @@ namespace :gettext do
|
|||
"{#{folders}}/**/*.{#{exts}}"
|
||||
)
|
||||
end
|
||||
|
||||
task :compile do
|
||||
# See: https://gitlab.com/gitlab-org/gitlab-ce/issues/33014#note_31218998
|
||||
FileUtils.touch(File.join(Rails.root, 'locale/gitlab.pot'))
|
||||
|
||||
Rake::Task['gettext:pack'].invoke
|
||||
Rake::Task['gettext:po_to_json'].invoke
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue