<commit_before>module ApplicationHelper
  def page_title(header, glue = ' - ')
    [header, I18n.t(:app_title)].compact.join(glue)
  end

  def markdown(source)
    Kramdown::Document.new(source).to_html.html_safe
  end

  def javascript_i18n
    {
      days: I18n.t('date.day_names'),
      months: I18n.t('date.month_names').drop(1),
      abbrMonths: I18n.t('date.abbr_month_names').drop(1),
      am: I18n.t('time.am'),
      pm: I18n.t('time.pm'),
      hour: I18n.t('time.hour'),
      minute: I18n.t('time.minute')
    }
  end

  def alternative_locales
    I18n.available_locales - [I18n.locale]
  end

  def add_line_breaks(str)
    safe_join(str.split(/\n/), '<br />'.html_safe)
  end
end<commit_msg>Disable the link to Welsh (until they’re approved)<commit_after>module ApplicationHelper
  def page_title(header, glue = ' - ')
    [header, I18n.t(:app_title)].compact.join(glue)
  end

  def markdown(source)
    Kramdown::Document.new(source).to_html.html_safe
  end

  def javascript_i18n
    {
      days: I18n.t('date.day_names'),
      months: I18n.t('date.month_names').drop(1),
      abbrMonths: I18n.t('date.abbr_month_names').drop(1),
      am: I18n.t('time.am'),
      pm: I18n.t('time.pm'),
      hour: I18n.t('time.hour'),
      minute: I18n.t('time.minute')
    }
  end

  def alternative_locales
    # This disables the link to Welsh
    disabled_locales = [:cy]

    I18n.available_locales - disabled_locales - [I18n.locale]
  end

  def add_line_breaks(str)
    safe_join(str.split(/\n/), '<br />'.html_safe)
  end
end
{'fraction_non_alphanumeric': 0.15459249676584735, 'fraction_numerical': 0.031047865459249677, 'mean_word_length': 3.203804347826087, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4419227', 'n_tokens_mistral': 645, 'n_tokens_neox': 600, 'n_words': 97}