Skip to content

Commit

Permalink
Merge pull request chriskacerguis#183 from burakerdem/master
Browse files Browse the repository at this point in the history
Fixed sample code at multilingual support section.
  • Loading branch information
Phil Sturgeon committed Jan 23, 2013
2 parents af239ad + ba40e83 commit bb59816
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,19 @@ If you don't specify a response code, and the data you respond with `== FALSE` (

## Multilingual Support

If your application uses language files to support multiple locales, `REST_Controller` will automatically parse the HTTP `Accept-Language` header and provide the language(s) in your actions. This information can be found in the `$this->request->lang` object:
If your application uses language files to support multiple locales, `REST_Controller` will automatically parse the HTTP `Accept-Language` header and provide the language(s) in your actions. This information can be found in the `$this->response->lang` object:

public function __construct()
{
parent::__construct();

if (is_array($this->request->lang))
if (is_array($this->response->lang))
{
$this->load->language('application', $this->request->lang[0]);
$this->load->language('application', $this->response->lang[0]);
}
else
{
$this->load->language('application', $this->request->lang);
$this->load->language('application', $this->response->lang);
}
}

Expand Down Expand Up @@ -220,4 +220,4 @@ features for this as I no longer require it, but I will continue to maintain pul
fix issues as and when they are reported (within a week or two).

Pull Requests are the best way to fix bugs or add features. I know loads of you use this, so please
contribute if you have improvements to be made and I'll keep releasing versions over time.
contribute if you have improvements to be made and I'll keep releasing versions over time.

0 comments on commit bb59816

Please sign in to comment.