Skip to content

Commit

Permalink
Add ya2yaml support
Browse files Browse the repository at this point in the history
  • Loading branch information
lifo committed Apr 11, 2010
1 parent 0e96b0e commit c07597f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/models/tolk/locale.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def secondary_locales
def dump_all(to = self.locales_config_path) def dump_all(to = self.locales_config_path)
secondary_locales.each do |locale| secondary_locales.each do |locale|
File.open("#{to}/#{locale.name}.yml", "w+") do |file| File.open("#{to}/#{locale.name}.yml", "w+") do |file|
YAML.dump(locale.to_hash, file) data = locale.to_hash
data.respond_to?(:ya2yaml) ? file.write data.ya2yaml(:syck_compatible => true) : YAML.dump(locale.to_hash, file)
end end
end end
end end
Expand Down
3 changes: 3 additions & 0 deletions config/environment.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@
:secret => 'f2d72b63242db79df080031c60159a419981cc6c066e961405c1a86c5c38ba56c960d6de171dc4cf985f1544c00466400abf0aac2ce1cbdb726f6127d304fb07' :secret => 'f2d72b63242db79df080031c60159a419981cc6c066e961405c1a86c5c38ba56c960d6de171dc4cf985f1544c00466400abf0aac2ce1cbdb726f6127d304fb07'
} }
end end

$KCODE = 'UTF8'
require 'ya2yaml'
7 changes: 7 additions & 0 deletions init.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,3 +4,10 @@
$: << File.join(will_paginate, 'lib') $: << File.join(will_paginate, 'lib')


require File.join(will_paginate, 'init') require File.join(will_paginate, 'init')

$KCODE = 'UTF8'
begin
require 'ya2yaml'
rescue LoadError => e
Rails.logger.debug "[Tolk] Could not load ya2yaml"
end

0 comments on commit c07597f

Please sign in to comment.