{"repo":"i18next/i18next-http-middleware","free":true,"listed":false,"github":"https://github.com/i18next/i18next-http-middleware","clone":"git clone https://github.com/i18next/i18next-http-middleware.git","description":"i18next-http-middleware is a middleware to be used with Node.js web frameworks like express or Fastify and also for Deno.","language":"JavaScript","stars":170,"topics":["i18next","middleware","i18n","express","fastify","deno","nodejs","javascript"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Introduction This is a middleware to be used with Node.js web frameworks like express or Fastify and also for Deno. It's based on the deprecated i18next-express-middleware and can be used as a drop-in replacement. It's not bound to a specific http framework anymore. Advice: To get started with server side internationalization, you may also have a look at this blog post also using using i18next-http-middleware. Getting started wire up i18next to request object Fastify usage Hapi usage Koa usage Deno usage abc ServestJS Fresh 2.x add routes add localized routes You can add your routes directly to the express app or to an express router custom http server Define your own functions to handle your custom request or response language detection Detects user language from current request. Comes with support for: - path - cookie - header - querystring - session Based on the i18next language detection handling: https://www.i18next.com/misc/creating-own-plugins#languagedetector Wiring up: As with all modules you can either pass the constructor function (class) to the i18next.use or a concrete instance. Detector Options Options can be passed in: preferred - by setting options.detection in i18next.init: on construction: via calling init: Adding own detection functionality interface adding it Don't forget: You have to add the name of your detector ( myDetectorsName in this case) to the order array in your options object. Without that, your detector won't be used. See the Detector Options s","default_branch":null,"files":null,"tree":[],"storefront":"/r/i18next","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/i18next/i18next-http-middleware/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}