{"library":"koa-i18n","type":"library","category":null,"description":"koa-i18n is a lightweight internationalization (i18n) middleware for Koa applications, built upon the `i18n-2` library. The current stable version, 2.1.0, is designed for Koa 2.x, while a separate 1.x branch targets Koa 1.x applications. Release cadence appears to be tied to Koa's major versions, with `2.x` being the current 'next' major iteration as of its release 9 years ago. A key differentiator is its reliance on `koa-locale` for robust locale detection, supporting various strategies including query parameters, subdomains, cookies, HTTP headers (`Accept-Language`), URL segments, and top-level domains (TLD), with the flexibility to add custom detection functions. This allows developers to tailor how the application determines the user's preferred language, making it suitable for multi-lingual web services. It provides a simple API through `ctx.i18n.__()` for translating keys.","language":"javascript","status":"maintenance","version":"2.1.0","tags":["javascript","koa","locale","i18n","languages"],"last_verified":"Wed May 27","install":[{"cmd":"npm install koa-i18n","imports":["import i18n from 'koa-i18n';","import locale from 'koa-locale';\n// then:\nlocale(app);","ctx.body = ctx.i18n.__('my.translation.key', 'value1', 'value2');"]},{"cmd":"yarn add koa-i18n","imports":[]},{"cmd":"pnpm add koa-i18n","imports":[]}],"homepage":null,"github":"https://github.com/koa-modules/koa-i18n","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/koa-i18n","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/koa-i18n/compatibility"}}