summaryrefslogtreecommitdiff
path: root/lib/tasks
diff options
context:
space:
mode:
authorRuben Davila <rdavila84@gmail.com>2017-04-25 21:47:49 -0500
committerRuben Davila <rdavila84@gmail.com>2017-04-25 21:47:49 -0500
commitd8f767445933f41a7629a7637ba962bdbc461c9a (patch)
tree8561f4302ee533b1d8134a1aa2b7ea698029bc66 /lib/tasks
parent422c48baa7eeaca025a423c4eb48256c786514ed (diff)
downloadgitlab-ce-d8f767445933f41a7629a7637ba962bdbc461c9a.tar.gz
Add ability to parse *.vue files through the `ruby gettext:find` script
Diffstat (limited to 'lib/tasks')
-rw-r--r--lib/tasks/gettext.rake33
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/tasks/gettext.rake b/lib/tasks/gettext.rake
new file mode 100644
index 00000000000..cc18616d2a7
--- /dev/null
+++ b/lib/tasks/gettext.rake
@@ -0,0 +1,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