hapi-i18next
i18next integration for hapijs
Installation
This plugin is available as an npm module. Simply run: npm install --save hapi-i18next
.
Getting Started
This plugin sets up and registers two methods in your hapi server: server.methods.i18n.getInstance()
and server.methods.i18n.translateWithCache
. Using hapi server methods allows us to set up caching schemes for the translate method. Examples of how to integrate these server methods into your application:
// Registering plugin exposes two server methods that you can use immediately in your handlers// server.methods.i18n.getInstance// server.methods.i18n.translateWithCacheserver; // Using it in views requires a few additional stepsserver;
In your helper, t.js
:
{ var translateWithCache = thisi18ntranslateWithCache params = {} namespace = '' instance = thisi18n; Object; return ;}moduleexports = i18nHelper;