WordPressの曜日・月表記を英語表記にする

WordPress 日本語版 では、曜日や月名は日本語で表記されますが、デザインや仕様によっては英語表記を使いたい。そんな場合の覚書です。
※バージョンは WordPress 3.0.2 です。3.1以降は掲載内容が異なる場合があります。
 
 
1. ja.po ファイルの書換

/www/設定したディレクトリ名/wp-content/languages/ 内にある ja.po ファイルの11674〜11926行の日本語部分を書き換えます。

- – - – - – - – - – - – - – - – - – - – - – - – - – - – - – -

#. translators: month name
#: wp-includes/js/tinymce/langs/wp-langs.php:53
#: wp-includes/locale.php:140
#: wp-includes/locale.php:155
msgid “January”
msgstr “1月” → msgstr “January”
  ・
  ・
  ・
#. translators: three-letter abbreviation of the weekday
#: wp-includes/js/tinymce/langs/wp-langs.php:56
#: wp-includes/locale.php:137
msgid “Sat”
msgstr “土曜日” → msgstr “Sat”

- – - – - – - – - – - – - – - – - – - – - – - – - – - – - – -

 
2. ja.po → ja.mo の変換

書き換えた ja.po ファイル を開いて ja.mo ファイル を作成します。

  • po (Locale File)
    UNIX系のシステムで使用される言語ファイルで、拡張子「mo」への変換前のバイナリの状態のファイルです。指示に従ってコンパイルすると、各言語に対応した言語ファイルが出来上がります。
  • mo (Compiled Locale File)
    拡張子「po」のロケールファイルをコンパイルしたもので、中身はプレーンテキストです。各アプリケーションに応じて、どこかのディレクトリに保管されています。

 
コンパイル用に Poedit  をダウンロードし、 ja.po ファイル を開いて ja.mo ファイル に変換すると、日本語→英語表記に変わります。

center

 
 
 
【ja.po ファイルの訂正箇所(11674〜11926行)】

#. translators: month name
#: wp-includes/js/tinymce/langs/wp-langs.php:53
#: wp-includes/locale.php:140
#: wp-includes/locale.php:155
msgid “January”
msgstr “January”

#. translators: month name
#: wp-includes/js/tinymce/langs/wp-langs.php:53
#: wp-includes/locale.php:141
#: wp-includes/locale.php:156
msgid “February”
msgstr “February”

#. translators: month name
#: wp-includes/js/tinymce/langs/wp-langs.php:53
#: wp-includes/locale.php:142
#: wp-includes/locale.php:157
msgid “March”
msgstr “March”

#. translators: month name
#: wp-includes/js/tinymce/langs/wp-langs.php:53
#: wp-includes/locale.php:143
#: wp-includes/locale.php:158
msgid “April”
msgstr “April”

#. translators: month name
#: wp-includes/js/tinymce/langs/wp-langs.php:53
#: wp-includes/locale.php:144
#: wp-includes/locale.php:159
msgid “May”
msgstr “May”

#. translators: month name
#: wp-includes/js/tinymce/langs/wp-langs.php:53
#: wp-includes/locale.php:145
#: wp-includes/locale.php:160
msgid “June”
msgstr “June”

#. translators: month name
#: wp-includes/js/tinymce/langs/wp-langs.php:53
#: wp-includes/locale.php:146
#: wp-includes/locale.php:161
msgid “July”
msgstr “July”

#. translators: month name
#: wp-includes/js/tinymce/langs/wp-langs.php:53
#: wp-includes/locale.php:147
#: wp-includes/locale.php:162
msgid “August”
msgstr “August”

#. translators: month name
#: wp-includes/js/tinymce/langs/wp-langs.php:53
#: wp-includes/locale.php:148
#: wp-includes/locale.php:163
msgid “September”
msgstr “September”

#. translators: month name
#: wp-includes/js/tinymce/langs/wp-langs.php:53
#: wp-includes/locale.php:149
#: wp-includes/locale.php:164
msgid “October”
msgstr “October”

#. translators: month name
#: wp-includes/js/tinymce/langs/wp-langs.php:53
#: wp-includes/locale.php:150
#: wp-includes/locale.php:165
msgid “November”
msgstr “November”

#. translators: month name
#: wp-includes/js/tinymce/langs/wp-langs.php:53
#: wp-includes/locale.php:151
#: wp-includes/locale.php:166
msgid “December”
msgstr “December”

#. translators: three-letter abbreviation of the month
#: wp-includes/js/tinymce/langs/wp-langs.php:54
#: wp-includes/locale.php:155
msgid “Jan_January_abbreviation”
msgstr “Jan_January_abbreviation”

#. translators: three-letter abbreviation of the month
#: wp-includes/js/tinymce/langs/wp-langs.php:54
#: wp-includes/locale.php:156
msgid “Feb_February_abbreviation”
msgstr “Feb_February_abbreviation”

#. translators: three-letter abbreviation of the month
#: wp-includes/js/tinymce/langs/wp-langs.php:54
#: wp-includes/locale.php:157
msgid “Mar_March_abbreviation”
msgstr “Mar_March_abbreviation”

#. translators: three-letter abbreviation of the month
#: wp-includes/js/tinymce/langs/wp-langs.php:54
#: wp-includes/locale.php:158
msgid “Apr_April_abbreviation”
msgstr “Apr_April_abbreviation”

#. translators: three-letter abbreviation of the month
#: wp-includes/js/tinymce/langs/wp-langs.php:54
#: wp-includes/locale.php:159
msgid “May_May_abbreviation”
msgstr “May_May_abbreviation”

#. translators: three-letter abbreviation of the month
#: wp-includes/js/tinymce/langs/wp-langs.php:54
#: wp-includes/locale.php:160
msgid “Jun_June_abbreviation”
msgstr “Jun_June_abbreviation”

#. translators: three-letter abbreviation of the month
#: wp-includes/js/tinymce/langs/wp-langs.php:54
#: wp-includes/locale.php:161
msgid “Jul_July_abbreviation”
msgstr “Jul_July_abbreviation”

#. translators: three-letter abbreviation of the month
#: wp-includes/js/tinymce/langs/wp-langs.php:54
#: wp-includes/locale.php:162
msgid “Aug_August_abbreviation”
msgstr “Aug_August_abbreviation”

#. translators: three-letter abbreviation of the month
#: wp-includes/js/tinymce/langs/wp-langs.php:54
#: wp-includes/locale.php:163
msgid “Sep_September_abbreviation”
msgstr “Sep_September_abbreviation”

#. translators: three-letter abbreviation of the month
#: wp-includes/js/tinymce/langs/wp-langs.php:54
#: wp-includes/locale.php:164
msgid “Oct_October_abbreviation”
msgstr “Oct_October_abbreviation”

#. translators: three-letter abbreviation of the month
#: wp-includes/js/tinymce/langs/wp-langs.php:54
#: wp-includes/locale.php:165
msgid “Nov_November_abbreviation”
msgstr “Nov_November_abbreviation”

#. translators: three-letter abbreviation of the month
#: wp-includes/js/tinymce/langs/wp-langs.php:54
#: wp-includes/locale.php:166
msgid “Dec_December_abbreviation”
msgstr “Dec_December_abbreviation”

#. translators: weekday
#: wp-includes/js/tinymce/langs/wp-langs.php:55
#: wp-includes/locale.php:108
#: wp-includes/locale.php:118
#: wp-includes/locale.php:131
msgid “Sunday”
msgstr “Sunday”

#. translators: weekday
#: wp-includes/js/tinymce/langs/wp-langs.php:55
#: wp-includes/locale.php:109
#: wp-includes/locale.php:119
#: wp-includes/locale.php:132
msgid “Monday”
msgstr “Monday”

#. translators: weekday
#: wp-includes/js/tinymce/langs/wp-langs.php:55
#: wp-includes/locale.php:110
#: wp-includes/locale.php:120
#: wp-includes/locale.php:133
msgid “Tuesday”
msgstr “Tuesday”

#. translators: weekday
#: wp-includes/js/tinymce/langs/wp-langs.php:55
#: wp-includes/locale.php:111
#: wp-includes/locale.php:121
#: wp-includes/locale.php:134
msgid “Wednesday”
msgstr “Wednesday”

#. translators: weekday
#: wp-includes/js/tinymce/langs/wp-langs.php:55
#: wp-includes/locale.php:112
#: wp-includes/locale.php:122
#: wp-includes/locale.php:135
msgid “Thursday”
msgstr “Thursday”

#. translators: weekday
#: wp-includes/js/tinymce/langs/wp-langs.php:55
#: wp-includes/locale.php:113
#: wp-includes/locale.php:123
#: wp-includes/locale.php:136
msgid “Friday”
msgstr “Friday”

#. translators: weekday
#: wp-includes/js/tinymce/langs/wp-langs.php:55
#: wp-includes/locale.php:114
#: wp-includes/locale.php:124
#: wp-includes/locale.php:137
msgid “Saturday”
msgstr “Saturday”

#. translators: three-letter abbreviation of the weekday
#: wp-includes/js/tinymce/langs/wp-langs.php:56
#: wp-includes/locale.php:131
msgid “Sun”
msgstr “Sun”

#. translators: three-letter abbreviation of the weekday
#: wp-includes/js/tinymce/langs/wp-langs.php:56
#: wp-includes/locale.php:132
msgid “Mon”
msgstr “Mon”

#. translators: three-letter abbreviation of the weekday
#: wp-includes/js/tinymce/langs/wp-langs.php:56
#: wp-includes/locale.php:133
msgid “Tue”
msgstr “Tue”

#. translators: three-letter abbreviation of the weekday
#: wp-includes/js/tinymce/langs/wp-langs.php:56
#: wp-includes/locale.php:134
msgid “Wed”
msgstr “Wed”

#. translators: three-letter abbreviation of the weekday
#: wp-includes/js/tinymce/langs/wp-langs.php:56
#: wp-includes/locale.php:135
msgid “Thu”
msgstr “Thu”

#. translators: three-letter abbreviation of the weekday
#: wp-includes/js/tinymce/langs/wp-langs.php:56
#: wp-includes/locale.php:136
msgid “Fri”
msgstr “Fri”

#. translators: three-letter abbreviation of the weekday
#: wp-includes/js/tinymce/langs/wp-langs.php:56
#: wp-includes/locale.php:137
msgid “Sat”
msgstr “Sat”

【追記 2011.8.28】
サイドバー内のカレンダーやアーカイブの表示は 2011年7月2011年July と年だけ日本語のまま…。年と書かれていたファイルを同様に変換してみましたが、 languages 内のファイルでは修正できなかったので、今回は元に戻すことにしました。

【参考サイト様一覧】

 

このエントリーをはてなブックマークに追加
LINEで送る

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

次のHTML タグと属性が使えます: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>