Registry / devops / po-gettext-loader

po-gettext-loader

JSON →
library1.0.0jsnpmunverified

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.

npm install po-gettext-loader
INSTALL
IMPORT
SIG · PO-GETTEXT-LOADER
P
po-gettext-loader
devopsjavascriptv1.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import PoGettextLoader from 'po-gettext-loader'
const PoGettextLoader = require('po-gettext-loader')
Webpack loaders are typically used in webpack config, not imported directly. This default export is the loader function.

Shows webpack configuration to load .po files, converting them to JSON then bundling.

// webpack.config.js module.exports = { module: { rules: [ { test: /\.po$/, use: [ { loader: 'json-loader' }, { loader: 'po-gettext-loader' } ] } ] } }; // Then import .po files: import translations from './messages.po';
Debug
Known issues
gotchaRequires json-loader to be chained after po-gettext-loader, else webpack cannot handle the output
fix
Add json-loader in the use array after po-gettext-loader as shown in quickstart
affects: >=1.0.0
deprecatedPackage is not actively maintained; last publish in 2018
fix
Consider using @formatjs/intl-gettext-loader or writing a custom loader
affects: >=1.0.0
gotchaLoader output is a JSON string, not a JavaScript object; must be used with json-loader or similar
fix
Chain with json-loader as shown
affects: >=1.0.0
Errors
Common errors & fixes
Module parse failed: Unexpected token (1:1) You may need an appropriate loader to handle this file type.
Missing json-loader after po-gettext-loader
fix
Add json-loader to the rule: { test: /\.po$/, use: [ 'json-loader', 'po-gettext-loader' ] }
Error: Cannot find module 'gettext-parser'
Missing peer dependency gettext-parser
fix
Run npm install gettext-parser --save-dev
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
gettext-parserrequiredCore library for parsing .po files into JSON
Agent activity
2 hits · last 30 days
node
2
Resources
po-gettext-loader — npm install po-gettext-loader · libregistry