// mrdaio:resource.js
//
// mdario is freely distributable under the terms of new BSD license.
// Copyright (c) 2008-2009, makoto_kw (makoto.kw@gmail.com) All rights reserved.

if (typeof(mRadio)=='undefined') mRadio=function() {};
mRadio.resource = {
	strings: {},
	getString: function() {
		var text = this.strings[arguments[0]];
		if (!text) return "";
		if (arguments.length > 1) {
			for (var i=1; i<arguments.length; i++) {
				var pos = i-1;
				text = text.replace("{"+pos+"}",arguments[i],"g");
			}
		}
		return text;
	},
	load: function(locale) {
		switch (locale) {
			case "en":
				{
					this.strings = {
						"INITIALIZING_PLAYER":"Initializing Player...",
						"NOT_SUPPORTED_BROWSER":"This browser is not supported. The mRadio requires the Silverlight 2 for playing. Please reload this page if you have installed the Silverlight2.",
						"CONTENT_NOT_FOUND":'Content is not found.',
						"LOADING_CONTENT":'Loading...',
						"LOADING_CHANNEL":'Loading the channel...',
						"BLOG_URL":'http://blog.makotokw.com/kwrogu/',
						"EOF":""
					}
				}
				break;
			case "ja":
				{
					this.strings = {
						"INITIALIZING_PLAYER":"プレーヤーを初期化しています...",
						"NOT_SUPPORTED_BROWSER":"mRadioで音楽を再生するにはブラウザにSilverlight2が必要です。インストール済みであればリロードしてください。",
						"CONTENT_NOT_FOUND":'コンテンツがみつかりませんでした',
						"LOADING_CONTENT":'メディアを開いています...',
						"LOADING_CHANNEL":'チャンネルを読み込み中...',
						"BLOG_URL":'http://blog.makotokw.com/software/xjukebox/',
						"EOF":""
					}
				}
				break;
		}
	}
}