今、ちまちまとOsclassを触っている。
各広告の下に出る『有益な情報』が現実に即していないので書き換えたい。PayPalを使う気は無いし、Western Unionとか見たことも無い。
というわけで、情報を探してみたのだがカタカナで書かれている部分のせいで意味が分からなかった。検索結果の先頭がコレ、2番目はこのエントリを追認するものだった。
どこが問題かと言うと、
このテキストを変更するには
osclass/oc-content/themes/osclasswizards/item.php
のテーマファイルを開き、156行目以降に以下のような記述がありますので、必要な箇所を編集します。
<div class="block_list">
<div id="useful_info">
<h1 class="title">
<?php _e('Useful information', OSCLASSWIZARDS_THEME_FOLDER); ?>
</h1>
<ul>
<li>
<?php _e('Avoid scams by acting locally or paying with PayPal', OSCLASSWIZARDS_THEME_FOLDER); ?>
</li>
<li>
<?php _e('Never pay with Western Union, Moneygram or other anonymous payment services', OSCLASSWIZARDS_THEME_FOLDER); ?>
</li>
<li>
<?php _e('Don\'t buy or sell outside of your country. Don\'t accept cashier cheques from outside your country', OSCLASSWIZARDS_THEME_FOLDER); ?>
</li>
<li>
<?php _e('This site is never involved in any transaction, and does not handle payments, shipping, guarantee transactions, provide escrow services, or offer "buyer protection" or "seller certification"', OSCLASSWIZARDS_THEME_FOLDER); ?>
</li>
</ul>
</div>
</div>
と指定されているitem.phpをそのまま編集すると、英語のメッセージをそのまま修正することになってしまう。利用者は言語切替できるので、英語のメッセージと日本語のメッセージそれぞれを対で直す必要があるのだが、上の説明だとわからない。日本語で「テーマファイル」と書かれているのだが、それは~/oc-content/languages/ja_JAにあるtheme.poのことだった。多分、上記のブログが英語だったらあれこれ考えることも無く下記に辿り着けると思うけど、カタカナで「テーマファイル」って書かれるとねえ。まさか直訳?
[root@osclass ja_JA]# pwd
/var/www/html/Osclass/oc-content/languages/ja_JA
[root@osclass ja_JA]# ls -las
合計 536
0 drwxr-xr-x. 2 apache apache 139 6月 12 03:01 .
0 drwxrwxrwx. 4 apache apache 49 6月 8 00:06 ..
124 -rwxr-xr-x. 1 apache apache 126929 6月 8 00:06 core.mo
240 -rwxr-xr-x. 1 apache apache 245107 6月 8 00:06 core.po
4 -rwxr-xr-x. 1 apache apache 1377 6月 8 00:06 index.php
12 -rwxr-xr-x. 1 apache apache 10522 6月 8 00:06 mail.sql
48 -rwxr-xr-x. 1 apache apache 45105 6月 8 00:06 messages.mo
68 -rwxr-xr-x. 1 apache apache 67240 6月 8 00:06 messages.po
16 -rwxr-xr-x. 1 apache apache 14568 6月 8 00:06 theme.mo
24 -rwxr-xr-x. 1 apache apache 21208 6月 8 00:06 theme.po
実際にはpoファイルを編集してmoファイルを作るらしい。theme.poの該当部分。
#: item.php:123
msgid "Useful information"
msgstr "有益な情報"
#: item.php:125
msgid "Avoid scams by acting locally or paying with PayPal"
msgstr "直接会うか、PayPalで支払うことによって、詐欺を回避できます。"
#: item.php:126
msgid "Never pay with Western Union, Moneygram or other anonymous payment services"
msgstr "Western Union、Moneygramその他、匿名の支払いサービスは避けましょう。"
#: item.php:127
msgid "Don't buy or sell outside of your country. Don't accept cashier cheques from outside your country"
msgstr "あなたの国以外での売買はやめましょう。国外からのチェック払いを受け付けて
はいけません。"
調べてみると、WordPressの話が多数ヒットする。poファイルは普通にテキストエディタでも開くことはできるが、専用のエディタがある。
ということで、Poeditを使って直して行こうと思う。WordPressを触っている人には当たり前のことかもしれないけど、オレは知らんかった。WordPressじゃなくわざわざOsclassを選んだのに、そっちも齧ることになるとは。
ところで、CentOSにPoeditをインストールするのがめんどくさい。触るファイルをWindows上に用意しておいてWindows上で直しちゃおうかな。Windows版はインストールすぐできたし。