Localizing for Language and Locale

The HTML5 SDK uses ImaSdkSettings.setLocale for setting UI element text language and retrieving localized JavaScript files. Locale must be set before AdDisplayContainer and AdsLoader have been initialized and cannot be changed once those objects have been created.

    google.ima.settings.setLocale('fr');
    var adContainerElement = document.getElementById('adContainer');
    var adDisplayContainer = new google.ima.AdDisplayContainer(adContainerElement);
    var adsLoader = new google.ima.AdsLoader(adDisplayContainer);
    

Try it out

You can see a working implementation below.

Send feedback about...

IMA SDK for HTML5
Need help? Visit our support page.