diff --git a/locale/it.json b/locale/it.json index 8b889ea7..694a0f05 100644 --- a/locale/it.json +++ b/locale/it.json @@ -1,26 +1,35 @@ { "Add Picture": "Aggiungi immagine", "Browse": "Sfoglia", - "Cancel": "Cancella", + "Cancel": "Annulla", + "Category": "Categoria", "Confirm": "Conferma", "Confirm password": "Conferma password", "Content": "Contenuto", - "Content List": "Lista dei contenuti", "Create Content": "Crea nuovo contenuto", + "Confirm e-mail address": "Conferma indirizzo e-mail", + "Content List": "Lista dei contenuti", "Create new account": "Crea un nuovo account", "Current password": "Password attuale", "Dashboard": "Cruscotto", + "Day": "Giorno", + "Delete": "Elimina", "Edit": "Edita", "E-mail address": "Indirizzo email", "E-mail new password": "Spedisci via email la nuova password", "Enter your current password to change the E-mail address or Password.": "Inserisci la tua password attuale per modificare l'indirizzo email o la password.", + "From": "Da", "Getting Started Guide": "Guida introduttiva", "History": "Storico", + "Hour": "Ora", "Logging out": "In uscita", "Login": "Accedi", "Logout": "Esci", "Member since": "Membro da", - "My account": "Il mio profilo", + "Message": "Messaggio", + "Minute": "Minuti", + "Month": "Mese", + "My Account": "Il mio profilo", "Not Found": "Non trovato", "OK": "OK", "Password": "Password", @@ -32,19 +41,29 @@ "Registration complete, check your e-mail inbox to verify the account.": "Registrazione completata, controlla la tua casella email per la successiva verifica del tuo account.", "Registration complete, waiting for administrator approval.": "Registrazione completata, attendi l'approvazione dell'amministratore del sito.", "Request new password": "Richiedi una nuova password", + "Results": "Risultati", "Save": "Salva", + "Send message": "Invia messaggio", + "Send yourself a copy?": "Invia una copia a te stesso.", "Sorry, the page you requested was not found.": "Spiacente, la pagina richiesta non รจ stata trovata.", - "Spaces are allowed; punctuation is not allowed except for periods, hyphens, apostrophes, and underscores": "Sono ammessi i caratteri di spazio, punto, apostrofo, trattino, underscore (trattino basso)", + "Spaces are allowed; punctuation is not allowed except for periods, hyphens, apostrophes, and underscores.": "Sono ammessi i caratteri di spazio, punto, apostrofo, trattino, underscore (trattino basso)", + "Subject": "Oggetto", "Support": "Supporto", + "Take Photo": "Scatta", "Taxonomy": "Tassonomia", "The open source application development kit for Drupal!": "Il kit open source per lo sviluppo di applicazioni per Drupal!", "The Username or e-mail address field is required": "Il nome utente oppure l'indirizzo email sono obbligatori", + "Title": "Titolo", + "To": "A", "To change the current user password, enter the new password in both fields.": "Per modificare la password attuale, inserire quella nuova in ambedue i campi.", "Username": "Nome utente", "Username or e-mail address": "Nome utente od indirizzo email", "Users": "Utenti", "View": "Vista", "Vocabularies": "Vocabolari", + "Year": "Anno", + "Your e-mail address": "Il tuo indirizzo e-mail", + "Your name": "Il tuo nome", "Welcome to DrupalGap": "Benvenuti in DrupalGap", "Wrong username or password": "Nome utente o password errati" } diff --git a/src/includes/form.elements.inc.js b/src/includes/form.elements.inc.js index a21b2430..4557f624 100644 --- a/src/includes/form.elements.inc.js +++ b/src/includes/form.elements.inc.js @@ -227,7 +227,7 @@ function _drupalgap_form_render_element(form, element) { // Grab the language. var language = language_default(); - + // We'll assume the element has no items (e.g. title, nid, vid, etc), unless // we determine later that this element is a field, then it'll have items. var items = false; @@ -346,6 +346,10 @@ function _drupalgap_form_render_element(form, element) { delta, element ]); + // hook above may change item.value (see date.js), so put again in variables + if (typeof item.value !== 'undefined') { + variables.attributes.value = item.value; + } // @TODO - sometimes an item gets merged without a type here, why? // @UPDATE - did the recursive extend fix this? item = $.extend(true, item, items[delta]); diff --git a/src/includes/form.inc.js b/src/includes/form.inc.js index daa0b3b8..a9a6463e 100644 --- a/src/includes/form.inc.js +++ b/src/includes/form.inc.js @@ -295,6 +295,11 @@ function drupalgap_form_load(form_id) { // figure out how to handle the 'add another // item' feature. } + + language = language_default(); + if (!form.elements[name][language]) + if (form.elements[name].und) { language = 'und'; } + // Initialize the item collections language code if it hasn't been. if (!form.elements[name][language]) { form.elements[name][language] = {}; diff --git a/src/includes/form.submission.inc.js b/src/includes/form.submission.inc.js index e5a8e0a1..e047ae23 100644 --- a/src/includes/form.submission.inc.js +++ b/src/includes/form.submission.inc.js @@ -124,6 +124,7 @@ function _drupalgap_form_submit(form_id) { */ function _drupalgap_form_validate(form, form_state) { try { + var lng; for (var name in form.elements) { if (!form.elements.hasOwnProperty(name)) { continue; } var element = form.elements[name]; @@ -131,8 +132,16 @@ function _drupalgap_form_validate(form, form_state) { if (element.required) { var valid = true; var value = null; + + if (element.und) { + lng = 'und' + } + else { + lng = language_default(); + } + if (element.is_field) { - value = form_state.values[name][language_default()][0]; + value = form_state.values[name][lng /*language_default()*/][0]; } else { value = form_state.values[name]; } // Check for empty values. @@ -173,13 +182,21 @@ function _drupalgap_form_validate(form, form_state) { */ function drupalgap_form_state_values_assemble(form) { try { - var lng = language_default(); + var lng; // = language_default(); var form_state = { values: {} }; for (var name in form.elements) { if (!form.elements.hasOwnProperty(name)) { continue; } var element = form.elements[name]; if (name == 'submit') { continue; } // Always skip the form 'submit'. var id = null; + + if (element.und) { + lng = 'und' + } + else { + lng = language_default(); + } + if (element.is_field) { form_state.values[name] = {}; form_state.values[name][lng] = {}; diff --git a/src/modules/entity/entity.js b/src/modules/entity/entity.js index 74da69bf..06a5858d 100644 --- a/src/modules/entity/entity.js +++ b/src/modules/entity/entity.js @@ -376,6 +376,13 @@ function drupalgap_entity_build_from_form_state(form, form_state) { if (!function_exists(hook)) { hook = false; } } + if (form.elements[name].und) { + language = 'und' + } + else { + language = language_default(); + } + // Retrieve the potential key for the element, if we don't get one // then it is a flat field that should be attached as a property to the // entity. Otherwise attach the key and value to the entity. diff --git a/src/modules/field/field.js b/src/modules/field/field.js index 62993560..f90ab12b 100644 --- a/src/modules/field/field.js +++ b/src/modules/field/field.js @@ -127,6 +127,7 @@ function drupalgap_field_info_instances_add_to_form(entity_type, bundle, required: field.required, description: field.description }; + var default_value = field.default_value; var cardinality = parseInt(field_info.cardinality); if (cardinality == -1) {