Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add ya2yaml support

  • Loading branch information...
commit c07597fd6a9b57757f7e55f818f47a98503eaf9b 1 parent 0e96b0e
Pratik lifo authored
Showing with 12 additions and 1 deletion.
  1. +2 −1  app/models/tolk/locale.rb
  2. +3 −0  config/environment.rb
  3. +7 −0 init.rb
3  app/models/tolk/locale.rb
View
@@ -46,7 +46,8 @@ def secondary_locales
def dump_all(to = self.locales_config_path)
secondary_locales.each do |locale|
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
3  config/environment.rb
View
@@ -11,3 +11,6 @@
:secret => 'f2d72b63242db79df080031c60159a419981cc6c066e961405c1a86c5c38ba56c960d6de171dc4cf985f1544c00466400abf0aac2ce1cbdb726f6127d304fb07'
}
end
+
+$KCODE = 'UTF8'
+require 'ya2yaml'
7 init.rb
View
@@ -4,3 +4,10 @@
$: << File.join(will_paginate, 'lib')
require File.join(will_paginate, 'init')
+
+$KCODE = 'UTF8'
+begin
+ require 'ya2yaml'
+rescue LoadError => e
+ Rails.logger.debug "[Tolk] Could not load ya2yaml"
+end
Please sign in to comment.
Something went wrong with that request. Please try again.