Try the Demo

Magento Forum

   
How do I change language drop down into languages flags ?
 
dets03ab
Member
 
Total Posts:  65
Joined:  2008-06-14
 

How do I change language drop down into languages flags ?

What file(s) should i start with?

What should I change in the file(s)?

I am a newbie so please let me know smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
dets03ab
Member
 
Total Posts:  65
Joined:  2008-06-14
 

i am looking for a solution like oscommerce normally make it automatically - anyone know how i can make it???

 
Magento Community Magento Community
Magento Community
Magento Community
 
dets03ab
Member
 
Total Posts:  65
Joined:  2008-06-14
 

this is in my opinions one of the most important issues in a web shop - to be global by being local - but how can I display flags instead of non-appearing drop down menu? like oscommerce automatically make it. The current drop down menu is non-appearing and this might cause a huge amount of vistors to leave the site as they enter if they dont find their local language fast.......noone know how to do this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
J.T.
Mentor
 
Avatar
Total Posts:  1961
Joined:  2008-08-07
London-ish, UK
 

Flag relate to countries. They are not necessarily tied to languages. IMO it’s bad design/usability to use flags for countries. You are making assumptions which can cause problems.

Does a Canadian flag allow for both English and French?
Does a Belgian flag allow for Vlamish and French?
Does a Swiss flag allow for the 4 or 5 languages they speak there?

No!

Why link two things which aren’t actually tightly related?

 Signature 

It takes two to tango, so don’t blame Magento right away if things go tits-up!

Mage Quick FAQ
Q. Installation problems with localhost/xamp/wamp/whatever and/or missing php extensions, help!
A. Get Zend Server - Community Edition is free and will make things a lot easier on you now and when deploying to production

 
Magento Community Magento Community
Magento Community
Magento Community
 
Pipuks
Jr. Member
 
Total Posts:  12
Joined:  2008-09-03
 
J.T. - 28 August 2008 05:17 AM

Flag relate to countries. They are not necessarily tied to languages. IMO it’s bad design/usability to use flags for countries. You are making assumptions which can cause problems.

Does a Canadian flag allow for both English and French?
Does a Belgian flag allow for Vlamish and French?
Does a Swiss flag allow for the 4 or 5 languages they speak there?

No!

Why link two things which aren’t actually tightly related?

There are still countries where majority speak one language. And sometimes it is necessary to tie stuff (terms and conditions, contact information, shipping options) to country not to language.

 
Magento Community Magento Community
Magento Community
Magento Community
 
artbussy
Jr. Member
 
Total Posts:  22
Joined:  2008-08-27
 

No one?

There are still enough French speaking Belgians or even English speaking Dutch citizens who perfectly assiociate a flag with their prefered language.

 
Magento Community Magento Community
Magento Community
Magento Community
 
TemplatesMaster
Sr. Member
 
Avatar
Total Posts:  299
Joined:  2008-04-01
Switzerland
 

This code worked for me before but i have not tested it with last 1.2 version. Please edit app/design/frontend/default/yourtemplate/template/page/switch/flags.html to

<?php if(count($this->getStores())>1): ?>
<div class="language-switcher">
    
<?php foreach ($this->getStores() as $_lang): ?>
        
<a href="<?php echo $_lang->getCurrentUrl() ?>"><img
src
="<?php echo $this->getSkinUrl('images/flag_' . $this->htmlEscape($_lang->getName()) . '.gif') ?>" 
alt="<?php echo $this->htmlEscape($_lang->getName()) ?>"/></a>
    
<?php endforeach; ?>
</div>
<?php endif; ?>
Also you should check your page.xml from
<block type="page/switch" name="store_language" as="store_language" template="page/switch/languages.phtml"/>
to
<block type="page/switch" name="store_language" as="store_language" template="page/switch/flags.phtml"/>
Also please don’t forget to add corresponding flags to your skin/image directory

 Signature 

SEO optimized Magento Templates & most powerful Magento Extensions by Templates-Master.

Android and iPhone theme for Magento — Mobile Star

Join us on Facebook and get one time 10% OFF on our products!

 
Magento Community Magento Community
Magento Community
Magento Community
 
niknik
Member
 
Total Posts:  32
Joined:  2008-10-17
 

Thanks for the tip, I got it working just right… except for a minor inconvenient.

When the language names have accented chars, like “ç”, “ê”, etc. the image url gets encoded, and -strangely enough- the images with those encoded names stopped working (maybe it is just the way my server is configured, but...)

I solved the issue by changing the image URL from:

$this->htmlEscape($_lang->getName()) . '.gif')
to
$this->htmlEscape($_lang->getCode()) . '.gif')

Using the getCode instead of the getName allowed me to get the “clean” storeview code name that I was able to use for the icon filenames.

Just to share my experience, maybe it might help someone else…

 
Magento Community Magento Community
Magento Community
Magento Community
 
sApO_sUicIdA
Jr. Member
 
Total Posts:  12
Joined:  2009-01-30
Alfragide
 
TemplatesMaster - 13 January 2009 05:42 PM

<?php if(count($this->getStores())>1): ?>
<div class="language-switcher">
    
<?php foreach ($this->getStores() as $_lang): ?>
        
<a href="<?php echo $_lang->getCurrentUrl() ?>"><img
src
="<?php echo $this->getSkinUrl('images/flag_' . $this->htmlEscape($_lang->getName()) . '.gif') ?>" 
alt="<?php echo $this->htmlEscape($_lang->getName()) ?>"/></a>
    
<?php endforeach; ?>
</div>
<?php endif; ?>

The flags didn’t show, so I add to change the image link code from:

<?php echo $this->getSkinUrl('images/flag_' $this->htmlEscape($_lang->getName()) . '.gif'?>
to:
<?php echo $this->getSkinUrl('images/flag_'.$_lang->getCode().'.gif'?>
Tested on 1.3.1 :D

I also would like to change the flag image of the selected language. Any ideas how?!

tkx in advance

 
Magento Community Magento Community
Magento Community
Magento Community
 
hugosnel
Member
 
Total Posts:  39
Joined:  2008-11-05
Gard, France
 

I am also a newbe, so please forgive me:
I have aquired a template , istalled it and all is working.
So far so good, now I am toutching the real stuff (starting).
Standard the laguage switchs is ok:
<img src="http://www.sambal-toko.com/skin/frontend/blank/theme075/images/flag_english.gif" />
BUT when i add a french store I get:
<img src="http://www.sambal-toko.com/skin/frontend/blank/default/images/flag_french.gif" />
SO the skin theme is not taken into account.
Where do I adapt??
TIA

 
Magento Community Magento Community
Magento Community
Magento Community
 
hugosnel
Member
 
Total Posts:  39
Joined:  2008-11-05
Gard, France
 

I have noticed that the switch/flags.html and switch/languages.html are both in the default
app/design/frontend/blank/theme075/template/page/switch
but I cannot find switch/languages.htm in the theme075 ..

 
Magento Community Magento Community
Magento Community
Magento Community
 
MagentoXperten
Jr. Member
 
Total Posts:  16
Joined:  2009-09-23
 

I guys,

I have done exactly what you say but it dosent work! i have 1.4 version. Se the site her http://funkyskins.intetnet.dk/

What can i have done wrong?

I edited flags.phtml and page.xml ?

Please help !

Dear regards
Kristoffer

 Signature 

MagentoXperten.dk - Professionelle Magento webshops til fornuftige priser smile

Vh
Kristoffer Hjerrild

 
Magento Community Magento Community
Magento Community
Magento Community
 
Apostolache Alin
Jr. Member
 
Total Posts:  1
Joined:  2010-05-15
 

Hi,

Same thing happened to me. I just changed back flags.phtml to languages.phtml and page.xml and it works fine.

Anyway, thanks a lot for this solution!

 
Magento Community Magento Community
Magento Community
Magento Community
 
sunil rajput
Jr. Member
 
Total Posts:  17
Joined:  2009-04-04
 

I found good example, quick and easy steps smile .

http://www.phptechi.com/magento-show-country-flags-selector-in-header.html

 
Magento Community Magento Community
Magento Community
Magento Community
 
maria_atwix
Sr. Member
 
Avatar
Total Posts:  125
Joined:  2012-01-23
 

Hi. Here is a simple way to replace the Magento language selector with flag icons http://www.atwix.com/magento/replace-language-selector-flag-icons/

Hope this information will be useful

 Signature 

Atwix.com - Magento Custom Development and Design

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top