[Solar-talk] I18N question

Alex Stoneham astoneham at yahoo.com
Mon Jan 21 12:11:28 CST 2008


Yup, I think that covers it Selecting locals, informing browsers and persisting in a varcharset.

Ta!
(Dropping and rebuilding dbs now)

----- Original Message ----
From: Antti Holvikari <anttih at gmail.com>
To: solar-talk at lists.solarphp.com
Sent: Monday, January 21, 2008 9:41:11 AM
Subject: Re: [Solar-talk] I18N question


On Jan 21, 2008 7:29 PM, Tobias Nix <tobias.nix at paupau.org> wrote:
> Hello,
>
>
> Do not know, but you can set a language like this:
>
> Solar::start('config.php');
>
> Solar_Registry::get('locale')->setCode('de_DE');

You can also set this in config file with

$config['Solar_Locale']['code'] = 'de_DE';

> > How does Solar choose a local file to display, is it based of the
 request
> > headers of the browser?

Solar doesn't auto-detect locale from request headers. You need to set
the content-type in a meta tag so that the clients browser knows what
encoding to use.

So to generate this:

<meta http-equiv="Content-Type" content="charset=utf-8" />

...you can do this for example in your _head layout template:

        // set encoding to UTF-8
        $this->layout_head['meta'][] = array(
            'http-equiv' => 'Content-Type',
            'content'    => 'charset=utf-8',
        );

Ofcourse, you can just paste that to your code if you don't want to
use the layout_head variable for this :-D

Ps. remember to tell your database to use UTF-8 as it's encoding when
you make queries.

Hope that helps.

-- 
Antti Holvikari
_______________________________________________
Solar-talk mailing list
Solar-talk at lists.solarphp.com
http://mailman-mail3.webfaction.com/listinfo/solar-talk






      ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman-mail3.webfaction.com/pipermail/solar-talk/attachments/20080121/20095fc5/attachment.html


More information about the Solar-talk mailing list