{"id":41742,"library":"po-catalog-loader","title":"po-catalog-loader","description":"Webpack loader that converts GNU gettext PO files into JavaScript modules compatible with Jed and similar i18n libraries. Current stable version is 2.1.0, maintained as part of the Sentry ecosystem. The loader reads PO catalog files and exports them as JSON objects that can be consumed by runtime libraries. It has a peer dependency on gettext-parser and integrates seamlessly with webpack's module system. Compared to other i18n loaders, it is minimal and focused solely on PO file transformation.","status":"active","version":"2.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/getsentry/po-catalog-loader","tags":["javascript"],"install":[{"cmd":"npm install po-catalog-loader","lang":"bash","label":"npm"},{"cmd":"yarn add po-catalog-loader","lang":"bash","label":"yarn"},{"cmd":"pnpm add po-catalog-loader","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"PO file parsing","package":"gettext-parser","optional":false}],"imports":[{"note":"In webpack config, use 'po-catalog-loader' as a rule loader string, not as a JavaScript module import.","wrong":"const loader = require('po-catalog-loader')","symbol":"po-catalog-loader (webpack loader)","correct":"import ... from 'po-catalog-loader'"},{"note":"Configure via `options` object in webpack rule, not query string.","wrong":"use: 'po-catalog-loader?param=value' (query params not used, loader uses options in webpack rule)","symbol":"Loader usage in webpack config","correct":"{ test: /\\.po$/, use: 'po-catalog-loader' }"},{"note":"Loader options are passed via webpack's rule options, not via query parameters.","wrong":"require('po-catalog-loader').call(this, source) (not a function to call directly)","symbol":"Configuration options","correct":"{ test: /\\.po$/, use: { loader: 'po-catalog-loader', options: { /* ... */ } } }"}],"quickstart":{"code":"// webpack.config.js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.po$/,\n        use: 'po-catalog-loader'\n      }\n    ]\n  }\n};\n\n// Then import your PO file:\nimport catalog from './messages.po';\nconsole.log(catalog); // => JSON object of translations","lang":"javascript","description":"Demonstrates how to configure webpack to load .po files using po-catalog-loader and import them as JSON modules."},"warnings":[{"fix":"Use the exported JSON directly with Jed or other libraries that expect the gettext-parser format.","message":"The loader exports a JSON object parsed by gettext-parser, not a function or Jed instance.","severity":"gotcha","affected_versions":"*"},{"fix":"Consider using @formatjs/intl-gettext-loader or other modern alternatives for advanced webpack 5 features.","message":"The loader does not support webpack 5's module federation or lazy loading out of the box.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Update your runtime code to handle the new JSON format (e.g., Jed expects the old format; you may need to transform the output).","message":"Version 2.0.0 changed the output format to match gettext-parser's JSON schema, breaking compatibility with older consumers.","severity":"breaking","affected_versions":">=2.0.0"}],"env_vars":null,"search_vec":"'2.1.0':27 'catalog':3,39 'compar':71 'compat':16 'consum':50 'convert':8 'current':23 'depend':58 'ecosystem':34 'export':42 'file':12,40,84 'focus':80 'gettext':10,61 'gettext-pars':60 'gnu':9 'i18n':21,74 'integr':64 'javascript':14,86 'jed':18 'json':45 'librari':22,53 'loader':4,6,36,75 'maintain':28 'minim':78 'modul':15,69 'object':46 'parser':62 'part':30 'peer':57 'po':2,11,38,83 'po-catalog-load':1 'read':37 'runtim':52 'seamless':65 'sentri':33 'similar':20 'sole':81 'stabl':24 'system':70 'transform':85 'version':25 'webpack':5,67","created_at":"2026-06-04T18:53:53.540581+00:00","updated_at":"2026-06-04T18:53:53.540581+00:00","problems":[{"fix":"npm install gettext-parser --save-dev","cause":"Missing peer dependency gettext-parser","error":"Module not found: Error: Can't resolve 'gettext-parser'"},{"fix":"Use 'po-catalog-loader' as a string or { loader: 'po-catalog-loader' } in the rule.","cause":"Incorrect loader configuration; 'use' expects a string or object, not null","error":"Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema. - configuration.module.rules[0].use should be a string, object, or array of strings/objects."},{"fix":"npm install po-catalog-loader --save-dev","cause":"Loader not installed","error":"Cannot find module 'po-catalog-loader'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/getsentry/po-catalog-loader","github":"https://github.com/getsentry/po-catalog-loader","docs":null,"changelog":null,"pypi":null,"npm":"po-catalog-loader","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}