/**
 * @overview Create a new jade context.
 * @protected
 * @ignore
 */

var lib = require('../../../lib'),
    locales = require('../../../locales'),
    string = lib.string,
    url = lib.url,
    object = lib.object,
    fallbackCopy = object.fallbackCopy,
    apeman = require('apeman'),
    newUrlResolver = url.newUrlResolver;

module.exports = function (options) {
    var l = options.l || locales.en,
        urlResolverData = fallbackCopy({
            jsDir: 'javascripts',
            cssDir: 'stylesheets',
            imgDir: 'images'
        }, options.urlResolverData || {});

    return fallbackCopy(string, {
        meta: apeman.current.meta(),
        l: l,
        url: newUrlResolver(urlResolverData)
    });
};
