{"id":13651289,"url":"https://github.com/teamcodeyard/moleculer-i18n","last_synced_at":"2026-03-07T02:10:38.796Z","repository":{"id":154841901,"uuid":"627438600","full_name":"teamcodeyard/moleculer-i18n","owner":"teamcodeyard","description":"🌐 Server side i18n support for Moleculer microservices framework based on Polyglot","archived":false,"fork":false,"pushed_at":"2023-04-28T11:01:30.000Z","size":327,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-05T15:11:15.956Z","etag":null,"topics":["codeyard","codeyardfactory","devcontainer","fancy","i18n","microservices","moleculer","moleculerjs","nodejs","typescript","vitest","vscode"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@codeyard/moleculer-i18n","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/teamcodeyard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-04-13T13:20:20.000Z","updated_at":"2023-09-06T08:41:41.000Z","dependencies_parsed_at":"2024-01-14T12:29:56.971Z","dependency_job_id":null,"html_url":"https://github.com/teamcodeyard/moleculer-i18n","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/teamcodeyard/moleculer-i18n","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teamcodeyard%2Fmoleculer-i18n","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teamcodeyard%2Fmoleculer-i18n/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teamcodeyard%2Fmoleculer-i18n/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teamcodeyard%2Fmoleculer-i18n/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/teamcodeyard","download_url":"https://codeload.github.com/teamcodeyard/moleculer-i18n/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teamcodeyard%2Fmoleculer-i18n/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30205897,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T19:07:06.838Z","status":"online","status_checked_at":"2026-03-07T02:00:06.765Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["codeyard","codeyardfactory","devcontainer","fancy","i18n","microservices","moleculer","moleculerjs","nodejs","typescript","vitest","vscode"],"created_at":"2024-08-02T02:00:47.639Z","updated_at":"2026-03-07T02:10:38.756Z","avatar_url":"https://github.com/teamcodeyard.png","language":"TypeScript","funding_links":[],"categories":["Services"],"sub_categories":["Others"],"readme":"[![Moleculer logo](http://moleculer.services/images/banner.png)](https://github.com/moleculerjs/moleculer)\n\n\u003cbr\u003e\n\n🌐 Server side i18n support for [Moleculer](https://moleculer.services/) microservices framework based on [Polyglot](https://www.npmjs.com/package/node-polyglot). [![NPM version](https://img.shields.io/npm/v/@codeyard/moleculer-i18n.svg)](https://www.npmjs.com/package/@codeyard/moleculer-i18n)\n\n\n\n\u003cbr\u003e\n\n# Install\n\n```bash\n$ npm install @codeyard/moleculer-i18n --save\n```\n\n\u003cbr\u003e\n\n# Usage\n\n## Add I18nMixin to your service\n\n```js\nconst { I18nMixin } = require('@codeyard/moleculer-i18n')\n\nbroker.createService({\n  name: 'greeter',\n  mixins: [I18nMixin],\n  actions: {\n    welcome: {\n      handler(ctx) {\n        return this.t(ctx, 'greeter.welcome.message', { name: 'Jon' })\n      },\n    },\n  },\n})\n```\n\n\u003cbr\u003e\n\n## Configurations\n\n```js\nconst { I18nMixin } = require('moleculer-i18n')\nconst Polyglot = require('node-polyglot')\n\nbroker.createService({\n  name: 'greeter',\n  mixins: [I18nMixin],\n  settings: {\n    i18n: {\n      dirName: 'translations',\n      languages: ['en', 'es'],\n      polyglot: new Polyglot(),\n    },\n  },\n})\n```\n\n\u003cbr\u003e\n\n### Setting fields\n| Property | Type | Default | Description |\n| -------- | ---- | ------- | ----------- |\n| `dirName` | `string` | **optional** | Name of the directory that contains localized JSON files. |\n| `languages` | `array` | **optional** | Array of supported languages (default: en). |\n\n\u003cbr\u003e\n\n### Example en.json file\n\n```json\n{\n  \"greeter\": {\n    \"welcome\": {\n      \"message\": \"Hello there!\"\n    }\n  },\n  \"errors.general.message\": \"Ooops, somethig went wrong!\",\n  \"greeter.farewell\": \"Good bye %{name}!\"\n}\n```\n\n\u003cbr\u003e\n\n# License\n\nThe project is available under the [MIT license](./LICENSE).\n\n# Contact\n\nCopyright (c) 2016-2019 MoleculerJS\n\n[![@moleculerjs](https://img.shields.io/badge/github-moleculerjs-green.svg)](https://github.com/moleculerjs) [![@MoleculerJS](https://img.shields.io/badge/twitter-MoleculerJS-blue.svg)](https://twitter.com/MoleculerJS)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteamcodeyard%2Fmoleculer-i18n","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteamcodeyard%2Fmoleculer-i18n","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteamcodeyard%2Fmoleculer-i18n/lists"}