﻿// Localization for wForms - a javascript extension to web forms.
// Spanish v2.0 - July 18th 2006
// Thanks to Pablo Daz (http://www.onetune.com) and Jorge Mesa
// This software is licensed under the CC-GNU LGPL <http://creativecommons.org/licenses/LGPL/2.1/>

// See http://formassembly.com/blog/how-to-localize-wforms/
// This must be included *AFTER* wforms.js 
// Example: 
// <head>...
// <script type="text/javascript" src="wforms.js" ></script>
// <script type="text/javascript" src="localization-spanish.js" ></script>
// </head>

// Error messages. This may be overwritten in a separate js file for localization or customization purposes.
if (lang == "es") {
	wFORMS.behaviors['validation'].errMsg_required 		= "Campo obligatorio.";
	wFORMS.behaviors['validation'].errMsg_alpha 				= "Introduzca solo carácteres alfabéticos [a-z, A-Z]. No se permiten números";
	wFORMS.behaviors['validation'].errMsg_email 				= "Introduzca una dirección de email válida";
	wFORMS.behaviors['validation'].errMsg_integer 			= "Introduzca un número entero.";
	wFORMS.behaviors['validation'].errMsg_float 				= "Introduzca un número.";
	wFORMS.behaviors['validation'].errMsg_password 		= "Contraseña insegura. Introduzca una contraseña entre 4 y 12 caracteres y combine letras mayúsculas y minúsculas.";
	wFORMS.behaviors['validation'].errMsg_alphanum 		= "Introduzca solo carácteres alfanuméricos [a-z 0-9].";
	wFORMS.behaviors['validation'].errMsg_date 				= "Introduzca una fecha válida.";
	wFORMS.behaviors['validation'].errMsg_notification = "Han sido detectados: %% error(es).\rPor favor, revise la información introducida:\r";
	wFORMS.behaviors['validation'].errMsg_custom				= "Introduzca un valor válido.";
}
else {
	wFORMS.behaviors['validation'].errMsg_required			= "This field is required. ";
	wFORMS.behaviors['validation'].errMsg_alpha 				= "Please use alphabetic characters only (a-z, A-Z). Numbers are not allowed.";
	wFORMS.behaviors['validation'].errMsg_email 				= "Please enter a valid email address.";
	wFORMS.behaviors['validation'].errMsg_integer 			= "Please enter an integer.";
	wFORMS.behaviors['validation'].errMsg_float 				= "Please enter a number.";
	wFORMS.behaviors['validation'].errMsg_password		 	= "Unsafe password. Your password should be between 4 and 12 characters long and use a combination of upper-case and lower-case letters.";
	wFORMS.behaviors['validation'].errMsg_alphanum 		= "Please use alpha-numeric characters only [a-z 0-9].";
	wFORMS.behaviors['validation'].errMsg_date 				= "Please enter a valid date.";
	wFORMS.behaviors['validation'].errMsg_notification = "%% error(s) have been detected.\nPlease check the information you provided."; // %% will be replaced by the actual number of errors.
	wFORMS.behaviors['validation'].errMsg_custom				= "Please enter a valid value.";
}

			
/*wf.arrMsg[0] = "Aadir una fila"; // repeat row
wf.arrMsg[1] = "Repite el campo o grupo anterior." // repeat row title 
wf.arrMsg[2] = "Eliminar"; // remove row
wf.arrMsg[3] = "Borra el campo o grupo anterior." // remove row title
wf.arrMsg[4] = "Pgina siguiente";
wf.arrMsg[5] = "Pgina anterior";*/

// Alpha-Numeric Input Validation: 
wf.isAlpha = function(s) {
	var reg = /^[\u0041-\u007A\u00C0-\u00FF\u0100\u017F]+$/; 
	return this.isEmpty(s) || reg.test(s);
}

wf.isAlphaNum = function(s) {
	var reg = /^[\u0030-\u0039\u0041-\u007A\u00C0-\u00FF\u0100\u017F]+$/;
	return this.isEmpty(s) || reg.test(s);
}
// Unicode ranges (from http://www.unicode.org/) :
// \u0030-\u0039 : Numbers 0-9
// \u0041-\u007A : Basic Latin : For english, and ASCII only strings (ex: username, password, ..)
// \u00C0-\u00FF : Latin-1 : For Danish, Dutch, Faroese, Finnish, Flemish, German, Icelandic, Irish, Italian, Norwegian, Portuguese, Spanish, and Swedish.
// \u0100\u017F : Latin Extended-A (to be used with Basic Latin and Latin-1) : Afrikaans, Basque, Breton, Catalan, Croatian, Czech, Esperanto, Estonian, French, Frisian, Greenlandic, Hungarian, Latin, Latvian, Lithuanian, Maltese, Polish, Provenal, Rhaeto-Romanic, Romanian, Romany, Sami, Slovak, Slovenian, Sorbian, Turkish, Welsh, and many others.
// \u0180\u024F : Latin Extended-B (to be used with Basic Latin and Latin-1) : ?
// \u1E00\u1EFF : Latin Extended Additional : Vietnamese ?
// \u0370-\u03FF : Greek
// \u0400-\u04FF : Cyrillic : Russian, etc..
// \u0590\u05FF : Hebrew (and #FB1D - #FB4F ?)
// \u0600\u06FF : Arabic
// \u0900\u097F : Devanagari : Hindi, etc..
// \u4E00\u9FFF : Han - common ideographs : Chinese, Japanese, and Korean languages.
// See http://www.unicode.org/charts/ for other languages
