Skip to content

ttag-org/ttag-po-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ttag-po-loader

Webpack loader for Portable Object (.po) files for ttag.

A working proof of concept for ttag-org/ttag-webpack-plugin#8

Installation

yarn add --dev ttag-po-loader

Use

import {addLocale} from "ttag";
import en_GB from "somewhere/en-GB.po";

addLocale("en-GB`", en_GB);

Webpack rules

// 1. Tell webpack how to load PO files
config.module.rules.push({
test: [/\.po$/],
loader: "ttag-po-loader",
});

// 2. Exempt PO files from default rules if you use create-react-app
const loaders = config.module.rules.find(r => r.oneOf).oneOf;
loaders.find(l => l?.loader?.match(/file-loader/)).exclude.push(/[.]po$/);

About

Webpack loader for .po files for ttag

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published