Welcome Guest, Not a member yet? Register   Sign In
Translate database
#1

[eluser]Gerep[/eluser]
Hi fellas,

I have found this code to show database error messages:
Code:
$data = array('name' => 'John', 'email' => '[email protected]');
$str = $this->db->insert_string('customers', $data);

// returns null if SQL error occurs.
$res = $this->db->query($str);

if (!$res) {
  // if query returns null
  $msg = $this->db->_error_message();
  $num = $this->db->_error_number();

  $data['msg'] = "Error(".$num.") ".$msg;
  $this->load->view('customers_edit_view',$data);
}

It is working perfectly but its showing the error in English, is there a way to translate this message?

Thanks in advance.
#2

[eluser]InsiteFX[/eluser]
Use CI Language Class!

InsiteFX
#3

[eluser]Gerep[/eluser]
Hi Insite

The Language Class do not have the string for all errors

For instance, the error for duplicate ID.

Is it possible to translate those messages without the language class?
#4

[eluser]InsiteFX[/eluser]
Check the language files in system/language/en/db_lang.php

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB