Add internationalization to jobs controller

This commit is contained in:
Karsten Heiken
2011-04-22 03:12:09 +02:00
parent 43007a3c49
commit d750a029bb
3 changed files with 30 additions and 3 deletions

View File

@@ -2,6 +2,19 @@
class Jobs extends CI_Controller {
/**
* Constructor.
*/
public function __construct() {
parent::__construct();
// load language file
$this->lang->load(strtolower($this->router->class));
}
/**
* Get jobs belonging to projects owned by the user.
*/
public function getOwn() {
$query = $this->db->order_by('progress', 'desc')
->get_where('jobs', array('started_by' => $this->session->userdata('user_id')));
@@ -14,10 +27,10 @@ class Jobs extends CI_Controller {
switch($progress) {
case -1:
$progress = "Warte auf Start...";
$progress = lang('waiting');
break;
case 100:
$progress = "Fertig";
$progress = lang('done');
break;
default:
$progress = $progress . "%";

View File

@@ -0,0 +1,7 @@
<?php
$lang['done'] = "Complete";
$lang['waiting'] = "Waiting for start...";
/* End of file projects_lang.php */
/* Location: ./application/language/english/jobs_lang.php */

View File

@@ -0,0 +1,7 @@
<?php
$lang['done'] = "Fertig";
$lang['waiting'] = "Warte auf Start...";
/* End of file projects_lang.php */
/* Location: ./application/language/german/jobs_lang.php */