I have internationalized application, and I would like to know how I
can
add a picture "flag" to each language as I can do to make
is seen in an array as an example of http://book.cakephp.org

config/bootstrap.php
<?php
Configure::write('Config.language', 'spa');

Configure::write('Config.languages', array(
    'spa' => __('Spanish', true),
    'cat' => __('Catalan', true),
    'eng' => __('English', true),
    'ger' => __('German', true),
    'fre' => __('French', true),
    'ita' => __('Italian', true)
));

views/layauts/default.ctp
  <?php
                $links = array();
                $currentLanguage = Configure::read('Config.language');
                foreach (Configure::read('Config.languages') as $code
=> $language) {
                    if ($code == $currentLanguage) {
                        $links[] = $language;
                    } else {
                        $links[] = $this->Html->link($language,
array('lang' => $code));
                    }
                }
                echo implode(' - ', $links);
                ?>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to