{"id":20270,"library":"po-loader","title":"po-loader","description":"Webpack loader for translating .po files (GNU gettext) into JSON. Uses po2json under the hood, supports mozilla/nunjucks, Jed, and other formats. Version 0.7.0 (latest, 2017). Sync and async usage; often paired with Jed for i18n. No updates since 2017, works with webpack v1 only. Not actively maintained; consider @lingui/webpack or i18n-webpack-plugin.","status":"maintenance","version":"0.7.0","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/perchlabs/po-loader","tags":["javascript"],"install":[{"cmd":"npm install po-loader","lang":"bash","label":"npm"},{"cmd":"yarn add po-loader","lang":"bash","label":"yarn"},{"cmd":"pnpm add po-loader","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for parsing .po files; must be >=1.0.0-beta-3","package":"po2json","optional":false}],"imports":[{"note":"Loader applies automatically if configured in webpack.config","wrong":"require('./locale.po');","symbol":"po-loader","correct":"import messages from './locale.po';"},{"note":"Must be chained with json loader (or raw loader if you want JSON)","wrong":"var messages = require('po-loader!./locale.po');","symbol":"po-loader","correct":"var messages = require('json!po!./locale.po');"},{"note":"For async usage, use dynamic import(/* webpackChunkName: 'locale' */ './locale.po')","wrong":"import locale from './locale.po'; // missing async loading","symbol":"po-loader","correct":"import localePromise from './locale.po'; // then call .then() or await"}],"quickstart":{"code":"// webpack.config.js\n{\n  test: /\\.po$/,\n  loader: 'json!po',\n  exclude: /node_modules/\n}\n\n// entry.js\nimport Jed from 'jed';\n\nasync function init() {\n  const localeData = await import('./locale/en_US/LC_MESSAGES/messages.po');\n  const i18n = new Jed(localeData);\n  console.log(i18n.gettext('Hello'));\n}\n\ninit();","lang":"javascript","description":"Webpack config to load .po files with po-loader and json-loader, then async import a .po file and use Jed."},"warnings":[{"fix":"Upgrade to webpack 1 or switch to a modern i18n webpack plugin like @lingui/webpack","message":"po-loader requires webpack 1.x only; does not work with webpack 2+ modular loaders. Use json!po syntax which breaks in webpack 2+","severity":"breaking","affected_versions":">=0.5.0"},{"fix":"Use po2json@1.0.0-beta-3 exactly in package.json","message":"po2json peer dependency must be >=1.0.0-beta-3, but that version may have breaking changes. Always pin exact version.","severity":"deprecated","affected_versions":">=0.7.0"},{"fix":"Always use json!po prefix in require or configure in webpack.config with json!po loader string","message":"Requiring .po files without the json loader prefix (json!po) will output raw po2json format, not run through po-loader","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Use import(`${LOCALE_ROOT}/${locale}/LC_MESSAGES/messages.po`) with LOCALE_ROOT as a constant string","message":"Dynamic import path must match the regex for webpack to create separate bundles; otherwise returns undefined","severity":"breaking","affected_versions":">=0.5.0"}],"env_vars":null,"search_vec":"'0.7.0':26 '2017':28,42 'activ':49 'async':31 'consid':51 'file':9 'format':24 'gettext':11 'gnu':10 'hood':18 'i18n':38,55 'i18n-webpack-plugin':54 'javascript':58 'jed':21,36 'json':13 'latest':27 'lingui/webpack':52 'loader':3,5 'maintain':50 'mozilla/nunjucks':20 'often':33 'pair':34 'plugin':57 'po':2,8 'po-load':1 'po2json':15 'sinc':41 'support':19 'sync':29 'translat':7 'updat':40 'usag':32 'use':14 'v1':46 'version':25 'webpack':4,45,56 'work':43","created_at":"2026-04-25T11:22:13.083938+00:00","updated_at":"2026-04-25T11:22:13.083938+00:00","problems":[{"fix":"Add po-loader and json-loader to webpack config: { test: /\\.po$/, loader: 'json!po' }","cause":"No loader configured for .po files in webpack","error":"Module parse failed: Unexpected token (1:0)\nYou may need an appropriate loader to handle this file type."},{"fix":"npm install po2json@>=1.0.0-beta-3 --save-dev or --save","cause":"Missing peer dependency po2json","error":"Cannot find module 'po2json'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/perchlabs/po-loader","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/po-loader","openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework","serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}