mirror of
https://github.com/Growstuff/growstuff.git
synced 2025-12-24 01:57:46 -05:00
21 lines
531 B
Ruby
21 lines
531 B
Ruby
# frozen_string_literal: true
|
|
|
|
namespace :i18n do
|
|
desc "sort all i18n locale keys"
|
|
task :normalize do
|
|
`i18n-tasks normalize`
|
|
end
|
|
|
|
desc "translate haml strings into i18 en locale using haml-i18n-extractor"
|
|
task :extractor, [:haml_path] do |_t, args|
|
|
require 'haml-i18n-extractor'
|
|
haml_path = args[:haml_path]
|
|
begin
|
|
translate = Haml::I18n::Extractor.new(haml_path)
|
|
translate.run
|
|
rescue Haml::I18n::Extractor::InvalidSyntax
|
|
puts "There was an error with #{haml_path}"
|
|
end
|
|
end
|
|
end
|