Amazon Product In a Post Plugin (2) ; 日本語化

amazon-web-services
  • ????????????????????

前回のエントリーで WordPress 用の amazon プラグイン、 Amazon Product In a Post Plugin を導入しました。
今回は日本語化についてです。こちらは非常に簡単でした。php なんぞ触ったことはほとんどありませんが、ものの5分でできてしまいました。

メニュー項目を追加

amazon-product-in-a-post-plugin/inc/amazon-product-in-a-post-options.php を編集しましょう。次のような部分を探してみてください。

					array(	"name" => "Language",
							"desc" => "Language to use for Text and Button (currently only English, French and Spanish - default is English).<br /><br />",
				    		"id" => $shortname_apipp."_amazon_language",
				    		"type" => "select",
				    		"options" => array(
				    			"0" => array("value" => "en","text" => "English (default)"),
				    			"1" => array("value" => "fr","text" => "French"),
				    			"2" => array("value" => "sp","text" => "Spanish"),
				    		 )),

それを次のように変更します。

					array(	"name" => "Language",
							"desc" => "Language to use for Text and Button (currently only English, French and Spanish - default is English).<br /><br />",
				    		"id" => $shortname_apipp."_amazon_language",
				    		"type" => "select",
				    		"options" => array(
				    			"0" => array("value" => "en","text" => "English (default)"),
				    			"1" => array("value" => "fr","text" => "French"),
				    			"2" => array("value" => "sp","text" => "Spanish"),  // ここのカンマも忘れずに
				    			"3" => array("value" => "jp","text" => "Japanese")  // 追加!!
				    		 )),

日本語への翻訳

amazon-product-in-a-post-plugin/inc/amazon-product-in-a-post-translations.php を編集します。
だいたい想像が付くと思いますが、以下の switch 文を探して、日本語を追加します。一番最後に追加しました。

	switch($apip_language):
	case "en": //default
		$appip_text_lgimage 	= "See larger image";
		$appip_text_listprice 	= "List Price"; 
		$appip_text_newfrom 	= "New From"; 
		$appip_text_usedfrom 	= "Used from";
		$appip_text_instock	 	= "In Stock";
		$appip_text_outofstock 	= "Out of Stock"; 
		$appip_text_author 		= "By (author)";
		$appip_text_starring 	= "Starring";
		$appip_text_director 	= "Director";
		$appip_text_reldate 	= "Release date";
		$appip_text_preorder 	= "Preorder";
		$appip_text_notavalarea = "This item is may not be available in your area. Please click the image or title of product to check pricing.";
		$appip_text_releasedon 	= "This title will be released on";
		break;
	case "fr": //French
		$appip_text_lgimage 	= "Agrandissez cette image";
		$appip_text_listprice 	= "Prix";
		$appip_text_newfrom 	= "Neuf &agrave; partir de";
		$appip_text_usedfrom 	= "D'occasion &agrave; partir de";
		$appip_text_instock 	= "En stock";
		$appip_text_outofstock 	= "&Eacute;puis&eacute;";
		$appip_text_author 		= "De";
		$appip_text_starring 	= "Avec";
		$appip_text_director 	= "R&eacute;alisateur";
		$appip_text_reldate 	= "Date de sortie";
		$appip_text_preorder 	= "Pr&eacute;-commander";
		$appip_text_notavalarea = "Cet article n'est pas disponible dans votre secteur";
		$appip_text_releasedon = "Cet article sera disponible &agrave; partir du";
		break;
	case "sp": //Spanish
		$appip_text_lgimage 	= "Ver imagen m&aacute;s grande";
		$appip_text_listprice 	= "Lista de precios";
		$appip_text_newfrom 	= "De nuevo";
		$appip_text_usedfrom 	= "De ocasion";
		$appip_text_instock	 	= "En Stock";
		$appip_text_outofstock 	= "Fuera de Stock";
		$appip_text_author 		= "Por";
		$appip_text_starring 	= "Con";
		$appip_text_director 	= "Dirigido por";
		$appip_text_reldate 	= "Fecha de salida";
		$appip_text_preorder 	= "Para pre-pedido";
		$appip_text_notavalarea = "Esta partida se puede no estar disponible en su &aacute;rea. Por favor, haga clic en la imagen o el t�tulo del producto, para comprobar la fijaci&oacute;n de precios.";
		$appip_text_releasedon 	= "Este t&iacute;tulo ser&aacute; lanzado el";
		break;
	case "ge": //German
		$appip_text_lgimage = "Gr&ouml;&szlig;eres Bild";
		$appip_text_listprice = "Preis";
		$appip_text_newfrom = "Neu ab";
		$appip_text_usedfrom = "gebraucht ab";
		$appip_text_instock = "Auf Lager";
		$appip_text_outofstock = "Nicht auf Lager";
		$appip_text_author = "Von";
		$appip_text_starring = "Mit";
		$appip_text_director = "Regisseur(e)";
		$appip_text_reldate = "Erscheinungstermin";
		$appip_text_preorder = "Vorbestellbar";
		$appip_text_notavalarea = "Dieser Artikel ist in ihrem Gebiet nicht verf&uuml;gbar";
		$appip_text_releasedon = "Dieser Artikel ist verf&uuml;gbar ab";		break;
	case "jp": // Japanese - Modified!!!!!!!!!!!!!
		$appip_text_lgimage 	= "拡大画像を見る";
		$appip_text_listprice 	= "定価"; 
		$appip_text_newfrom 	= "価格"; 
		$appip_text_usedfrom 	= "中古価格";
		$appip_text_instock	= "在庫あり";
		$appip_text_outofstock = "在庫なし"; 
		$appip_text_author 	= "著者:";
		$appip_text_starring 	= "出演";
		$appip_text_director 	= "監督";
		$appip_text_reldate 	= "発売日";
		$appip_text_preorder 	= "予約受付";
		$appip_text_notavalarea = "この商品はお住まいの地域ではご利用できない可能性があります。画像またはリンクをクリックして価格をチェックしてください。";
		$appip_text_releasedon = "この商品の発売予定日:";
		break;
	endswitch;

日本語が正しいかどうかはよくわかりませんw
まちがっていたら訂正してください。

はてなブックマーク - Amazon Product In a Post Plugin (2) ; 日本語化
Pocket