// commonjs code goes here
import i18next from 'i18next';

window.i18n = i18next;

i18next
    .init({
        lng: 'lang',
        resources: {
            lang: {
                translation: page_params.translation_data,
            },
        },
        nsSeparator: false,
        keySeparator: false,
        interpolation: {
            prefix: "__",
            suffix: "__",
        },
        returnEmptyString: false,  // Empty string is not a valid translation.
    });

// garbage collect all old-style i18n translation maps in localStorage.
$(function () {
    if (!localstorage.supported()) {
        return;
    }

    // this collects all localStorage keys that match the format of:
    //   i18next:dddddddddd:w+ => 1484902202:en
    // these are all language translation strings.
    var translations = Object.keys(localStorage).filter(function (key) {
        return /^i18next:\d{10}:\w+$/.test(key);
    });

    // remove cached translations of older versions.
    translations.forEach(function (translation_key) {
        localStorage.removeItem(translation_key);
    });
    return this;
});

@@ -83,21 +83,16 @@
 %0Ai18next
-%0A    
 .init(%7B%0A
@@ -95,20 +95,16 @@
 t(%7B%0A    
-   
- 
 lng: 'la
@@ -112,20 +112,16 @@
 g',%0A    
-   
- 
 resource
@@ -137,20 +137,16 @@
     
-   
- 
 lang: %7B%0A
     
@@ -137,28 +137,24 @@
     lang: %7B%0A
-    
             
@@ -208,34 +208,22 @@
     
-    
 %7D,%0A    
- 
-   
 %7D,%0A    
-  
-  
 nsSe
@@ -242,20 +242,16 @@
 se,%0A    
-  
-  
 keySepar
@@ -267,20 +267,16 @@
 se,%0A    
-  
-  
 interpol
@@ -292,20 +292,16 @@
         
-    
 prefix: 
@@ -314,20 +314,16 @@
         
- 
-   
 suffix: 
@@ -332,27 +332,19 @@
 _%22,%0A    
-    %7D,%0A    
+%7D,%0A
     retu
@@ -410,20 +410,16 @@
 lation.%0A
-    
 %7D);%0A%0A// 

Clean up indentation for initialization code.