Search code examples
jsonwordpresspo

How to install and use po2json?


I want convert some wordpress .po language files to .json format and used wp-cli but PO files converted to multi files of json but I need to a single json file.

So installed po2json using:

npm install po2json

I am getting this error:

C:\Users\Mehdi\Desktop\po2json 1.0.0>po2json translation.po translation.json
'po2json' is not recognized as an internal or external command,
operable program or batch file.

Can anybody help me to use po2json easily?


Solution

  • I have tried to install https://openbase.com/js/@myrotvorets/po2json using:

    npm i @myrotvorets/po2json
    

    And finally I got the output with the following code:

    po2json sourcefile.po > destfile.json