{"id":14969826,"url":"https://github.com/venuu/i18n-js-webpack-plugin","last_synced_at":"2025-10-26T10:30:37.692Z","repository":{"id":46928417,"uuid":"139581896","full_name":"venuu/i18n-js-webpack-plugin","owner":"venuu","description":"webpack companion plugin for i18n-js to include only used translations","archived":false,"fork":false,"pushed_at":"2023-03-02T01:56:15.000Z","size":269,"stargazers_count":3,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-31T18:07:14.616Z","etag":null,"topics":["i18n","i18n-js","rails","ruby-on-rails","webpack"],"latest_commit_sha":null,"homepage":"","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/venuu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2018-07-03T12:42:35.000Z","updated_at":"2023-01-17T13:18:37.000Z","dependencies_parsed_at":"2024-08-22T21:34:22.328Z","dependency_job_id":"9a842e30-06a3-43cc-b32e-5b5fabdfe7b0","html_url":"https://github.com/venuu/i18n-js-webpack-plugin","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/venuu%2Fi18n-js-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/venuu%2Fi18n-js-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/venuu%2Fi18n-js-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/venuu%2Fi18n-js-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/venuu","download_url":"https://codeload.github.com/venuu/i18n-js-webpack-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238310116,"owners_count":19450794,"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":["i18n","i18n-js","rails","ruby-on-rails","webpack"],"created_at":"2024-09-24T13:42:27.420Z","updated_at":"2025-10-26T10:30:32.368Z","avatar_url":"https://github.com/venuu.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @venuu/i18n-js-webpack-plugin\n\nA webpack companion plugin for [`i18n-js`](https://github.com/fnando/i18n-js/). Output only the translations your code is actually using to your bundle.\n\n\u003chr /\u003e\n\n[![Build Status][build-badge]][build]\n\n## Installation\n\nThis module is distributed via [npm][npm] which is bundled with [node][node] and\nshould be installed as one of your project's `dependencies`:\n\n```\nnpm install --save @venuu/i18n-js-webpack-plugin\n```\n\nThis library has a `peerDependencies` listing for webpack 4.\n\n## Usage\n\n```javascript\n// webpack.config.js\n\nconst { I18nRuntimePlugin } = require(\"@venuu/i18n-js-webpack-plugin\");\n\nmodule.exports = {\n  // ...rest of your config\n  plugins: [\n    // ...any other plugins you might have\n    new I18nRuntimePlugin({\n      fullTranslations: {\n        // Put your entire translations here like below\n        en: { hello: { world: \"Hello, world!\" } },\n        fi: { hello: { world: \"Hei, maailma!\" } },\n        sv: { hello: { world: \"Och samma på svenska\" } }\n      },\n      // Global calls for I18n translations that will be picked up\n      functionNames: [\"I18n.t\", \"I18n.translate\"],\n      // \"Free variable\" in your code that will be replaced with object containing all\n      // used translations.\n      translationPlaceholderConstantName: \"I18N_RUNTIME_TRANSLATIONS\"\n    })\n  ]\n};\n```\n\n```javascript\n// your-application-entry-point.js\n\n// This assumes you have `I18n` from 'i18n-js' in current scope or available as a global\nI18n.translations = I18N_RUNTIME_TRANSLATIONS;\n```\n\nNow, any of your imported modules can call `I18n.t` or `I18n.translate` and `I18N_RUNTIME_TRANSLATIONS` will be replaced with the used translations.\n\n```javascript\nI18n.t(\"hello.world\");\nI18n.t(\"hello.world\", { locale: \"sv\" });\nI18n.translate(\"hello.world\");\n\nconsole.log(I18n.t(\"hello\", { locale: \"sv\" })); // outputs object: { world: 'Hello, world!' }\n```\n\n## LICENSE\n\nMIT\n\n\u003c!-- prettier-ignore-start --\u003e\n\n[npm]: https://www.npmjs.com/\n[node]: https://nodejs.org\n[build-badge]: https://travis-ci.org/venuu/i18n-js-webpack-plugin.svg?branch=master\n[build]: https://travis-ci.org/venuu/i18n-js-webpack-plugin\n\n\u003c!-- prettier-ignore-end --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvenuu%2Fi18n-js-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvenuu%2Fi18n-js-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvenuu%2Fi18n-js-webpack-plugin/lists"}