<commit_before>'use strict';

var path = require('path');

var config = require('../config');

module.exports = function (req, res, next) {
    var app      = req.app,
        locales  = app.get('locales'),
        locale   = req.acceptsLanguage(locales) || app.get('default locale'),
        messages = require(path.join(config.dirs.i18n, locale));

    req.locale = locale;

    res.locals.intl || (res.locals.intl = {});
    res.locals.intl.locale   = locale;
    res.locals.intl.messages = messages;

    // TODO: Handle/merge and Expose the common formats.
    res.expose(res.locals.intl, 'APP.intl')

    next();<commit_msg>Remove APP prefix from middleware<commit_after>'use strict';

var path = require('path');

var config = require('../config');

module.exports = function (req, res, next) {
    var app      = req.app,
        locales  = app.get('locales'),
        locale   = req.acceptsLanguage(locales) || app.get('default locale'),
        messages = require(path.join(config.dirs.i18n, locale));

    req.locale = locale;

    res.locals.intl || (res.locals.intl = {});
    res.locals.intl.locale   = locale;
    res.locals.intl.messages = messages;

    // TODO: Handle/merge and Expose the common formats.
    res.expose(res.locals.intl, 'intl')

    next();
{'fraction_non_alphanumeric': 0.1590909090909091, 'fraction_numerical': 0.003134796238244514, 'mean_word_length': 2.9171779141104293, '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': '872962', 'n_tokens_mistral': 433, 'n_tokens_neox': 421, 'n_words': 89}