i18n.js 238 B

123456789101112131415
  1. 'use strict';
  2. module.exports = () => {
  3. return function i18n(ctx, next) {
  4. function gettext() {
  5. return ctx.__.apply(ctx, arguments);
  6. }
  7. ctx.locals = {
  8. gettext,
  9. __: gettext,
  10. };
  11. return next();
  12. };
  13. };