<commit_before>
/*!
 * Skeleton.js - DefaultHelpers
 * Copyright(c) 2012 <NAME> <<EMAIL>>
 * MIT Licensed
 */

define([
  'config',
  'underscore',
  // Used through underscore reference
  'underscore.string',
  '../../i18n',
  '../../util/url'
], function(config, _, _s, I18n, url){

  'use strict';

  /**
   * Joins the specified url fragments, starting from the end, util the current
   * fragment contains the host part
   */
  function joinUntilHost(){
    var fragments = _(arguments).toArray(),
        urlStr = '';
    while (fragments.length > 0){
      var fragment = fragments.pop();
      var parsed = url.parseUri(fragment);
      if (parsed.host) return url.join(fragment, urlStr);
      else urlStr = url.join(fragment, urlStr);
    }
    return urlStr;
  }

  return {

    config: config,

    // Underscore reference (it's passed to the underscore templates by the
    // engine itself, but we can't assume that we're using the underscore
    // template engine)
    _: _,

    // I18n functions
    t: I18n.t,
    l: I18n.l,

    /**
     * Returns the url of the specified path relative to the app root url
     */
    urlTo: function(dst){
      return joinUntilHost(config.url.root, dst);
    },

    /**
     * Returns the url of the specified path relative to the assets url
     */
    assetUrl: function(src){
      return joinUntilHost(config.url.root, config.url.assets, src);
    },

    /**
     * Returns the url of the specified path relative to the images url
     */<commit_msg>Added I18n namespace to the default view helpers.<commit_after>
/*!
 * Skeleton.js - DefaultHelpers
 * Copyright(c) 2012 <NAME> <<EMAIL>>
 * MIT Licensed
 */

define([
  'config',
  'underscore',
  // Used through underscore reference
  'underscore.string',
  '../../i18n',
  '../../util/url'
], function(config, _, _s, I18n, url){

  'use strict';

  /**
   * Joins the specified url fragments, starting from the end, util the current
   * fragment contains the host part
   */
  function joinUntilHost(){
    var fragments = _(arguments).toArray(),
        urlStr = '';
    while (fragments.length > 0){
      var fragment = fragments.pop();
      var parsed = url.parseUri(fragment);
      if (parsed.host) return url.join(fragment, urlStr);
      else urlStr = url.join(fragment, urlStr);
    }
    return urlStr;
  }

  return {

    // Config object
    config: config,

    // Underscore reference (it's passed to the underscore templates by the
    // engine itself, but we can't assume that we're using the underscore
    // template engine)
    _: _,

    // I18n and its main functions
    I18n: I18n,
    t: I18n.t,
    l: I18n.l,

    /**
     * Returns the url of the specified path relative to the app root url
     */
    urlTo: function(dst){
      return joinUntilHost(config.url.root, dst);
    },

    /**
     * Returns the url of the specified path relative to the assets url
     */
    assetUrl: function(src){
      return joinUntilHost(config.url.root, config.url.assets, src);
    },

    /**
     * Returns the url of the specified path relative to the images url
     */
{'fraction_non_alphanumeric': 0.1237146529562982, 'fraction_numerical': 0.011568123393316195, 'mean_word_length': 2.4860022396416572, 'pattern_counts': {'":': 0, '<': 9, '<?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': '5867582', 'n_tokens_mistral': 976, 'n_tokens_neox': 928, 'n_words': 310}