Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add example for show auto load language and manual language
- Loading branch information
Showing
3 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); | ||
|
||
class I18nauto extends CI_Controller{ | ||
|
||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
$this -> load -> library('i18n'); | ||
} | ||
|
||
public function index(){ | ||
$this -> load -> view('i18ntest'); | ||
} | ||
|
||
} | ||
|
||
/* End of file i18nauto.php */ | ||
/* Location: ./application/controller/i18nauto.php */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); | ||
|
||
class I18nmanual extends CI_Controller{ | ||
|
||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
$this -> load -> library('i18n'); | ||
$this -> i18n -> prevent_auto(); | ||
} | ||
|
||
public function index(){ | ||
$this -> i18n -> set_current_locale('zh-TW'); | ||
$this -> i18n -> load_language(); | ||
$this -> load -> view('i18ntest'); | ||
} | ||
|
||
} | ||
|
||
/* End of file i18nmanual.php */ | ||
/* Location: ./application/controller/i18nmanual.php */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<html> | ||
<head> | ||
<title><?php echo $this->lang->line('site_name'); ?></title> | ||
</head> | ||
<body> | ||
<?php echo $this->lang->line('message'); ?> | ||
</body> | ||
</html> |