⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

is posible change the message when insert a data?



carlinchisart

carlinchisart
  • profile picture
  • Member

Posted 14 April 2012 - 17:12 PM

Hi all!!

i have to change the message generate for grocery when insert data, but no is the mesagge 'insert_success_message' im talk the this message


<textarea>{"success":true,"insert_primary_key":0,"success_message":"<p>Los datos fueron insertados correctamente en la Base de datos. <a href='http:\/\/diateccolombia.com\/promocionTIC\/index.php\/institucion\/otrasAccion\/cargarPoliza\/edit\/0'>Editar Poliza<\/a> o <a href='http:\/\/diateccolombia.com\/promocionTIC\/index.php\/institucion\/otrasAccion\/cargarPoliza'>Regresar a la lista<\/a><\/p>"}</textarea>


this message are create if i disable javascript function, my problem is the language, is posible translate?

this is becouse i developed one aplication for a people with visual disabilities, so when insert data they listend the message.

i think the same process is when update or delete data, but in this accion in this moment i don't know.

web-johnny

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 14 April 2012 - 20:19 PM

http://www.grocerycrud.com/examples/multilingual_functionality and http://www.grocerycrud.com/documentation/options_functions/set_lang_string will help you.

dblanco

dblanco
  • profile picture
  • Member

Posted 13 December 2012 - 23:03 PM

A similar case. Why not shown in this case to give false user control the new message 'insert_error'?

$this->grocery_crud->callback_before_insert(array($this,'_prepara_datos_agregar')); // antes dar alta

public function _prepara_datos_agregar($post_array) {
$usuario = $post_array['usuario'];
$existe_usuario = $this->usuarios_model->_existe_usuario_por_usuario($usuario);
if ($existe_usuario) {
$this->grocery_crud->set_lang_string('insert_error', 'El usuario ('.$usuario.') que intenta agregar ya existe.');
return FALSE;
}

return $post_array;
}

Thanks