How To
Translated or Edit Text
3 min
sometimes, you need to change klevu's default text we can do this using klevu's translation engine below is an example of how to setup translations that will get merged into the default klevu translations for any language \<script> var klevu lang = 'it'; var klevu custom translations { "en" { }, "fr" { "price high to low" "prix décroissant", "price low to high" "prix croissant", "narrow by" "filtrer par", "relevance" "pertinence", } }; var klevu storetranslations = klevu custom translations\[klevu lang]; \</script> \<script src="https //js klevu com/core/v2/klevu js">\</script> more information about translations in klevu klevu templates wrap text that is used in a translate helper as shown below <%= helper translate("load more")%> in the above example, you could translate or modify this text to be anything you want by simply specifying a different value for "load more" the translation works with the exact string of text passed into the translate function, so ensure you use the exact same case, including any spaces or special characters that were passed into the translate function examples "\<b>%s\</b> productlist" => notice it has special characters and spaces " results" => notice there is a space at the begining if you wanted to translate the words "load more" for the template example shown previously to something like "show more" or you want it to be in some other language altogether, you would use something as simple as this var klevu storetranslations = { "load more" "show more", }; the example at the begining of this article shows how you could add translations to support multiple languages