# frozen_string_literal: true

module DocHelper

  def man(name, text = nil)
    link_to text || name.gsub(/^git-/, ""), doc_file_path(file: name)
  end

  def linkify(content, section)
    next_page = section.next_slug
    prev_page = section.prev_slug
    content.gsub("[[nav-next]]", next_page).gsub("[[nav-prev]]", prev_page)
  end
end

# frozen_string_literal: true

module DocHelper

  def man(name, text = nil)
    if @language && @language != "en"
      link_to text || name.gsub(/^git-/, ""), doc_file_path(file: name,) +"/#{@language}"
    else
      link_to text || name.gsub(/^git-/, ""), doc_file_path(file: name)
    end
  end

  def linkify(content, section)
    next_page = section.next_slug
    prev_page = section.prev_slug
    content.gsub("[[nav-next]]", next_page).gsub("[[nav-prev]]", prev_page)
  end
end

Extend local manpages to Topics menus
Extend local manpages to Topics menus

As much as possible, readers who have selected their language would
like to remain with translated content.
