Multi Language

Multi Language Settings

Let's add the French language.
  • Create a new file fr.json in the fr folder in the src/assets/lang folder and copy the en.json file code in this file.
  • Now you need to add the language in the src/assets/js/app.js file. In the function setLanguage add the "else if" condition as below code and make sure to add french.jpg file in the src/assets/images/flags folder.
    else if(lang=='fr') {
        document.getElementById("header-lang-img").src = "assets/images/flags/french.jpg";
    }
  • You can simply use key attributes in the HTML tag to convert the language text. Example: <div key="t-title">This is title.</div>
  • Add the below dropdown in the views/partials/topbar.ejs file in the language dropdown.

    <!-- item-->
    <a href="javascript:void(0);" class="dropdown-item notify-item language" data-lang="fr" title="French">
        <img src="assets/images/flags/french.jpg" alt="user-image" class="me-2 rounded" height="18">
        <span class="align-middle">French</span>
    </a>


Note: After above changes open terminal and Run command npm run build
© Velzon.
Design & Develop by Themesbrand