{{indexmenu_n>200}} ====== Slimbox: Multilingual ====== ===== Version for MooTools V1.2.x ===== File: **template/lib/slimbox/slimbox.mootools-1.2.js** In newer versions of the CMS: **/template/lib/slimbox/slimbox.mootools-1.2.js** This sequence // AUTOLOAD CODE BLOCK (MAY BE CHANGED OR REMOVED) Slimbox.scanPage = function() { $$("a").filter(function(el) { return el.rel && el.rel.test(/^lightbox/i); }).slimbox({/* Put custom options here */}, null, function(el) { return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel)); }); }; is replaced by // AUTOLOAD CODE BLOCK (MAY BE CHANGED OR REMOVED) Slimbox.scanPage = function() { // OG: enhanced for translated image cpations var bLang=navigator.language?navigator.language:navigator.userLanguage; if(bLang){bLang=bLang.substr(0,2);bLang=bLang.toLowerCase();}else{bLang = 'en';} var cText="Image {x} of {y}"; switch(bLang) { case 'de': cText = "Bild {x} von {y}"; break; case 'es': cText = "Imagen {x} de {y}"; break; case 'fr': cText = "Image {x} de {y}"; break; case 'nl': cText = "Afbeelding {x} van {y}"; break; case 'da': cText = "billede {x} fra {y}"; break; } // OG: end enhancement $$("a").filter(function(el) { return el.rel && el.rel.test(/^lightbox/i); }).slimbox({counterText: cText, cLang: bLang /* Put custom options here */}, null, function(el) { // OG: sorry I am too stupid to find the correct var, // so use "brute force method" to inject the class name $("lbCloseLink").className="lbCloseLink-"+bLang; $("lbNextLink").className="lbNextLink-"+bLang; $("lbPrevLink").className="lbPrevLink-"+bLang; return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel)); }); }; \\ With the generated classes: class="lbCloseLink-XX" class="lbNextLink-XX" class="lbPrevLink-XX" Where %%"XX"%% is the country code in the variable %%"bLang"%% corresponds. E.G. at %%"de"%% => ##%%class="lbCloseLink-de"%%## \\ ===== Version for MooTools V1.1.x ===== File: **template/lib/slimbox/slimbox.mootools-1.1.js** In newer versions of the CMS: **/template/lib/slimbox/slimbox.mootools-1.2.js** This sequence // AUTOLOAD CODE BLOCK (MAY BE CHANGED OR REMOVED) Slimbox.scanPage = function() { $$($$("a").filter(function(el) { return el.rel && el.rel.test(/^lightbox/i); })).slimbox({/* Put custom options here */}, null, function(el) { return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel)); }); }; is replaced by // AUTOLOAD CODE BLOCK (MAY BE CHANGED OR REMOVED) Slimbox.scanPage = function() { // OG: enhanced for translated image cpations var bLang=navigator.language?navigator.language:navigator.userLanguage; if(bLang){bLang=bLang.substr(0,2);bLang=bLang.toLowerCase();}else{bLang = 'en';} var cText="Image {x} of {y}"; switch(bLang) { case 'de': cText = "Bild {x} von {y}"; break; case 'es': cText = "Imagen {x} de {y}"; break; case 'fr': cText = "Image {x} de {y}"; break; case 'nl': cText = "Afbeelding {x} van {y}"; break; case 'da': cText = "billede {x} fra {y}"; break; } // OG: end enhancement $$($$("a").filter(function(el) { return el.rel && el.rel.test(/^lightbox/i); })).slimbox({counterText: cText, cLang: bLang /* Put custom options here */}, null, function(el) { // OG: sorry I am too stupid to find the correct var, // so use "brute force method" to inject the class name $("lbCloseLink").className="lbCloseLink-"+bLang; $("lbNextLink").className="lbNextLink-"+bLang; $("lbPrevLink").className="lbPrevLink-"+bLang; return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel)); }); }; \\ With the generated classes: class="lbCloseLink-XX" class="lbNextLink-XX" class="lbPrevLink-XX" Where %%"XX"%% is the country code in the variable %%"bLang"%% corresponds. E.G. at %%"de"%% => ##%%class="lbCloseLink-de"%%## \\ ===== Version for jQuery V1.X.x ===== File: **template/lib/slimbox/slimbox.jquery.js** In newer versions of the CMS: **/template/lib/slimboxslimbox.jquery.js** This sequence // AUTOLOAD CODE BLOCK (MAY BE CHANGED OR REMOVED) if (!/series60|symbian|windows ce/i.test(navigator.userAgent)) { jQuery(function($) { $("a[rel^='lightbox']").slimbox({/* Put custom options here */}, null, function(el) { return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel)); }); }); } is replaced by // AUTOLOAD CODE BLOCK (MAY BE CHANGED OR REMOVED) if (!/series60|symbian|windows ce/i.test(navigator.userAgent)) { // OG: enhanced for translated image cpations var bLang=navigator.language?navigator.language:navigator.userLanguage; if(bLang){bLang=bLang.substr(0,2);bLang=bLang.toLowerCase();}else{bLang = 'en';} var cText="Image {x} of {y}"; switch(bLang) { case 'de': cText = "Bild {x} von {y}"; break; case 'es': cText = "Imagen {x} de {y}"; break; case 'fr': cText = "Image {x} de {y}"; break; case 'nl': cText = "Afbeelding {x} van {y}"; break; case 'da': cText = "billede {x} fra {y}"; break; } // OG: end enhancement jQuery(function($) { $("a[rel^='lightbox']").slimbox({counterText: cText, cLang: bLang /* Put custom options here */}, null, function(el) { // OG: sorry I am too stupid to find the correct var, // so use "brute force method" to inject the class name $("#lbCloseLink").addClass("lbCloseLink-"+bLang); $("#lbNextLink").addClass("lbNextLink-"+bLang); $("#lbPrevLink").addClass("lbPrevLink-"+bLang); return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel)); }); }); } \\ With the generated classes: class="lbCloseLink-XX" class="lbNextLink-XX" class="lbPrevLink-XX" Where %%"XX"%% is the country code in the variable %%"bLang"%% corresponds. E.G. at %%"de"%% => ##%%class="lbCloseLink-de"%%## The classes and IDs can be found in the CSS file **template/lib/slimbox/slimbox.css**. \\