{"id":15641232,"url":"https://github.com/tiagodanin/nodejs-i18n","last_synced_at":"2025-08-12T18:41:35.225Z","repository":{"id":33127112,"uuid":"151769221","full_name":"TiagoDanin/NodeJS-i18n","owner":"TiagoDanin","description":"Minimalistic internationalization using gettext style for NodeJS","archived":false,"fork":false,"pushed_at":"2025-03-03T18:39:17.000Z","size":182,"stargazers_count":2,"open_issues_count":13,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T12:52:57.864Z","etag":null,"topics":["gettext","i18n","i18n-js","i18n-node","internationalization","javascript","nodejs"],"latest_commit_sha":null,"homepage":"https://tiagodanin.github.io/NodeJS-i18n/","language":"JavaScript","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/TiagoDanin.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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-10-05T19:36:57.000Z","updated_at":"2021-05-09T03:48:15.000Z","dependencies_parsed_at":"2024-05-28T19:55:02.807Z","dependency_job_id":"840b38a4-df6a-4833-b239-523cc666531f","html_url":"https://github.com/TiagoDanin/NodeJS-i18n","commit_stats":{"total_commits":65,"total_committers":3,"mean_commits":"21.666666666666668","dds":0.5076923076923077,"last_synced_commit":"c0f25df0708465fc2e73495862d3772524c0f3da"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TiagoDanin%2FNodeJS-i18n","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TiagoDanin%2FNodeJS-i18n/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TiagoDanin%2FNodeJS-i18n/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TiagoDanin%2FNodeJS-i18n/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TiagoDanin","download_url":"https://codeload.github.com/TiagoDanin/NodeJS-i18n/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249057648,"owners_count":21205905,"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":["gettext","i18n","i18n-js","i18n-node","internationalization","javascript","nodejs"],"created_at":"2024-10-03T11:41:55.393Z","updated_at":"2025-04-15T10:52:17.748Z","avatar_url":"https://github.com/TiagoDanin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NodeJS i18n\n\n[![Travis](https://img.shields.io/travis/TiagoDanin/NodeJS-i18n.svg?branch=master\u0026style=flat-square)](https://travis-ci.org/TiagoDanin/NodeJS-i18n) [![Downloads](https://img.shields.io/npm/dt/nodejs-i18n.svg?style=flat-square)](https://npmjs.org/package/nodejs-i18n) [![Node](https://img.shields.io/node/v/nodejs-i18n.svg?style=flat-square)](https://npmjs.org/package/nodejs-i18n) [![Version](https://img.shields.io/npm/v/nodejs-i18n.svg?style=flat-square)](https://npmjs.org/package/nodejs-i18n) \n\nMinimalistic internationalization using gettext style for NodeJS\n\n## Features\n\n- Gettext Style\n- Easy Imprementation\n- Create .po via CLI\n- Select Lang per User\n\n## Installation\n\nModule available through the [npm registry](https://www.npmjs.com/). It can be installed using the [`npm`](https://docs.npmjs.com/getting-started/installing-npm-packages-locally) or [`yarn`](https://yarnpkg.com/en/) command line tool.\n\n```sh\n# Yarn (Recomend)\nyarn global add nodejs-i18n\n# NPM \nnpm install nodejs-i18n --global\n```\n\n## Usage\n\n```sh\n# Create file\nfind . | grep .js | sort | nodejs-i18n \u003e en.po\n\n# Create file (all strings) [beta]\nfind . | grep .js | sort | nodejs-i18n --all \u003e en.po\n\n# Create file (get identifier value) [beta]\nfind . | grep .js | sort | nodejs-i18n --value \u003e en.po\n```\n\n## Example\n\n```js\nconst { Resources, Translation } = require('nodejs-i18n')\n\nconst resources = new Resources()\nresources.load('pt', 'pt.po')\n\nconst user = new Translation('pt')\n\n//i18n: My Hello World with NodeJs i18n\nconst world = user._`world` // Mundo\nuser._`Hello ${world}` // Olá mundo\n```\n\n## Documentation\n\n### Options\n\n#### Options :: Resources({})\n- **lang** - String\n\u003e Lang id.\u003c/br\u003e\n\u003e Default value: `en`\n\n#### Options :: Resources({}).load(lang, file)\nLoad translation\n\n- **lang** - String\n\u003e Lang id.\u003c/br\u003e\n\n- **file** - String\n\u003e File path\n\n#### Options :: Resources({}).remove()\nRemove translation.\n\n- **lang** - String\n\u003e Lang id.\u003c/br\u003e\n\n#### Options :: Translation(lang)\nSelect translation.\n\n- **lang** - String\n\u003e Lang id.\u003c/br\u003e\n\n#### Options :: Translation(lang).\\_(string)\nString translation.\n\n- **String** - String\n\n### CLI\n\nCreate en.po files with `nodejs-i18n`. Add in your package.json\n\n```json\n\"scripts\": {\n\t\"i18n\": \"find . | grep .js | sort | nodejs-i18n \u003e en.po\"\n}\n```\n\nand run `$ npm run i18n` or `$ yarn i18n`\n\n## Tests\n\nTo run the test suite, first install the dependencies, then run `test`:\n\n```sh\n# Using Yarn\nyarn test\n```\n\n## Dependencies\n\n\u003cdetails\u003e\n\t\u003csummary\u003e\u003ca href=\"https://ghub.io/argv\"\u003eargv\u003c/a\u003e: CLI Argument Parser\u003c/summary\u003e\n\t\u003cb\u003eAuthor\u003c/b\u003e: Corey Hart\u003c/br\u003e\n\t\u003cb\u003eLicense\u003c/b\u003e: \u003c/br\u003e\n\t\u003cb\u003eVersion\u003c/b\u003e: 0.0.2\n\u003c/details\u003e\n\u003cdetails\u003e\n\t\u003csummary\u003e\u003ca href=\"https://ghub.io/esprima\"\u003eesprima\u003c/a\u003e: ECMAScript parsing infrastructure for multipurpose analysis\u003c/summary\u003e\n\t\u003cb\u003eAuthor\u003c/b\u003e: Ariya Hidayat\u003c/br\u003e\n\t\u003cb\u003eLicense\u003c/b\u003e: BSD-2-Clause\u003c/br\u003e\n\t\u003cb\u003eVersion\u003c/b\u003e: ^4.0.1\n\u003c/details\u003e\n\u003cdetails\u003e\n\t\u003csummary\u003e\u003ca href=\"https://ghub.io/gettext-parser\"\u003egettext-parser\u003c/a\u003e: Parse and compile gettext po and mo files to/from json, nothing more, nothing less\u003c/summary\u003e\n\t\u003cb\u003eAuthor\u003c/b\u003e: Andris Reinman\u003c/br\u003e\n\t\u003cb\u003eLicense\u003c/b\u003e: MIT\u003c/br\u003e\n\t\u003cb\u003eVersion\u003c/b\u003e: ^4.0.3\n\u003c/details\u003e\n\u003cdetails\u003e\n\t\u003csummary\u003e\u003ca href=\"https://ghub.io/minimist\"\u003eminimist\u003c/a\u003e: parse argument options\u003c/summary\u003e\n\t\u003cb\u003eAuthor\u003c/b\u003e: James Halliday\u003c/br\u003e\n\t\u003cb\u003eLicense\u003c/b\u003e: MIT\u003c/br\u003e\n\t\u003cb\u003eVersion\u003c/b\u003e: ^1.2.5\n\u003c/details\u003e\n\u003cdetails\u003e\n\t\u003csummary\u003e\u003ca href=\"https://ghub.io/tempy\"\u003etempy\u003c/a\u003e: Get a random temporary file or directory path\u003c/summary\u003e\n\t\u003cb\u003eAuthor\u003c/b\u003e: Sindre Sorhus\u003c/br\u003e\n\t\u003cb\u003eLicense\u003c/b\u003e: MIT\u003c/br\u003e\n\t\u003cb\u003eVersion\u003c/b\u003e: 0.5.0\n\u003c/details\u003e\n\n## Dev Dependency\n\n\u003cdetails\u003e\n\t\u003csummary\u003e\u003ca href=\"https://ghub.io/mocha\"\u003emocha\u003c/a\u003e: simple, flexible, fun test framework\u003c/summary\u003e\n\t\u003cb\u003eAuthor\u003c/b\u003e: TJ Holowaychuk\u003c/br\u003e\n\t\u003cb\u003eLicense\u003c/b\u003e: MIT\u003c/br\u003e\n\t\u003cb\u003eVersion\u003c/b\u003e: 7.2.0\n\u003c/details\u003e\n\n## Related\n\n\u003cdetails\u003e\n\t\u003csummary\u003e\u003ca href=\"https://ghub.io/gettext-parser\"\u003egettext-parser\u003c/a\u003e: Parse and compile gettext po and mo files to/from json, nothing more, nothing less\u003c/summary\u003e\n\t\u003cb\u003eAuthor\u003c/b\u003e: Andris Reinman\u003c/br\u003e\n\t\u003cb\u003eLicense\u003c/b\u003e: MIT\n\u003c/details\u003e\n\n## Contributors\n\nPull requests and stars are always welcome. For bugs and feature requests, please [create an issue](https://github.com/TiagoDanin/NodeJS-i18n/issues). [List of all contributors](https://github.com/TiagoDanin/NodeJS-i18n/graphs/contributors).\n\n## License\n\n[MIT](LICENSE) © [TiagoDanin](https://TiagoDanin.github.io)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiagodanin%2Fnodejs-i18n","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiagodanin%2Fnodejs-i18n","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiagodanin%2Fnodejs-i18n/lists"}