Skip to content

Commit

Permalink
i18n: moved functions out to module & separate file. added spec.
Browse files Browse the repository at this point in the history
  • Loading branch information
dcunited001 committed Apr 6, 2013
1 parent 8630099 commit 00ed5a5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions lib/skiima/i18n.rb
@@ -0,0 +1,24 @@
# encoding: utf-8

module Skiima
module I18n

def default_locale
::Skiima.locale
end

def msg(*args)
# TODO: change to use config.locale
locale = args.last.is_a?(Symbol) ? args.pop : default_locale
lookup = args.join('.')
Skiima._(lookup)
end

def set_translation_repository
FastGettext.add_text_domain('skiima', :path => File.join(File.dirname(__FILE__), 'skiima', 'locales'), :type => :yaml)
Skiima.text_domain = 'skiima'
Skiima.locale = locale.to_s
end

end
end
Empty file added spec/skiima/i18n_spec.rb
Empty file.

0 comments on commit 00ed5a5

Please sign in to comment.