Skip to content

How to translate the custom strings and make JGC fully multilingual

Francesco Mugnai edited this page Apr 1, 2022 · 1 revision

Since version 0.8.7 you can define an object (with custom translations) for almost all JGC strings. Example: Suppose you have "en" and "it". You can change the description of the cookies in this way:

necessary: {
  title: {
    it: "Cookie necessari",
    en: "Necessary cookies"
  },
  description: {
    it: "Qui la descrizione...",
    en: "Here the description..."
  }
}

Another example? Change the label of the acceptText button:

text: {
  acceptText: {
    it: "Qui la descrizione...",
    en: "Here the description..."
  },
},

After that, all you have to do is dynamically change the locale parameter and you are done!