{"id":21404770,"url":"https://github.com/fakundo/jed-webpack-plugin","last_synced_at":"2025-06-16T04:38:34.522Z","repository":{"id":52931139,"uuid":"63076902","full_name":"fakundo/jed-webpack-plugin","owner":"fakundo","description":"Webpack i18n plugin","archived":false,"fork":false,"pushed_at":"2020-07-13T20:44:17.000Z","size":179,"stargazers_count":5,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-12T19:07:59.728Z","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/fakundo.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2016-07-11T14:53:24.000Z","updated_at":"2017-09-06T07:29:24.000Z","dependencies_parsed_at":"2022-08-24T13:20:07.544Z","dependency_job_id":null,"html_url":"https://github.com/fakundo/jed-webpack-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fakundo/jed-webpack-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fakundo%2Fjed-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fakundo%2Fjed-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fakundo%2Fjed-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fakundo%2Fjed-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fakundo","download_url":"https://codeload.github.com/fakundo/jed-webpack-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fakundo%2Fjed-webpack-plugin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259817622,"owners_count":22916179,"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-11-22T16:18:00.820Z","updated_at":"2025-06-16T04:38:34.476Z","avatar_url":"https://github.com/fakundo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jed (gettext style i18n) Webpack Plugin\n\n[![npm](https://img.shields.io/npm/v/jed-webpack-plugin.svg?maxAge=1592000)](https://www.npmjs.com/package/jed-webpack-plugin)\n\nComplete i18n solution with webpack and Jed.\n\n## Installation\n```\nnpm install jed-webpack-plugin --save-dev\n```\n\n## Usage\n\nwebpack.config.js\n```js\nvar locales = ['en-us', 'ru', 'de'];\n\nmodule.exports = locales.map(function(locale) {\n  return {\n    entry: path.join(__dirname, 'src', 'index'),\n    devtool: 'source-map',\n    output: {\n      filename: locale + '.app.js',\n      path: path.join(__dirname, 'dist'),\n      publicPath: '/'\n    },\n    plugins: [\n      new HtmlWebpackPlugin({\n        template: path.join(__dirname, 'index.html'),\n        filename: locale + '.index.html'\n      }),\n      new webpack.DefinePlugin({\n        'process.env.locale': JSON.stringify(locale)\n      }),\n      new JedWebpackPlugin({\n        mo: path.join(__dirname, 'locales', locale + '.mo'),\n        defineJedIdentifier: 'jed'\n      }),\n      new webpack.ContextReplacementPlugin(/moment[\\/\\\\]locale$/, new RegExp(locale))\n    ]\n  };\n});\n```\n\nentry - index.js\n```js\nvar label = gettext('Hello World');\n\n// Plurals\nvar n = 10;\nvar appleLabel1 = ngettext('One apple', '%% apples', n).replace(/%%/, n);\n// or\nvar appleLabel2 = jed.sprintf(ngettext('One apple', '%1$d apples', n), n);\n```\n\n## Options\n\n```\nmo - translation file path (.mo)\ndefineJedIdentifier - (optional) name identifier for providing access to jed instance\n```\n\nUse Poedit to create translation files from your source code and see examples.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffakundo%2Fjed-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffakundo%2Fjed-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffakundo%2Fjed-webpack-plugin/lists"}