<commit_before><div id="attr_fields">
  <% SolidusI18n::Config.available_locales.each do |locale| %>
    <%= f.globalize_fields_for locale.to_sym do |g| %>
      <% @resource.class.translated_attribute_names.each_with_index do |attr, i| %>
        <div class="panel panel-default <%= attr %> <%= locale %>" style="display:<%= i == 0 ? 'auto' : 'none' %>;">
          <div class="panel-heading">
            <% I18n.with_locale(locale) do %>
              <%= @resource.class.human_attribute_name(attr) %>

              <div class="pull-right text-muted">
                <small><i><%= Spree.t(:'i18n.this_file_language') %></i></small>

                <% if locale.to_s.include?('-') %>
                  <img src="https://www.localeapp.com/assets/flags/regions/<%= locale.to_s.split('-').last %>.png">
                <% else %>
                  <img src="https://www.localeapp.com/assets/flags/languages/<%= locale %>.png">
                <% end %>
              </div>
            <% end %>
          </div>

          <div class="panel-body">
            <% if @resource.class.columns_hash[attr.to_s].type == :text %>
              <%= g.text_area attr, class: 'form-control', rows: 4 %>
            <% else %>
              <%= g.text_field attr, class: 'form-control' %>
            <% end %>
          </div>
        </div>
      <% end %>
    <% end %>
  <% end %>

  <p class="no-translations" style="display: none">
    <%= Spree.t(:'globalize.no_translations_for_criteria') %>
  </p>
</div>

<hr/><commit_msg>Fix field type check on Globalize 5.1<commit_after><div id="attr_fields">
  <% SolidusI18n::Config.available_locales.each do |locale| %>
    <%= f.globalize_fields_for locale.to_sym do |g| %>
      <% @resource.class.translated_attribute_names.each_with_index do |attr, i| %>
        <div class="panel panel-default <%= attr %> <%= locale %>" style="display:<%= i == 0 ? 'auto' : 'none' %>;">
          <div class="panel-heading">
            <% I18n.with_locale(locale) do %>
              <%= @resource.class.human_attribute_name(attr) %>

              <div class="pull-right text-muted">
                <small><i><%= Spree.t(:'i18n.this_file_language') %></i></small>

                <% if locale.to_s.include?('-') %>
                  <img src="https://www.localeapp.com/assets/flags/regions/<%= locale.to_s.split('-').last %>.png">
                <% else %>
                  <img src="https://www.localeapp.com/assets/flags/languages/<%= locale %>.png">
                <% end %>
              </div>
            <% end %>
          </div>

          <div class="panel-body">
            <% if @resource.class.translation_class.columns_hash[attr.to_s].type == :text %>
              <%= g.text_area attr, class: 'form-control', rows: 4 %>
            <% else %>
              <%= g.text_field attr, class: 'form-control' %>
            <% end %>
          </div>
        </div>
      <% end %>
    <% end %>
  <% end %>

  <p class="no-translations" style="display: none">
    <%= Spree.t(:'globalize.no_translations_for_criteria') %>
  </p>
</div>

<hr/>
{'fraction_non_alphanumeric': 0.19676375404530744, 'fraction_numerical': 0.005825242718446602, 'mean_word_length': 2.015609756097561, 'pattern_counts': {'":': 0, '<': 89, '<?xml version=': 0, '>': 89, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, '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': '3223769', 'n_tokens_mistral': 1105, 'n_tokens_neox': 975, 'n_words': 163}