<commit_before><footer>
  <%= link_to(I18n.t(:about_markus),
              about_main_index_path(),
              remote: true) %>

  <span class="lang_chooser">
    <%= I18n.t(:choose_language) %>
    <%= #gets the relative path without the language choice, then on change of the language,
        #it adds this relative path to the end of the new language that was chosen.
        relative = request.path
        relative = relative.gsub("/#{I18n.locale}", "")

        select_tag(:locale, options_for_select(@available_locales,
                   selected: "#{I18n.locale}"),
                   { onchange: "javascript:window.location.href = '/' + this.options[this.selectedIndex].value + '#{relative}';" }) %>
  </span>

  <% if @current_user.admin? or @current_user.ta? %>
    <span class="issues">
      <a href="https://github.com/MarkUsProject/Markus/issues/"><%= I18n.t(:issues) %></a>
    </span>
  <% end %>
</footer><commit_msg>locale: fix bug where switching locales with a relative url root resulted in a malformed url<commit_after><footer>
  <%= link_to(I18n.t(:about_markus),
              about_main_index_path(),
              remote: true) %>

  <span class="lang_chooser">
    <%= I18n.t(:choose_language) %>
    <%= #gets the relative path without the language choice, then on change of the language,
        #it adds this relative path to the end of the new language that was chosen.
        relative_root = Rails.application.config.action_controller.relative_url_root || ''
        curr_path = request.path.gsub(relative_root, "").gsub(Regexp.compile("(?<=/)#{I18n.locale}/"), "")

        select_tag(:locale, options_for_select(@available_locales,
                   selected: "#{I18n.locale}"),
                   { onchange: "javascript:
                                    window.location.href =
                                         '#{relative_root}/' +
                                         this.options[this.selectedIndex].value +
                                         '#{curr_path}';"
                   }
        )
    %>
  </span>

  <% if @current_user.admin? or @current_user.ta? %>
    <span class="issues">
      <a href="https://github.com/MarkUsProject/Markus/issues/"><%= I18n.t(:issues) %></a>
    </span>
  <% end %>
</footer>
{'fraction_non_alphanumeric': 0.1479367866549605, 'fraction_numerical': 0.00877963125548727, 'mean_word_length': 2.2464387464387463, 'pattern_counts': {'":': 0, '<': 32, '<?xml version=': 0, '>': 31, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3378448', 'n_tokens_mistral': 698, 'n_tokens_neox': 652, 'n_words': 143}