{"size": 656, "ext": "js", "max_stars_repo_path": "lib/autoload/hooks/init/i18n_helpers_override.js", "max_stars_repo_name": "nodeca/nodeca.users", "max_stars_repo_stars_event_min_datetime": "2015-04-08T07:12:43.000Z", "max_stars_repo_stars_event_max_datetime": "2021-09-20T15:09:44.000Z", "max_issues_repo_path": "lib/autoload/hooks/init/i18n_helpers_override.js", "max_issues_repo_name": "nodeca/nodeca.users", "max_issues_repo_issues_event_min_datetime": "2016-02-16T19:43:48.000Z", "max_issues_repo_issues_event_max_datetime": "2016-02-16T19:46:29.000Z", "max_forks_repo_path": "lib/autoload/hooks/init/i18n_helpers_override.js", "max_forks_repo_name": "nodeca/nodeca.users", "max_forks_repo_forks_event_min_datetime": "2016-01-25T08:09:18.000Z", "max_forks_repo_forks_event_max_datetime": "2019-10-21T18:25:14.000Z"}
{"max_stars_count": 11, "max_issues_count": 1, "max_forks_count": 9, "avg_line_length": 26.24, "max_line_length": 78, "alphanum_fraction": 0.6890243902}
// Override translation helpers to get locale info from `env.user_info.locale`
// instead of default `env.runtime.locale`
//

'use strict';


module.exports = function (N) {
  var helpers = require('nodeca.core/lib/system/env').helpers;

  helpers.t = function translate_helper(phrase, params) {
    // `this` is env in helpers
    var locale = this.user_info.locale || N.config.locales[0];

    return N.i18n.t(locale, phrase, params);
  };

  helpers.t_exists = function translate_exists_helper(phrase) {
    // `this` is env in helpers
    var locale = this.user_info.locale || N.config.locales[0];

    return N.i18n.hasPhrase(locale, phrase);
  };
};
