debian-mirror-gitlab/lib/tasks/gettext.rake

23 lines
677 B
Ruby
Raw Normal View History

2017-08-17 22:00:37 +05:30
require "gettext_i18n_rails/tasks"
namespace :gettext do
# Customize list of translatable files
# See: https://github.com/grosser/gettext_i18n_rails#customizing-list-of-translatable-files
def files_to_translate
folders = %W(app lib config #{locale_path}).join(',')
2017-09-10 17:25:29 +05:30
exts = %w(rb erb haml slim rhtml js jsx vue handlebars hbs mustache).join(',')
2017-08-17 22:00:37 +05:30
Dir.glob(
"{#{folders}}/**/*.{#{exts}}"
)
end
2017-09-10 17:25:29 +05:30
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
2017-08-17 22:00:37 +05:30
end