Method: Middleman::CoreExtensions::Internationalization#path_root

Defined in:
lib/middleman-core/core_extensions/i18n.rb

#path_root(locale) ⇒ Object



213
214
215
216
217
218
219
220
# File 'lib/middleman-core/core_extensions/i18n.rb', line 213

def path_root(locale)
  if (options[:mount_at_root] == locale) || (options[:mount_at_root].nil? && locales[0] == locale)
    '/'
  else
    replacement = options[:locale_map][locale] || locale
    options[:path].sub(':locale', replacement.to_s).sub(':lang', replacement.to_s) # Backward compat
  end
end