Closed lachmanski closed 7 years ago
Hi! I recently took over this project and want to follow up on your issue.
You mention you didn't have the po.parse
, po.compile
and so on methods.
This seems to be because you require each component individually in gettext-parser.js
.
When you use something like window.gettextParser = require('gettext-parser')
, this should be ok.
If you then do:
var raw = gettextParser.po.compile(example);
console.log(raw.toString());
Everything seems to work fine. Maybe also use UTF-8 as the character set in the example object.
I'm going to close this issue, but feel free to ask if anything is unclear.
I'd like to use this library in-browser. I installed node-js, Browserify, the encoding module, and bundled up your code. Everything runs without throwing any errors, but I'm getting strange PO file output. I was expecting a string of text, but I'm getting a string of numbers. Can you recommend a fix?
gettext-parser.js (before bundling with Browserify)
index.html
PO File Output:
One thing I noticed is that my poCompiler reference does not contain
.po.parse
,.po.compile
,.mo.parse
, or.mo.compile
function declarations. It is a bare function: