npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pot-cutfn

v1.0.2

Published

Remove the file name from the POT file.

Readme

How to use?

When localizing the WordPress block editor during development, if there is multiple file information when converting a POT file created with make-pot using make-json, multiple JSON files will be created. By setting the file information to a single file name (dummy) when creating the POT, you can create a single JSON file.

WordPress ブロックエディタの開発においてローカライズを行うとき、 make-potで作成したPOTファイルをmake-jsonで変換する時にファイル情報が複数あるとその分JSONが作成されてしまいます。 POTを作成した時点でファイル情報を単一のファイル名(ダミー)にすることで一つのJSONファイルを作成できるようになります。

Precautions

In this example, we convert the .po file, but in reality you should convert it at the .pot stage. It would be inefficient to do this for each translation.

ここの使用例では.poファイルを変換してますが、実際には.potの段階で変換してください。 翻訳毎にこの作業を行うのは非効率です。

Issues with make-json

#: src/kurage/edit.tsx:132
msgid "Control Panel"
msgstr "コントロールパネル"

#: src/kurage/edit.tsx:135
msgid "Settings Panel"
msgstr "設定パネル"

#: src/kurage/context/markdown-app-context.tsx:170
msgid "Loading settings information..."
msgstr "設定情報を読み込んでいます..."

#: src/kurage/components/inspector-hooks.tsx:117
msgid "Text Update"
msgstr "テキスト更新"
  • This example only shows a few of them, but there are actually many more.
  • ここの例では一部しか載せてませんが、実際はもっとあります。

make-jsonします。

wp i18n make-json languages/markdown-block-editor-ja.po languages/po --no-purge --extensions=ts,tsx

edit.tsx, markdown-app-context.tsx, inspector-hooks.tsx, but there are actually more, so JSON files will be created for each.

edit.tsx, markdown-app-context.tsx, inspector-hooks.tsx、実際にはもっとあるのでJSONファイルがその分出来上がってしまいます。

Replace the file information with dummy information.

pot-cutfn from.po --filename build/index.js

Replaces filenames from POT files with a single dummy filename,

POファイルからファイル名を単一のダミーファイル名に置き換えます。

#: build/index.js
msgid "Control Panel"
msgstr "コントロールパネル"

#: build/index.js
msgid "Settings Panel"
msgstr "設定パネル"

#: build/index.js
msgid "Loading settings information..."
msgstr "設定情報を読み込んでいます..."

#: build/index.js
msgid "Text Update"
msgstr "テキスト更新"
wp i18n make-json languages/markdown-block-editor-ja.po languages/po --no-purge

If make-json creates a single JSON file, it's a success.

make-jsonの実行で単一のJSONファイルが作成されていれば成功です。

  • If everything is converted to index.js, you don't need --extensions.
  • index.jsにすべて変換されていれば、--extensionsは必要ありません。

Why use a dummy filename instead of deleting it? If you don't specify a filename, make-json will ignore it.

何故削除じゃなくてダミーのファイル名にする? ファイル名を指定しないとmake-jsonに無視されるからです。

basic

pot-cutfn from.po

This is not recommended. Replace the file information in from.po with index.js.

これを使うのは非推奨。 from.po内のファイル情報をindex.jsに置き換えます。

replace

pot-cutfn from.po --to to.po

The --to option creates a new file, which is safer because if there is a bug in the program, the original file will remain.

--to オプションは新たにファイルを作成します。このプログラムにバグがあった場合、元のファイルが残るのでこちらが安全です。

file name

pot-cutfn from.po --to to.po --filename build/index.js

The --filename option specifies a dummy filename. The default is index.js.

--filename オプションはファイル名のダミーを指定します。 デフォルトはindex.jsです。