2012年3月20日火曜日

Wordpressのテーマ (Fusion)の日本語化が意外にも楽ちん

修正しました。下記は駄文でした。
http://ssmx.blogspot.jp/2012/03/wordpress-fusion-y.html
無知とは恐ろしいものです。

最近は便利になったものですねぇ
管理画面から
外観>テーマ編集>
右側サイドバーからテンプレートを順に選ぶ
当方はChromeを利用しているが
Ctrl+F
で表示される検索キーワードに
','fusion')
と入力し検索するとこんなかんじでハイライトされます

','fusion') 
の前がHP上に表示されるキーワードなのでここを変更します。
<?php printf( __('Archive for category %s', 'fusion'),

<?php printf( __('%sのカテゴリ', 'fusion'),

%s は代入される変数っぽい。



<?php printf(__('Post by %s %s on %s','fusion'),
'<a href="'. get_author_posts_url(get_the_author_ID()) .'" title="'. sprintf(__("%s の投稿","fusion"), attribute_escape(get_the_author())).' ">'. get_the_author() .'</a>',get_the_category_list(', '), get_the_time(get_option('date_format'))); ?> <?php edit_post_link(__('編集','fusion')); ?></p>

みたいのは


<?php printf(__('Post by %s %s on %s','fusion'),
'<a href="'. get_author_posts_url(get_the_author_ID()) .'" title="'. sprintf(__("%s の投稿","fusion"), attribute_escape(get_the_author())).' ">'. get_the_author() .'</a>',
get_the_category_list(', '), 
get_the_time(get_option('date_format'))
); ?> <?php edit_post_link(__('編集','fusion')); ?></p>


みたいに別れます。そのうちそれぞれの%sに対応するのは

<?php printf(__('Post by %s %s on %s','fusion'),
'<a href="'. get_author_posts_url(get_the_author_ID()) .'" title="'. sprintf(__("%s の投稿","fusion"), attribute_escape(get_the_author())).' ">'. get_the_author() .'</a>',
get_the_category_list(', '), 
get_the_time(get_option('date_format'))
); ?> <?php edit_post_link(__('Edit','fusion')); ?></p>


なので、私は投稿者なんてあえて必要ないから削除、日付とカテゴリをひっくり返しアメブロに倣ってテーマにしました。
<p><?php printf(__('%s テーマ:%s','fusion'),
get_the_time(get_option('date_format')),
get_the_category_list(', ')
); ?> <?php edit_post_link(__('編集','fusion'),'| ',''); ?></p>

0 件のコメント: