Multi Language

How to add new language?

Let's add the German language in the existing language.

  1. Create a new file src/lang/gr.json
    {
      "Mega Menu": "Mega-Menü",
    }
  2. Update the following code in src/routes/+layout.svelte.
    import { addMessages, init } from "svelte-i18n";
    
    init({
      fallbackLocale: "en", // use en if language is not found.
      initialLocale: "en", // replace "en" to "gr" to set the gr as default language.
    });
  3. Now add the new option of German language in the topbar language dropdown menu src/common/data/languages.js
    {
      label: "German",
      flag: flaggerman,
      value: 'gr'
    }
© Velzon.
Design & Develop by Themesbrand