Setu-TS
    Preparing search index...

    Function localizerFor

    • Returns the localizer for a request's resolved locale.

      Resolves the service under CAPABILITIES.LOCALIZATION and binds it to ctx.request.locale. A request with no locale (a path the middleware excludes, or a reader running before priority 45) gets the default locale rather than an error. A locale an application installed with replaceLocale that is not itself supported is negotiated against the supported set (de-AT → de), falling back to the default — a stored preference never turns into a 500.

      Parameters

      Returns ILocalizer

      A localizer bound to the request's locale

      If no provider of CAPABILITIES.LOCALIZATION is registered

      app.router.get('/', (ctx) => {
      const { t } = localizerFor(ctx);
      return ctx.response.text(t('greeting', { name: 'Ada' }));
      });

      0.9.0