<commit_before>$ ->
  if $('.available-locales').length
    switch_locale($('.available-locales'))
    slugify()


    $('form.slider .button.has_many_add').on 'click', (e) ->
      setTimeout (->
        switch_locale($('.has_many_container.slides').find('.inputs.has_many_fields:last').find('.available-locales:last'))
        return
      ), 20

###*
# Function to switch default locale in activeadmin-globalize
###
switch_locale = (element) -><commit_msg>Fix bug with locales tabs not switching properly<commit_after>$ ->
  if $('.available-locales, form.slider').length
    switch_locale($('.available-locales'))
    slugify()


    $('form.slider .button.has_many_add').on 'click', (e) ->
      setTimeout (->
        console.log 'test'
        switch_locale($('.has_many_container.slides').find('.inputs.has_many_fields:last').find('.available-locales:last'))
        return
      ), 20

###*
# Function to switch default locale in activeadmin-globalize
###
switch_locale = (element) ->
{'fraction_non_alphanumeric': 0.17623363544813697, 'fraction_numerical': 0.004028197381671702, 'mean_word_length': 3.6232558139534885, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '1785512', 'n_tokens_mistral': 310, 'n_tokens_neox': 298, 'n_words': 54}