LoginSignup
17
13

More than 5 years have passed since last update.

.mo ファイルを .po ファイルに戻す方法

Last updated at Posted at 2016-03-21

.mo ファイルしか無いときに、どうしても言語ファイルを編集したい時に使う方法

Online Tools for WordPress

Online Tools for WordPress
http://tools.konstruktors.com/
こちらに、「Convert .mo to .po」というセクションがあります。

Mac の中で行う

上記のオンラインツールも、gettext というツールを使っていて、Mac OS でも実現可能です。

訳の分からないサービスにデータを送りたくなければ、自分の Mac でも実現可能です。

Gettext & PoEditをインストールする。

私は Homebrew というパッケージ管理ツールを使って gettext をインストールしています。

  1. Homebrewをインストールする - 参考記事: MacにHomebrewをインストールする
  2. Gettext と PoEdit をインストールする - 参考記事: Macで翻訳ファイル*.poをmo形式に変換する

コマンド

.mo を .po に変換

msgunfmt [moファイルパス] -o [poファイルパス]

例: msgunfmt messages.mo -o messsages.po

.po を .mo に変換

msgfmt [poファイルパス] -o [moファイルパス]

例: msgfmt messages.po -o messsages.mo

Windows で使う

メモ。Windows は、PoEdit の中に、msgunfmt ファイルが入っているそうです。

参考: moファイルをpoファイルに変換する方法

cd "C:\Program Files\Poedit\GettextTools\bin"
msgunfmt.exe "[moファイルパス]" -o "[poファイルパス]"
17
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
17
13