Permalink
Browse files

Version 0.0.4.1

  • Loading branch information...
1 parent a7fc83c commit cc31a5b4f2812ca15181e05731cbe6b83178322f @uzytkownik uzytkownik committed Jun 23, 2008
Showing with 11 additions and 2 deletions.
  1. +1 −1 Rakefile
  2. +10 −1 lib/merb_global/merbrake.rb
View
@@ -5,7 +5,7 @@ require 'spec/rake/spectask'
PLUGIN = "merb_global"
NAME = "merb_global"
-GEM_VERSION = "0.0.4"
+GEM_VERSION = "0.0.4.1"
AUTHORS = ["Alex Coles", "Maciej Piechotka"]
EMAIL = "alex@alexcolesportfolio.com"
HOMEPAGE = "http://trac.ikonoklastik.com/merb_global/"
@@ -1,3 +1,5 @@
+require 'fileutils'
+
namespace :merb_global do
task :merb_start do
Merb.start_environment :adapter => 'runner',
@@ -12,7 +14,14 @@
from = Merb::Global.config 'source', 'gettext'
into = Merb::Global.config 'provider', 'gettext'
if from == 'gettext' and into == 'gettext'
- # Change po into mo files
+ Dir[Merb::Global::Providers.localedir + '/*.po'] do |file|
+ lang = File.basename file, '.po'
+ lang_dir = File.join(Merb::Global::Providers.localedir,
+ lang, 'LC_MESSAGES')
+ FileUtils.mkdir_p lang_dir
+ domain = Merb::Global.config([:gettext, :domain], 'merbapp')
+ `msgfmt #{file} -o #{lang_dir}/#{domain}.mo`
+ end
elsif from == into
Merb.logger.error 'Tried transfer from and into the same provider'
else

0 comments on commit cc31a5b

Please sign in to comment.