<commit_before># enable host specific translations via AR records
#
# to insert a new translation use the store translations method
#
# example:
# I18n::Backend::ActiveRecord.new.store_translations(:de, nav: { kid: 'Kid AR'})
require 'i18n/backend/active_record'

if (::ActiveRecord::Base.connection_pool.with_connection(&:active?) rescue false) &&
    I18n::Backend::ActiveRecord::Translation.table_exists?
  I18n.backend = I18n::Backend::ActiveRecord.new

  I18n::Backend::ActiveRecord.send(:include, I18n::Backend::Memoize)
  I18n::Backend::Simple.send(:include, I18n::Backend::Memoize)
  I18n::Backend::Simple.send(:include, I18n::Backend::Pluralization)

  I18n.backend = I18n::Backend::Chain.new(I18n::Backend::Simple.new, I18n.backend)
end<commit_msg>fixed i18 backend initialization<commit_after># enable host specific translations via AR records
#
# to insert a new translation use the store translations method
#
# example:
# I18n::Backend::ActiveRecord.new.store_translations(:de, nav: { kid: 'Kid AR'})
require 'i18n/backend/active_record'

if (::ActiveRecord::Base.connection_pool.with_connection(&:active?) rescue false) &&
    I18n::Backend::ActiveRecord::Translation.table_exists?

  I18n.backend = I18n::Backend::Chain.new(I18n::Backend::ActiveRecord.new, I18n.backend)
  Translation  = I18n::Backend::ActiveRecord::Translation

end
{'fraction_non_alphanumeric': 0.14158636026686433, 'fraction_numerical': 0.03558191252779837, 'mean_word_length': 7.653846153846154, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7236875', 'n_tokens_mistral': 461, 'n_tokens_neox': 444, 'n_words': 82}