def locale_from_url path_info = nil
      @locale_set ||= begin
        @locale ||= (match = (path_info || @env['PATH_INFO']).match(locale_pattern)) ? match[1] : nil
        @env['PATH_INFO'] = match[2] if match && @env.try(:fetch, 'PATH_INFO')
        true
      end
      @locale
    end
def locale_from_url path_info = nil
      @locale_set ||= begin
        @locale ||= (match = (path_info || @env['PATH_INFO']).match(locale_pattern)) ? match[1] : nil
        @env['PATH_INFO'] = match[2] if match && @env.try(:fetch, 'PATH_INFO')
        true
      end
      @locale
    end
Determine locale from the request URL and return it as a string, it it
 is matching any of provided locales
 If locale matching failed an empty String will be returned.

 Examples:

   #http://www.example.com/se
   locale_from_url # => 'se'

   #http://www.example.com/de/posts
   locale_from_url # => 'se'

   #http://www.example.com/ursers
   locale_from_url # => ''