<commit_before>// A tiny object to perform string substitution for translation
// No pluralization or anything fancier

// The simplest thing that could possibly work

// Initialize with an object containing
// language codes for keys and key->string for value
// i.e.
// {
//   'en': {
//     doc: 'Document',
//     annot: 'Annotation'
//   },{
//     'zh': {
//       doc:'文件'
//       annot: '註解'
//     }
//   }
//  }

(function(root,undefined) {

  var _ = root._;

  Translations = function( options ){
    this.aliases      = options.aliases || [];
    this.viewer       = options.viewer;
    this.locale       = this.viewer.schema.document.language || 'eng';
    options = root.DC_LANGUAGE_CODES ? root.DC_LANGUAGE_CODES : { language: this.locale, fallback: 'eng' };
    options.namespace = 'DV';
    this.i18n = new I18n( options );
    root.DV.t = this.i18n.translate;
  };

<commit_msg>Use i18n's noConflict to put it under DV namespace<commit_after>// A tiny object to perform string substitution for translation
// No pluralization or anything fancier

// The simplest thing that could possibly work

// Initialize with an object containing
// language codes for keys and key->string for value
// i.e.
// {
//   'en': {
//     doc: 'Document',
//     annot: 'Annotation'
//   },{
//     'zh': {
//       doc:'文件'
//       annot: '註解'
//     }
//   }
//  }

(function(root,undefined) {

  var _ = root._;

  Translations = function( options ){
    this.aliases      = options.aliases || [];
    this.viewer       = options.viewer;
    this.locale       = this.viewer.schema.document.language || 'eng';
    options = root.DC_LANGUAGE_CODES ? root.DC_LANGUAGE_CODES : { language: this.locale, fallback: 'eng' };
    options.namespace = 'DV';
    this.i18n = new I18n( options );
    root.DV.t = this.i18n.translate;
    root.DV.I18n = I18n.noConflict();
  };


{'fraction_non_alphanumeric': 0.14965259219668625, 'fraction_numerical': 0.009620523784072688, 'mean_word_length': 2.4098360655737703, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3212985', 'n_tokens_mistral': 648, 'n_tokens_neox': 612, 'n_words': 156}