<commit_before>// Copyright 2002-2013, University of Colorado

/**
 * Reads the query parameters from browser window's URL and parses as locale.
 *
 * 1. Use the i18n.js plugin for requirejs.
 * 2. Add a reference to locale-query.js in your HTML file.
 * 3. Add this code to your config.js:
 *
 *     config: {
 *       i18n: {
 *         locale: window.phet.getLocaleQuery()  //Specify the locale using a query parameter
 *       }
 *     }
 * 4. Specify the locale in your URL like this: "http://path/to/my/sim.html?locale=fr
 * 5. Note: this file must be loaded before requirejs is started up, and this file cannot be loaded as an AMD module
 *
 * @author: <NAME>, PhET
 *
 * HISTORY:
 * Moved from forces-and-motion-basics on 3-17-2013
 */
if ( !window.phet ) {
  window.phet = {};
}
window.phet.getLocaleQuery = (function() {
  var locale = "en_US";
  if ( typeof window != 'undefined' && window.location.search ) {
    // look for first occurrence of "locale" query parameter
    var params = window.location.search.slice( 1 ).split( "&" );
    for ( var i = 0; i < params.length; i++ ) {
      var nameValuePair = params[i].split( "=" );
      if ( nameValuePair[0] === 'locale' ) {
        locale = decodeURI( nameValuePair[1] ).toLowerCase();
        break;
      }
    }
  }
  return locale;
});<commit_msg>wrap locale-query in IIFE, add "use strict" and assign result to window.phetcommon.locale instead of window.phet.getLocaleQuery<commit_after>// Copyright 2002-2013, University of Colorado

/**
 * Reads the query parameters from browser window's URL and parses as locale.
 *
 * 1. Use the i18n.js plugin for requirejs.
 * 2. Add a reference to locale-query.js in your HTML file.
 * 3. Add this code to your config.js:
 *
 *     config: {
 *       i18n: {
 *         locale: window.phet.getLocaleQuery()  //Specify the locale using a query parameter
 *       }
 *     }
 * 4. Specify the locale in your URL like this: "http://path/to/my/sim.html?locale=fr
 * 5. Note: this file must be loaded before requirejs is started up, and this file cannot be loaded as an AMD module
 *
 * @author: <NAME>, PhET
 *
 * HISTORY:
 * Moved from forces-and-motion-basics on 3-17-2013
 */
(function() {
  "use strict";
  var locale = "en_US";
  if ( typeof window != 'undefined' && window.location.search ) {
    // look for first occurrence of "locale" query parameter
    var params = window.location.search.slice( 1 ).split( "&" );
    for ( var i = 0; i < params.length; i++ ) {
      var nameValuePair = params[i].split( "=" );
      if ( nameValuePair[0] === 'locale' ) {
        locale = decodeURI( nameValuePair[1] ).toLowerCase();
        break;
      }
    }
  }
  if ( !window.phetcommon ) {
    window.phetcommon = {};
  }
  window.phetcommon.locale = locale;
}());
{'fraction_non_alphanumeric': 0.13297297297297297, 'fraction_numerical': 0.02018018018018018, 'mean_word_length': 2.7666214382632295, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2814219', 'n_tokens_mistral': 925, 'n_tokens_neox': 880, 'n_words': 297}