Skip to content

Commit

Permalink
Remove Haml::MagicTranslations::Tasks as update_pofiles is no more
Browse files Browse the repository at this point in the history
gettext 3.1 removed the `update_pofiles` method. Their new Rake task definition
API is simple enough so we can simply tell users to add the custom parser
manually in their Rakefile.
  • Loading branch information
Lunar committed May 6, 2014
1 parent ce74151 commit a766f59
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 195 deletions.
16 changes: 9 additions & 7 deletions README.rdoc
Expand Up @@ -85,16 +85,18 @@ In order to extract translatable strings and merge with existing translation,
this gem provides an Haml parser for GetText::Tools::XGetText. This requires
gettext >= 2.3 to be available.

You can either use it directly or through the provided Rake task. Here's an
example on how to use the later:
With gettext >= 3, Rake tasks can be defined as follow:

Haml::MagicTranslations::Tasks::UpdatePoFiles.new do |t|
t.text_domain = 'my_project'
t.files = Dir.glob("views/**/*.{rb,haml}") << "lib/my_project.rb"
t.app_version = 'my_project 0.1'
require 'gettext/tools/task'
require 'haml/magic_translations/xgettext/haml_parser'

GetText::Tools::XGetText.add_parser(Haml::MagicTranslations::XGetText::HamlParser)
GetText::Tools::Task.define do |task|
task.spec = Gem::Specification.load('coquelicot.gemspec')
task.files = Dir.glob('views/**/*.{rb,haml}') << 'lib/my_project.rb'
end

This will add a +update_pofiles+ task that will update PO files that can be
This will add a +gettext:po:update+ task that will update PO files that can be
found in the +po+ directory.

=== Copyrights
Expand Down
83 changes: 0 additions & 83 deletions lib/haml/magic_translations/tasks.rb

This file was deleted.

105 changes: 0 additions & 105 deletions spec/haml/magic_translations/tasks_spec.rb

This file was deleted.

0 comments on commit a766f59

Please sign in to comment.