Examples

Familiarize yourself with the use of JS SDK events and methods.

Create additional switcher

        
            
        
    
        
            
        
    
        
            
        
    

Switch to another language

Using inline javascript code

        
            
        
    

or using event listener

        
            
        
    
        
var links = document.querySelectorAll(".language-link");

for(var i = 0, count = links.length; i < count; i++) {

    links[i].addEventListener("click", function(e) {
        var code = e.currentTarget.dataset.code;
        LangShopSDK.switchLanguage(code);
    });
}
        
    
        
            
        
    

Switch to another currency

        
            
        
    
        
var selector = document.getElementById("simple-selector");

selector.addEventListener("change", function(e) {
    var code = e.currentTarget.value;
    LangShopSDK.switchCurrency(code);
});
        
    

React on the opened dropdown switcher

        
            
        
    

Take action only if certain language is chosen

        
            
        
    

Format product price

        
            
        
    

Show price in your own format

        
            
        
    

Save user last language before language switched

        
            
        
    

Track switching the currency with Google Analytics

        
            
        
    

Translate third-party app's static content

The translations process takes some time. In this case, we recommend creating a translatable container for all needed locales as fast as possible.

        
            
        
    
        
            
        
    

Then you can receive strings translations during the render process.

        
            
        
    

Starten Sie noch heute Ihrekostenlose 14-Tage-Testversion today!

Ein Meeting planen

Versuchen Sie LangShop kostenlos für 14 Tage. Geben Sie Ihre Shopify-Domain ein.