summaryrefslogtreecommitdiff
path: root/lib/tasks/gettext.rake
blob: cc18616d2a785081d2b7230f0699adc80f9c85e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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 = [
      "app",
      "lib",
      "config",
      locale_path
    ].join(",")

    exts = [
      "rb",
      "erb",
      "haml",
      "slim",
      "rhtml",
      "js",
      "jsx",
      "vue",
      "coffee",
      "handlebars",
      "hbs",
      "mustache"
    ].join(",")

    Dir.glob(
      "{#{folders}}/**/*.{#{exts}}"
    )
  end
end