samedi 27 octobre 2018

Html two language option with button (without having to redirect to different page )

I'm trying to make second language option to the website. Here are the details for the project :

1) I'm not trying to use Google translator system or any other auto translator service to change the entire website language.

2) I only trying to translate the main description part in the website.

3) I already have written and saved translated version of the description text.

4)I also made a dropdown language option button in a separate file but under same template for both language.

So, to make it clear, my question is :

How can I use language option button to switch the language between English and Korean (from English to Korean, and from Korean to English depending on what user select) with the translated description text I have?

----- code below is the dropdown language option button ----------------

<!DOCTYPE html>
<html>
<head>
    <title></title>

    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>

<body>

<div class="container">            
   <div class="dropdown">
    <button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">Language Option
    <span class="caret"></span></button>
    <ul class="dropdown-menu">
      <li><a href="#">English</a></li>
      <li><a href="#">Korean</a></li>
    </ul>
  </div>
</div>

</body>
</html>




Aucun commentaire:

Enregistrer un commentaire