Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8896713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:08:47+00:00 2026-06-15T00:08:47+00:00

I have a website that has multiple languages, currently the language bar is displayed

  • 0

I have a website that has multiple languages, currently the language bar is displayed along the top of the site with a button for each language. What I would prefer is one button, click it once, the button image changes to a union jack flag, and english is called, press it again, and the button image changes to french, and the french language is called, etc etc..

Is this one button, multiple calls possible? can anyone give me a good place to start looking in to this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T00:08:49+00:00Added an answer on June 15, 2026 at 12:08 am

    Yes, it is possible.
    Your html would look something like this:

    <button id='changeLang' onclick='changeLang()'></button>
    

    (Remember to set this to your default to begin with)

    and your javascript:

        var counter = 0;
        function changeLang(){
           var buttonDetails = document.getElementById('changeLang');
           buttonDetails.innerHTML = "";
           switch(counter){
    
              case 0:
                 buttonDetails.innerHTML = "<img src='unionJack.png' />English";
                 counter +=1;
                 break;
              case 1:
                 buttonDetails.innerHTML = "<img src='frenchFlag.png' />French";
                 counter +=1;
                 break;
              case 2:
                 //continue like above
              default:
                 counter = 0;
                 changeLang();
       }
    }
    

    If you ever need another language, just add it to the switch.

    Alternatively, change the case code to:

    case 0:
       buttonDetails.src = "unionJack.png";
       counter +=1;
       break;
    

    And remove the line that says buttonDetails.innerHTML = ""; if all you want is an image.

    To call a function to change the language you would simply add a function call to one of your switch cases like so:

    case 0:
       buttonDetails.innerHTML = "<img src='unionJack.png' />English";
       counter +=1;
       foo(bar);     //just add your function call
       break;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a website that has multiple languages. The way this is set up
I have a website that is 1-page and has multiple sections, each containing a
I'm developing a website that has some audio courses, each course can have multiple
I'm developing a website that has some audio courses, each course can have multiple
I an writing a website that will have multiple skins. Each skin has its
I have a section of a website that has three divs next to each
I have a set of data in a website table that has multiple pages
I have a website that goes through multiple different screens, and has the user
Lets say I've a website that lists Persons, and each Person has multiple properties,
I have an asp.net website that has a master page and multiple normal pages.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.