As a JavaScript and Bootstrap beginner, I have successfully added the navbar to my website, but now I want to implement a feature where users can change the language of the navbar titles (Home, About us, Our Service, Contact us) by clicking a button at the top of the navbar. Below is the Bootstrap code snippet that I am currently working with:
<button type="button" class="btn btn-primary">Spanish</button>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<img src="images/logo.png" width="60" height="55" class="d-inline-block align-top" alt="" loading="lazy">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto text-center">
<li class="nav-item active">
<a class="nav-link" href="index.html">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="aboutus.html">About Us</a>
</li>
<li class="nav-item">
<a class="nav-link" href="ourservices.html">Our Services</a>
</li>
<li class="nav-item">
<a class="nav-link" href="contactus.html">Contact Us</a>
</li>
</ul>
<a class="btn btn-outline-primary" id="fire" href="http://eatxact.com/#">Login</a>
</div> </nav>