var i18nData = {
	"DEFAULT": {
		"snippet.copied": "Snippet copied to clipboard!",
		
		"error.notAnAmount": "Please enter a number here. You may include cents like this: 0.50",
		
		"cashout.greedy": "I'm greedy",
		"error.cashout.missingPaypalEmail": "Please fill in your Paypal account's e-mail address here.",
		"error.cashout.missingCountry": "Please fill in your country here.",
		"error.cashout.missingFullName": "Please fill in your full name, as it appears on your bank statement.",
		"error.cashout.missingAddress": "Please fill in your full address, as it appears on your bank statement.",
		"error.cashout.missingIban": "Please fill in your IBAN (International Bank Account Number).",
		"error.cashout.badIban": "An IBAN looks something like: NL52RABO0123456789, depending on your country.",
		"error.cashout.badIban.tooshort": "Yours is too short.",
		"error.cashout.badIban.toolong": "Yours is too long.",
		"error.cashout.badIban.wronglength": "IBANs from your country should be %%1%% characters long.",
		"error.cashout.iban.country_not_supported": "We don't support IBAN payout to your country yet. Try one of the other payout options.",
		
		"error.passTooShort": "Please enter a password that's at least 6 characters in length.",
		"error.missingPassVerify": "Please enter your password again in this box.",
		"error.passVerifyDoesntMatch": "Please enter the same password in both password text boxes.",
		"error.agreeToTos": "You'll need to agree to our Terms of Service to continue.",
		"error.missingEmail": "Please fill in your e-mail address here.",
		"error.missingPass": "Please enter your password here.",
		
		"error.signup.missingPass": "Please enter a password here so we know you're you the next time you try to log in.",
		"error.forgotpass.missingNewpass": "Please enter a new password here to replace the old one you've forgotten.",
		
		"error.changeTipjarDescription.prefix": "Did not change your tipjar's description: ",
		"xhr.cantConnect": "There was a problem connecting to TipiT.",
		
		"message.noTipjarDescription": "Your tipjar does not have a description yet.",
		"message.tipjarDescriptionUpdated": "Tipjar description updated!",
		"button.saveTipjarDescription": "Save this description."
	},
	"Lnl": {
		"snippet.copied": "De code is gekopieerd naar het plakbord.",
		"error.notAnAmount": "Voer hier een bedrag in. Centen kunnen als volgt ingevoerd worden: 0.50",
		
		"cashout.greedy": "Ik ben gierig.",
		"error.cashout.missingPaypalEmail": "Voer hier je Paypal-account e-mailadres in.",
		"error.cashout.missingCountry": "Voer hier het land in.",
		"error.cashout.missingFullName": "Voer hier je naam in zoals die op je bankafschrift staat.",
		"error.cashout.missingAddress": "Voer hier je adres in zoals die op je bankafschrift staat.",
		"error.cashout.missingIban": "Voer hier je IBAN in (Internationaal Bank Account Nummer).",
		"error.cashout.badIban": "Een IBAN ziet er zo uit: NL52RABO0123456789, afhankelijk van je land.",
		"error.cashout.badIban.tooshort": "Die van jou is niet lang genoeg.",
		"error.cashout.badIban.toolong": "Die van jou is te lang.",
		"error.cashout.badIban.wronglength": "IBANs van jou land zouden %%1%% karakters lang moeten zijn.",
		"error.cashout.iban.country_not_supported": "We ondersteunen IBAN uitbetaling naar jouw land nog niet. Probeer een van de andere uitbetalingsopties.",
		
		"error.passTooShort": "Een wachtwoord moet minimaal 6 karakters bevatten.",
		"error.missingPassVerify": "Voer hier nogmaals je nieuwe wachtwoord in ter controle.",
		"error.passVerifyDoesntMatch": "Voer hetzelfde wachtwoord in beide velden in.",
		"error.agreeToTos": "Je moet instemmen met onze Terms of Service om verder te gaan.",
		"error.missingEmail": "Voer hier een e-mailadres in.",
		"error.missingPass": "Voer hier je wachtwoord in.",
		
		"error.signup.missingPass": "Voer hier een wachtwoord in zodat we weten dat jij het bent als je de volgende keer probeert in te loggen.",
		"error.forgotpass.missingNewpass": "Voer hier een nieuw wachtwoord in om de oude te vervangen.",
		
		"error.changeTipjarDescription.prefix": "De beschrijving van de fooienpot is niet veranderd: ",
		"xhr.cantConnect": "De verbinding met TipiT is mislukt.",
		
		"message.noTipjarDescription": "Je fooienpot heeft nog geen beschrijving.",
		"message.tipjarDescriptionUpdated": "De beschrijving van de fooienpot is bijgewerkt!",
		"button.saveTipjarDescription": "Bewaar deze beschrijving."
	}
};

function i18n(key) {
	var chain, r;
	try {
		chain = $("#i18nChain").text().split("|");
	} catch (e) {}
	if (chain) for (var i in chain) {
		r = i18nApply(chain[i], key);
		if (r) return r;
	}
	
	r = i18nApply("DEFAULT", key);
	if (r) return r;
	return "!" + key + "!";
}

function i18nApply(langKey, key) {
	var d = i18nData[langKey];
	if (d) return d[key];
	return;
}
