JSFiddle - React, Tailwind, and code Playground
by mtenschert
JavaScript
/**
* Get initial language
*/
function getCurrentLanguage() {
var O360G_totalPath = window.location.pathname;
var O360G_paths = O360G_totalPath.split("/"); // string to [en, ski-rental, france, ...]
return O360G_paths[1]; // extract language string, example: en
}
var O360G_lang = getCurrentLanguage();
/**
* Bug hotfix for ALPINRESORTS.com & satellites insurance pages
* show promocode field in PS only
* Initial html output
* Intervall function for race condition reasons
*/
var initial_totalPath = window.location.pathname;
var initial_paths = initial_totalPath.split("/"); // string to [en, ski-rental, france, ...]
var initial_page = initial_paths[3]; // extract page name
var initial_page_ps = initial_page.split("?"); // because of the product?xyz
/**
* translation-keys collected
*/
var translations = {
en: {
translation1: "<strong class=\"headline\" style=\"margin-left: 5px;\">&</strong><strong id='promoCodeLoaded' class=\"headline important-label\" style=\"margin-left: 5px;font-size: 90%;\">Promotion Code</strong>"
},
fr: {
translation1: "<strong class=\"headline\" style=\"margin-left: 5px;\">&</strong><strong id='promoCodeLoaded' class=\"headline important-label\" style=\"margin-left: 5px;font-size: 90%;\">Code promotion</strong>"
},
nl: {
translation1: "<strong class=\"headline\" style=\"margin-left: 5px;\">&</strong><strong id='promoCodeLoaded' class=\"headline important-label\" style=\"margin-left: 5px;font-size: 90%;\">Promotiecode</strong>"
},
de: {
translation1: "<strong class=\"headline\" style=\"margin-left: 5px;\">&</strong><strong id='promoCodeLoaded'...