{"id":21190097,"url":"https://github.com/reactiumcore/webpack-po-loader","last_synced_at":"2025-08-19T02:39:26.304Z","repository":{"id":90734124,"uuid":"220839865","full_name":"ReactiumCore/webpack-po-loader","owner":"ReactiumCore","description":"Gettext portable object (PO) translation loader for webpack.","archived":false,"fork":false,"pushed_at":"2022-11-15T17:01:01.000Z","size":11,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-24T07:57:36.237Z","etag":null,"topics":[],"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/ReactiumCore.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}},"created_at":"2019-11-10T19:31:06.000Z","updated_at":"2022-11-15T16:44:23.000Z","dependencies_parsed_at":"2023-04-14T04:17:26.931Z","dependency_job_id":null,"html_url":"https://github.com/ReactiumCore/webpack-po-loader","commit_stats":null,"previous_names":["reactiumcore/webpack-po-loader","atomic-reactor/webpack-po-loader"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ReactiumCore/webpack-po-loader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReactiumCore%2Fwebpack-po-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReactiumCore%2Fwebpack-po-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReactiumCore%2Fwebpack-po-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReactiumCore%2Fwebpack-po-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ReactiumCore","download_url":"https://codeload.github.com/ReactiumCore/webpack-po-loader/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReactiumCore%2Fwebpack-po-loader/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271091913,"owners_count":24697871,"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","status":"online","status_checked_at":"2025-08-19T02:00:09.176Z","response_time":63,"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":[],"created_at":"2024-11-20T18:59:24.815Z","updated_at":"2025-08-19T02:39:26.296Z","avatar_url":"https://github.com/ReactiumCore.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Webpack PO Loader\n\n\u003e Note the current version supports webpack 5 only. See pre 5.x version for webpack 4.\n\nThis webpack loader facilitates locating Gettext Portable Object (PO) translation files, adding them to your javascript bundle so that it can be used for Javascript translations in the browser. The `.po` or `.pot` module will be a JSON stringified [JED](https://www.npmjs.com/package/jed) format named export `strings`.\n\nThis loader works well when used with [gettext-extract](https://www.npmjs.com/package/gettext-extract), which can look for string literals wrapped\nin functions like `gettext` and `ngettext` (or aliased functions like `__` and `_n`), and automatically create the Portable Object Template (template.pot) for you from your codebase. This file can be used with a tool like [Poedit](https://poedit.net/download/) by a non-technical user (such as a translation company) to produce production Gettext Portable `.po` assets for desired locales.\n\n## Install\n\n```\nnpm install --save-dev @atomic-reactor/webpack-po-loader\n```\n\n## Use Example\n\n```\nimport Jed from 'jed';\n\nexport default (locale = 'en_US') =\u003e {\n    const { strings } = require('babel-loader!@atomic-reactor/webpack-po-loader!src/translations/' + locale + '.po');\n    const jed = new Jed(JSON.parse(strings));\n\n    return {\n        // wrap string literals in your code with these helpers to get automatically translated\n        // text in your software\n        __: jed.gettext,\n        _n: jed.ngettext,\n    };\n};\n```\n\n## Webpack Config Example\n\n```\n'use strict';\n\nconst webpack = require('webpack');\nconst env = process.env.NODE_ENV || 'development';\nmodule.exports = {\n    target: 'web',\n    entry: ['index.js'],\n    mode: env,\n    output: {\n        filename: '[name].js',\n    },\n    module: {\n        rules: [\n            {\n                test: [/\\.pot?$/],\n                use: [\n                    {\n                        loader: '@atomic-reactor/webpack-po-loader',\n                    },\n                ],\n            },\n            {\n                test: [/\\.jsx|js($|\\?)/],\n                exclude: [/node_modules/],\n                use: [\n                    {\n                        loader: 'babel-loader',\n                    },\n                ],\n            },\n            },\n        ],\n    },\n};\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freactiumcore%2Fwebpack-po-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freactiumcore%2Fwebpack-po-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freactiumcore%2Fwebpack-po-loader/lists"}