lib/utopia/localization.rb
# A wrapper to provide easy access to locale related data in the request.
A wrapper to provide easy access to locale related data in the request.
A wrapper to provide easy access to locale related data in the request .
def call(env)
			return @app.call(env) unless localized?(env)
			env[LOCALIZATION_KEY] = self
			response = nil
			preferred_locales(env) do |localized_env|
				response = @app.call(localized_env)
				break unless response[0] >= 400
			end
			return vary(env, response)
		end
def call ( env ) return @app . call ( env ) unless localized? ( env ) env [ LOCALIZATION_KEY ] = self response = nil preferred_locales ( env ) do | localized_env | response = @app . call ( localized_env ) break unless response [ 0 ] >= 400 end return vary ( env , response ) end
A wrapper to provide easy access to locale related data in the request.
A wrapper to provide easy access to locale related data in the request .
# Pass the request through if it shouldn't be localized: # We have a non-localized request, but there might be a localized resource. We return the best localization possible: # puts "Trying locale: #{localized_env[CURRENT_LOCALE_KEY]}: #{localized_env[Rack::PATH_INFO]}..."
env