{"id":20268,"library":"po-gettext-loader","title":"po-gettext-loader","description":"A webpack loader that converts GNU gettext PO files to JSON using gettext-parser. Version 1.0.0 is the latest stable release, published once. It integrates into webpack build pipelines for i18n workflows, outputting JSON that can be further processed by json-loader. Simpler than using gettext tools directly, but has no active maintenance or updates. Differentiates by offering a direct Webpack integration without additional configuration.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/cah4a/po-gettext-loader","tags":["javascript","webpack","loader","gettext"],"install":[{"cmd":"npm install po-gettext-loader","lang":"bash","label":"npm"},{"cmd":"yarn add po-gettext-loader","lang":"bash","label":"yarn"},{"cmd":"pnpm add po-gettext-loader","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core library for parsing .po files into JSON","package":"gettext-parser","optional":false}],"imports":[{"note":"Webpack loaders are typically used in webpack config, not imported directly. This default export is the loader function.","wrong":"const PoGettextLoader = require('po-gettext-loader')","symbol":"default","correct":"import PoGettextLoader from 'po-gettext-loader'"}],"quickstart":{"code":"// webpack.config.js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.po$/,\n        use: [\n          { loader: 'json-loader' },\n          { loader: 'po-gettext-loader' }\n        ]\n      }\n    ]\n  }\n};\n// Then import .po files:\nimport translations from './messages.po';","lang":"javascript","description":"Shows webpack configuration to load .po files, converting them to JSON then bundling."},"warnings":[{"fix":"Add json-loader in the use array after po-gettext-loader as shown in quickstart","message":"Requires json-loader to be chained after po-gettext-loader, else webpack cannot handle the output","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Consider using @formatjs/intl-gettext-loader or writing a custom loader","message":"Package is not actively maintained; last publish in 2018","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Chain with json-loader as shown","message":"Loader output is a JSON string, not a JavaScript object; must be used with json-loader or similar","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Add json-loader to the rule: { test: /\\.po$/, use: [ 'json-loader', 'po-gettext-loader' ] }","cause":"Missing json-loader after po-gettext-loader","error":"Module parse failed: Unexpected token (1:1)\nYou may need an appropriate loader to handle this file type."},{"fix":"Run npm install gettext-parser --save-dev","cause":"Missing peer dependency gettext-parser","error":"Error: Cannot find module 'gettext-parser'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}