useGrafikpfad = 'images/it/grafikpack-full';

var I18N = {
	'wordTable' : {
		'noObjInFrontOfAds' : 'Bitte die das Objekt nicht vor die Werbung schieben - auch DL braucht Werbung :/',
		'tavernTableEmpty' : 'Tisch {0} ist unbesetzt!',
		'tavernTableInfo' : 'Tischinfo',
		'tavernTableWithId' : 'Tisch {0}',
  		'DECIMAL_POINT' : '.',
  		'THOUSANDS_SEP' : '.',
  		'SECOND' : ['Secondo', 'Secondi'],
  		'MINUTE' : ['Minuto', 'Minuti'],
  		'HOUR' : ['Ora', 'Ore'],
  		'DAY' : ['Giorno', 'Giorni'],
  		'ABORT' : 'Chiudere',
  		'AREANAME_0' : 'Oceano',
  		'AREANAME_7' : 'Foresta dei sussurri',
  		'AREANAME_8' : 'Piana Scaglia',
  		'AREANAME_9' : 'Nagorod Novi',
  		'AREANAME_10' : 'Lucifiamma',
  		'AREANAME_11' : 'Valle Smeralda',
  		'AREANAME_12' : 'Terra di Damagar',
  		'AREANAME_13' : 'Moderia',
  		'AREANAME_14' : 'Deserto sibilante',
  		'AREANAME_15' : 'Valle Vetrosa',
  		'HIRE_PACK_QUESTION' : 'Volete arruolare la brigata \'{0}\' ?',
  		'JS_NO_MONSTERS_ON_FIELD' : 'Nessun mostro',
  		'JS_MONSTER_DISPLAY_DEACTIVATED' : 'Mostra mostri disattivato',
  		'QUEUE_ENTRY_READY' : 'pronto',
		'BUILDING_PLACEMENT_INFO' : 'Situate col mouse la costruzione nello spazio prescelto del villaggio. Cliccate sul punto scelto con il destro per iniziare i lavori di costruzione.\n\n[color=tomato]Il settore verde verrà rimosso posizionando la costruzione, il settore rosso non può essere rimosso.[/color] Se non volete ancora posizionare la costruzione, chiudete semplicemente questa finestra.',
		'INFO_MENU_HH' : 'Costruzioni',
		'INFO_MENU_BIBO' : '<u>B</u>iblioteca',
		'INFO_MENU_TEMPEL' : 'Tempio',
		'INFO_MENU_HEXE' : 'Laboratorio',
		'INFO_MENU_KASERNE' : 'Caserma',
		'INFO_MENU_FRIEDHOF' : 'Cimitero',
		'INFO_MENU_DRACHENHOF' : 'Tana dei draghi',
		'INFO_MENU_SCHATTENPORTAL' : 'Portale delle tenebre',
		'INFO_MENU_VERTEIDIGUNG' : 'Difesa',
		'INFO_MENU_MARKT' : 'Mercato',
		'INFO_MENU_HANDEL' : 'Commercio',
		'INFO_MENU_WAPPEN' : 'Vessilli',
		'INFO_MENU_TRUPPEN' : 'Truppe',
		'INFO_MENU_EINHEITEN' : 'Unità',
		'INFO_MENU_KARTE' : 'Cartina',
		'INFO_MENU_AREA' : 'Continenti',
		'INFO_MENU_GRUPPE' : 'Gilda',
		'INFO_MENU_KRIEG' : 'Guerra',
		'INFO_MENU_TOPLIST1' : 'Toplist 1',
		'INFO_MENU_TOPLIST2' : 'Toplist 2',
		'INFO_MENU_TOPLISTG' : 'Toplist delle gilde',
		'INFO_MENU_IGM' : 'Messaggi',
		'INFO_MENU_HILFE' : 'Aiuto',
		'INFO_MENU_SONSTIGES' : 'Varie ed eventuali',
		'INFO_MENU_TAVERN' : 'Taverna',
		'INFO_MENU_COMMITMENT' : 'INFO_MENU_COMMITMENT',
		'INFO_MENU_TOURNEY' : 'INFO_MENU_TOURNEY',
		'INFO_MENU_SETTLESHOP' : 'INFO_MENU_SETTLESHOP',
		'GTYPE_ANARCHIE_BONUS' : 'Quando regna l\'anarchia, due volte al mese (1. und 15. Tag) vengono distribuiti alcuni posti nella gilda in maniera casuale. Verrà inviato un messaggio informativo al diretto interessato.',
		'GTYPE_SCHATTENBRUT_BONUS' : 'Nel clan delle ombre i ruoli vengono stabiliti ogni giorno alle 4.30 in base al numero di abitanti. Più abitanti ha un giocatore al villaggio più alto sarà l\'incarico che riceverà: da leader in ordine decrescente passando per successore, generale, ministro fino ad arrivare a mago.',
		'GTYPE_RITUALISTEN_BONUS' : 'I ritualisti considerano i sacrifici un gran valore. I posti vengono assegnati ogni giorno alle 4:30 a seconda dei punti sacrificio suddivisi tra i membri. Più punti sacrificio corrispondono a un incarico più influente: all\'aumentare dei punti i posti verranno distribuiti in ordine decrescente dal leader al successore, generale, ministro fino ad arrivare al mago.',
		'GTYPE_JAEGER_SAMMLER_BONUS' : 'Tra i cacciatori e raccoglitori diventa capo chi riesce a dimostrare il raccolto più cospicuo. A seconda della quantità di risorse prodotte verranno poi affidati gli altri ruoli (successore, generale, ministro, mago) ogni giorno alle 4.30.',
		'MAX_TRADE_DIFF_X' : 'La differenza di valore deve ammontare al massimo a {0}% !',
		'TRADE_DIFF_OKAY' : 'Rapporto tra le risorse OK!',
		'ORE' : 'Metallo',
		'GOLD' : 'Oro',
		'WOOD' : 'Legname',
		'FOOD' : 'Cibo',
		'SILVER' : 'Argento',
		'DURATION_UNTIL_ENDTIME' : '{0} fino a {1}',
		'ENTER_TEMPLATE_NAME' : 'Come deve chiamarsi il modello?',
		'YES' : 'Si',
		'NO' : 'No',
		'MONSTERFIELD_TYPE_0' : 'Misto',
		'MONSTERFIELD_TYPE_1' : 'Combattimento corpo a corpo',
		'MONSTERFIELD_TYPE_2' : 'Combattimento a distanza',
		'MONSTERFIELD_TYPE_3' : 'Magia bellica',
		'MONSTERFIELD_TYPE_4' : 'Magia da sostenitore',
		'MONSTERFIELD_CHALLENGE' : '(Sfida)',
		'SAVE_NOTES' : 'Salva note',
		'CLOSE_NOTES' : 'Chiudere',
		'ITEM_COSTS_POPUP' : 'L\'oggetto \'{0}\' altera la capacità di una unità di [b]{1} punti trasporto[/b] e si avrà bisogno di [b]{2} punti sacrificio[/b] per poterla equipaggiare. Vi costa:\n\n[img]{3}/icons/20x20/erz.gif[/img][b] Metallo:[/b] {4} - [img]{3}/icons/20x20/gold.gif[/img][b] Oro:[/b] {5} - [img]{3}/icons/20x20/holz.gif[/img][b] Legno:[/b] {6} - [img]{3}/icons/20x20/nahrung_{7}.gif[/img][b] Cibo:[/b] {8} - [img]{3}/icons/20x20/silber.gif[/img][b] Argento:[/b] {9}',
		'DO_REPAIR' : 'Riparare',
		'REPAIR_MARKET_RES' : 'Vi mancano le seguenti risorse per [b]riparare[/b]:',
		'HEAL_UNITS' : 'Guarisci unità',
		'HEAL_MARKET_RES' : 'Vi mancano le seguenti risorse per [b]curare[/b]:',
		'MISSING_RES' : 'Risorse mancanti'
	},
	
	/**
	  * Format number according to the locale
	  *
	  * @param theNumber The number to be formatted
	  * @param decimalDigits The number of decimal digits can be passed to this functions, as it is not locale specific. Defaults to 0 decimal digits.
	  */
	'numberFormat' : function(theNumber, decimalDigits) {
		return(number_format(theNumber, decimalDigits, this.wordTable['DECIMAL_POINT'], this.wordTable['THOUSANDS_SEP']));
	},

	/**
	 * Format a duration according to the locale
	 *
	 * @param duration The duration to format
	 * @param showUnit (optional) If the unit shall be displayed, set this to true (default)
	 */
	 'durationFormat' : function(duration, showUnit) {
		if(duration < 60) {
		  multiplier = 1;
		  unitLangId = 'SECOND';
		} else if(duration < 3600) {
		  multiplier = 60;
		  unitLangId = 'MINUTE';
		} else if(duration < 86400) {
		  multiplier = 3600;
		  unitLangId = 'HOUR';
		} else {
		  multiplier = 86400;
		  unitLangId = 'DAY';
		}
		
		durationString = this.numberFormat(duration / multiplier, 1);
		if(durationString.indexOf(this.wordTable['DECIMAL_POINT']) != -1) { // If we have a fractionated number
			durationString = durationString.replace(/0+$/, '');						// Trim right zeroes
			if(durationString.substr(durationString.length - 1, 1) == this.wordTable['DECIMAL_POINT']) durationString = durationString.substr(0, durationString.length - 1);  // If, after trimming zeroes, the decimal point is the end of the string, remove it as well
		}
		return(durationString + (showUnit ? ' ' + this.pluralize(Math.round(duration / multiplier * 10) / 10, unitLangId) : ''));
	},
	
	/**
	  * Function to pluralize a given language object
	  *
	  * @param theNumber The number that we are seeking the plural form for
	  * @param langObjId The language object ID. This must refer to an array of objects inside this internationalization classes word table
	  */
	'pluralize' : function(theNumber, langObjId) {
		if(theNumber != 1) return(this.wordTable[langObjId][1]); // In german, everything with a count of 2 or more uses the plural
		return(this.wordTable[langObjId][0]);			// Otherwise return the singular
	},
	
	/**
	  * Returns a specific string
	  * In contrast to the PHP I18N function, this function is used rarely, only when JS strings have wildcards that must be replaced. Usually, the variables are accessed directly through the word table.
          *
	  * @param varName The variable name of the string
	  * @param params A number indexed array of values. The wildcard {0} in the string is replaced with the value at index 0 etc. If the array is empty, nothing is changed
	  */
	'getSpecificString' : function(varName, params) {
		var varVal = this.wordTable[varName];
		if(typeof(varVal) == 'undefined') return(varName);
		if(typeof(params) != 'undefined' && typeof(params.length) != 'undefined') {
			for(var i = 0, len = params.length; i < len; ++i) {
				var replacer = new RegExp('\\{' + String(i) + '\\}', 'g');
				varVal = varVal.replace(replacer, params[i]);
			}
		}
		return(varVal);
	}


}