Skip to content

Commit

Permalink
add locale rake task
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonYCHuang committed Feb 21, 2017
1 parent e916729 commit 1fac7bb
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/tasks/locale.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require "react_on_rails/locales_to_js"

namespace :react_on_rails do
desc <<-DESC
Generate i18n javascript files
This task generates javascript locale files: `translations.js` & `default.js` and places them in
the "ReactOnRails.configuration.i18n_dir".
DESC
task locale: :environment do
if ReactOnRails.configuration.i18n_dir.present?
ReactOnRails::LocalesToJs.new
end
end
end

0 comments on commit 1fac7bb

Please sign in to comment.