{"id":22092183,"url":"https://github.com/pirxpilot/i18n-stack","last_synced_at":"2025-03-23T23:45:25.564Z","repository":{"id":31770739,"uuid":"35337038","full_name":"pirxpilot/i18n-stack","owner":"pirxpilot","description":null,"archived":false,"fork":false,"pushed_at":"2020-03-29T15:39:39.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-29T06:52:58.864Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pirxpilot.png","metadata":{"files":{"readme":"Readme.md","changelog":"History.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-09T16:59:29.000Z","updated_at":"2020-03-29T15:39:42.000Z","dependencies_parsed_at":"2022-09-10T09:12:30.114Z","dependency_job_id":null,"html_url":"https://github.com/pirxpilot/i18n-stack","commit_stats":null,"previous_names":["code42day/code42day-i18n"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Fi18n-stack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Fi18n-stack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Fi18n-stack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Fi18n-stack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pirxpilot","download_url":"https://codeload.github.com/pirxpilot/i18n-stack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245186926,"owners_count":20574554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-01T03:08:36.761Z","updated_at":"2025-03-23T23:45:25.544Z","avatar_url":"https://github.com/pirxpilot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NPM version][npm-image]][npm-url]\n[![Dependency Status][deps-image]][deps-url]\n[![Dev Dependency Status][deps-dev-image]][deps-dev-url]\n\n# i18n-stack\n\nStack of connect middleware for language/locale detection and translation.\n\n- [detectLanguage][detect-language] - parse and detect browser language preference\n- [overwriteLanguage][overwrite-language] - overwrite language selection with query param and/or cookie\n- [gettext][connect-gettext] - insert simple gettext implementation in response\n\nAlso exposes [parseAcceptLanguage][parse-accept-language] - in case if you need parsed form\nof `Accept-Language` header for some other reason than language selection.\n\nIf you don't need this exact stack all of its components can be used separately.\n\n## Install\n\n```sh\n$ npm install --save i18n-stack\n```\n\n## Usage\n\n```js\n\nvar app = require('express');\n\nvar locale = {\n  supportedLanguages: ['de', 'fr', 'pl', 'en-GB', 'en-US'],\n  defaultLanguage: 'en',\n  gettextAlias: '_'\n};\n\nvar i18n = require('i18n-stack');\n\napp.use(i18n.overwriteLanguage(locale));\napp.use(i18n.detectLanguage(locale));\napp.use(i18n.gettext(locale));\n\n\n```\n\n## License\n\nMIT © [Damian Krzeminski](https://pirxpilot.me)\n\n[detect-language]: https://npmjs.org/package/detect-language\n[overwrite-language]: https://npmjs.org/package/overwrite-language\n[connect-gettext]: https://npmjs.org/package/connect-gettext\n[parse-accept-language]: https://npmjs.org/package/parse-accept-language\n\n[npm-image]: https://img.shields.io/npm/v/i18n-stack.svg\n[npm-url]: https://npmjs.org/package/i18n-stack\n\n[deps-image]: https://img.shields.io/david/pirxpilot/i18n-stack.svg\n[deps-url]: https://david-dm.org/pirxpilot/i18n-stack\n\n[deps-dev-image]: https://img.shields.io/david/dev/pirxpilot/i18n-stack.svg\n[deps-dev-url]: https://david-dm.org/pirxpilot/i18n-stack?type=dev\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpirxpilot%2Fi18n-stack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpirxpilot%2Fi18n-stack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpirxpilot%2Fi18n-stack/lists"}