From d8f767445933f41a7629a7637ba962bdbc461c9a Mon Sep 17 00:00:00 2001 From: Ruben Davila Date: Tue, 25 Apr 2017 21:47:49 -0500 Subject: Add ability to parse *.vue files through the `ruby gettext:find` script --- lib/tasks/gettext.rake | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 lib/tasks/gettext.rake (limited to 'lib/tasks') 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 -- cgit v1.2.1