Implement gettext for strings inside the controllers
This commit is contained in:
@@ -37,8 +37,8 @@ class Auth extends CI_Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// validate form input
|
// validate form input
|
||||||
$this->form_validation->set_rules('username', "Benutzername", 'required');
|
$this->form_validation->set_rules('username', _('Username'), 'required');
|
||||||
$this->form_validation->set_rules('password', "Passwort", 'required');
|
$this->form_validation->set_rules('password', _('Password'), 'required');
|
||||||
|
|
||||||
if ($this->form_validation->run() == true) {
|
if ($this->form_validation->run() == true) {
|
||||||
// check for "remember me"
|
// check for "remember me"
|
||||||
@@ -77,11 +77,12 @@ class Auth extends CI_Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// validate form input
|
// validate form input
|
||||||
$this->form_validation->set_rules('username', "Username", 'required');
|
$this->form_validation->set_rules('username', _('Username'), 'required');
|
||||||
$this->form_validation->set_rules('realname', "Realname", 'required');
|
$this->form_validation->set_rules('realname', _('Real name'), 'required');
|
||||||
$this->form_validation->set_rules('email', "Email address", 'required|valid_email');
|
$this->form_validation->set_rules('lastname', _('Last name'), 'required');
|
||||||
$this->form_validation->set_rules('password', "Password", 'required|min_length[' . $this->config->item('min_password_length', 'access') . ']|max_length[' . $this->config->item('max_password_length', 'access') . ']|matches[password_confirm]');
|
$this->form_validation->set_rules('email', _('eMail address'), 'required|valid_email');
|
||||||
$this->form_validation->set_rules('password_confirm', "Password confirmation", 'required');
|
$this->form_validation->set_rules('password', _('Password'), 'required|min_length[' . $this->config->item('min_password_length', 'access') . ']|max_length[' . $this->config->item('max_password_length', 'access') . ']|matches[password_confirm]');
|
||||||
|
$this->form_validation->set_rules('password_confirm', _('Password confirmation'), 'required');
|
||||||
|
|
||||||
if ($this->form_validation->run() == true) {
|
if ($this->form_validation->run() == true) {
|
||||||
$username = $this->input->post('username');
|
$username = $this->input->post('username');
|
||||||
@@ -95,7 +96,7 @@ class Auth extends CI_Controller {
|
|||||||
|
|
||||||
if ($this->form_validation->run() == true && $this->access->register($username, $password, $email, $additional_data)) {
|
if ($this->form_validation->run() == true && $this->access->register($username, $password, $email, $additional_data)) {
|
||||||
// redirect them to the login page
|
// redirect them to the login page
|
||||||
$this->session->set_flashdata('message', "Registration successful");
|
$this->session->set_flashdata('message', _('Registration successful'));
|
||||||
redirect('auth/register_success');
|
redirect('auth/register_success');
|
||||||
} else {
|
} else {
|
||||||
// set the flash data error message if there is one
|
// set the flash data error message if there is one
|
||||||
@@ -118,7 +119,7 @@ class Auth extends CI_Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// validate the form
|
// validate the form
|
||||||
$this->form_validation->set_rules('new_password', 'New Password', 'min_length[' . $this->config->item('min_password_length', 'auth') . ']|max_length[' . $this->config->item('max_password_length', 'access') . ']|matches[new_password_confirm]');
|
$this->form_validation->set_rules('new_password', _('New password'), 'min_length[' . $this->config->item('min_password_length', 'auth') . ']|max_length[' . $this->config->item('max_password_length', 'access') . ']|matches[new_password_confirm]');
|
||||||
|
|
||||||
if ($this->form_validation->run() == true) {
|
if ($this->form_validation->run() == true) {
|
||||||
// change password if needed
|
// change password if needed
|
||||||
@@ -158,7 +159,7 @@ class Auth extends CI_Controller {
|
|||||||
* Allows users to request a new password.
|
* Allows users to request a new password.
|
||||||
*/
|
*/
|
||||||
public function forgot_password() {
|
public function forgot_password() {
|
||||||
$this->form_validation->set_rules('email', 'Email Address', 'required');
|
$this->form_validation->set_rules('email', _('eMail address'), 'required');
|
||||||
if ($this->form_validation->run() == false) {
|
if ($this->form_validation->run() == false) {
|
||||||
//setup the input
|
//setup the input
|
||||||
$this->data['email'] = array('name' => 'email',
|
$this->data['email'] = array('name' => 'email',
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ class Projects extends CI_Controller {
|
|||||||
$this->messages->add($projectpath, 'notice');
|
$this->messages->add($projectpath, 'notice');
|
||||||
redirect('/projects/detail/' . $data['project_id'], 301);
|
redirect('/projects/detail/' . $data['project_id'], 301);
|
||||||
} else {
|
} else {
|
||||||
$this->messages->add('Das Projekt konnte nicht gespeichert werden.', 'error');
|
$this->messages->add(_('The project could not be created.'), 'error');
|
||||||
$this->load->view('project/new');
|
$this->load->view('project/new');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -148,7 +148,7 @@ class Projects extends CI_Controller {
|
|||||||
public function detail($prj_id) {
|
public function detail($prj_id) {
|
||||||
$project = $this->project->getById($prj_id);
|
$project = $this->project->getById($prj_id);
|
||||||
if (!$project) {
|
if (!$project) {
|
||||||
$this->messages->add('Das Projekt konnte nicht geladen werden.', 'error');
|
$this->messages->add(_('The project could not be loaded.'), 'error');
|
||||||
redirect('projects', 301);
|
redirect('projects', 301);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,7 +169,7 @@ class Projects extends CI_Controller {
|
|||||||
public function delete($projectId) {
|
public function delete($projectId) {
|
||||||
$this->project->delete($projectId);
|
$this->project->delete($projectId);
|
||||||
$this->session->unset_userdata('active_project');
|
$this->session->unset_userdata('active_project');
|
||||||
$this->messages->add("Das Projekt wurde gelöscht.", 'notice');
|
$this->messages->add(_('The project was deleted.'), 'success');
|
||||||
redirect('projects');
|
redirect('projects');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,9 +41,9 @@ class Settings extends CI_Controller {
|
|||||||
public function index() {
|
public function index() {
|
||||||
$profile = $this->user->profile();
|
$profile = $this->user->profile();
|
||||||
$profile_fields = array(
|
$profile_fields = array(
|
||||||
array('firstname', 'Vorname', 'text'),
|
array('firstname', _('First name'), 'text'),
|
||||||
array('lastname', 'Nachname', 'text'),
|
array('lastname', _('Last name'), 'text'),
|
||||||
array('intitution', 'Institution', 'text'),
|
array('intitution', _('Institution'), 'text'),
|
||||||
);
|
);
|
||||||
$tpl['profile'] = $profile;
|
$tpl['profile'] = $profile;
|
||||||
$tpl['profile_fields'] = $profile_fields;
|
$tpl['profile_fields'] = $profile_fields;
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ class Trials extends CI_Controller {
|
|||||||
|
|
||||||
redirect('/trial/detail/' . $result, 'refresh');
|
redirect('/trial/detail/' . $result, 'refresh');
|
||||||
} else {
|
} else {
|
||||||
$this->messages->add('Der Versuch konnte nicht gespeichert werden.', 'error');
|
$this->messages->add(_('The trial could not be created.'), 'error');
|
||||||
$this->load->view('trial/new', $tpl);
|
$this->load->view('trial/new', $tpl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user