I want to display my custom flags images at the language switcher module. How can I replace the default flags of the module?

  • How did you manage to use .pngs instead of .gifs? i find no way of doing this. Nico.
    – user2263
    Nov 25, 2014 at 14:40
  • @user2263: Your comment was for Brian Peat's comment below my answer. For my side, when I tried to use png's, I wasn't successful and gave up quickly. It might be possible though- but never ever tried again. I am okay with using gif's.
    – FFrewin
    Aug 10, 2015 at 11:22

2 Answers 2


Actually the language siwtcher module gets the flags images from the directory


We can define which image should be used for each language, when creating/editing the Content Languages in Language Manager, through the Image Prefix selection.

According to the instructions that appear when hovering the field:

Prefix of the image file for this language when using the "Use image flags" Language Switcher basic option. Example: if 'en' is chosen, then the image shall be en.gif. Images and CSS for this module are in media/mod_languages/

What does this say?
That the Flags images should be in .gif format and uploaded in the mentioned directory.

There is no need to replace existing images as we can use any prefix we like for our flags.

The custom flags would be available in the Edit Content Language layout, and we can search for them by typing the prefix we gave them.

Screenshot attached:
enter image description here

  • To add to this, the images don't HAVE to be gifs. Here's a site I made that has custom flags that are PNG. On top of that I'm using retina.js and put the @2x images in there so on a retina machine their double the resolution. shoresofgrace.com/en
    – Brian Peat
    Aug 20, 2014 at 1:53
  • @brian-peat How did you change from gif to png? Nov 10, 2015 at 14:07
  • 1
    Aha, looks like I did an html override and change .jpg to .png in the default.php file.
    – Brian Peat
    Nov 12, 2015 at 14:03
  • where is this default.php file located? Jan 19, 2016 at 9:48
  • 1
    @Alexandros: I guess he meant the default.php of the languages switcher module.
    – FFrewin
    Jan 19, 2016 at 9:52

Used rereplacer extension from regular labs... (png in my images dir...

  • 1
    Hi Olo and welcome to JSE! Thank you for taking the time to add your own solution to this question. However this particular answer is rather poor in terms of being really helpful to other users. We tend to require more thorough answers here. So if you would consider to add more context to your answer, of how you managed to work out your solution (e.g. include steps, the workflow, or how the said extension helped you overall), that would be greatly appreciated.
    – FFrewin
    Oct 23, 2020 at 8:37
  • @Olo Please take our tour and then read How to Answer. Oct 23, 2020 at 21:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.