Multi Language

Multi Language Settings

Let add French language in the existing language.

  • Create a new file i18n/fr.json
  • You must have to add new language in the app.js in siteLangs: ['en', 'sp', 'fr'] array.
  • Now add the new option of French language in the header language dropdown menu views/partials/topbar.ejs
    <!-- item-->
    <a href="?clang=fr" class="dropdown-item notify-item language" data-lang="fr" title="French">
        <img src="<%= assetsUrl %>flags/french.svg" alt="user-image" class="me-2 rounded" height="18">
        <span class="align-middle">French</span>
    </a>
  • You must have to write all text like <%=translation.Mega_Menu %> to make it working with all languages. Also make sure to add new words in all other language files i18n/fr.json. and make sure to add the french.svg file in the public/assets/images/flags folder.
  • Display selected language add below code above language dropdown list in views/partials/topbar.ejs file .
    <% else if(lang=="fr" ) { %>
        <img src="<%= assetsUrl %>flags/fr.svg" id="header-lang-img" alt="Header Language" class="rounded" height="20">
    <% } %>
    

© Judia.
Design & Develop by Themesbrand