diff --git a/doc/development/i18n_guide.md b/doc/development/i18n_guide.md index 735345bd1266579bf9f665ecf6c13843798e8bcd..bfb0779fbfa0a30213b36c2ec514cae07951bf10 100644 --- a/doc/development/i18n_guide.md +++ b/doc/development/i18n_guide.md @@ -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 diff --git a/lib/tasks/gettext.rake b/lib/tasks/gettext.rake index 0aa21a4bd13ba077244c4917db4f7b80bef238ab..b27f7475115391d66f0ce41e37af65cc79bf0b5a 100644 --- a/lib/tasks/gettext.rake +++ b/lib/tasks/gettext.rake @@ -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