Sha256: 1d155a66eb439319f5681a9492eb498df0dbf83deae5b8fca1e47c1223efb825

Contents?: true

Size: 592 Bytes

Versions: 10

Compression:

Stored size: 592 Bytes

Contents

#coding: utf-8

def _(str)
	kas = _kas
	session = _session
	locale = nil
	
	if Thread.current[:locale].to_s.length > 0
    locale = Thread.current[:locale]
  elsif session and session[:locale].to_s.strip.length > 0
    locale = session[:locale]
  elsif kas and kas.config[:locale_default].to_s.strip.length > 0
    session[:locale] = kas.config[:locale_default] if session
    locale = kas.config[:locale_default]
  elsif !session and !kas
    return str
  else
    raise "No locale set for session and ':locale_default' not set in config."
  end
  
	return kas.gettext.trans(locale, str)
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
knjappserver-0.0.30 lib/include/gettext_funcs.rb
knjappserver-0.0.29 lib/include/gettext_funcs.rb
knjappserver-0.0.28 lib/include/gettext_funcs.rb
knjappserver-0.0.26 lib/include/gettext_funcs.rb
knjappserver-0.0.25 lib/include/gettext_funcs.rb
knjappserver-0.0.24 lib/include/gettext_funcs.rb
knjappserver-0.0.23 lib/include/gettext_funcs.rb
knjappserver-0.0.22 lib/include/gettext_funcs.rb
knjappserver-0.0.21 lib/include/gettext_funcs.rb
knjappserver-0.0.20 lib/include/gettext_funcs.rb