NAVIGATION
This shows you the differences between two versions of the page.
|
english:other-enhancements:hacks:slimbox-multilingual [2012/09/02 12:50] Knut Heermann (flip-flop) created |
english:other-enhancements:hacks:slimbox-multilingual [2018/06/03 18:09] (current) |
||
|---|---|---|---|
| Line 129: | Line 129: | ||
| Where %%"XX"%% is the country code in the variable %%"bLang"%% corresponds. E.G. at %%"de"%% => ##%%class="lbCloseLink-de"%%## | 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 | ||
| + | |||
| + | <code js> | ||
| + | // 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)); | ||
| + | }); | ||
| + | }); | ||
| + | } | ||
| + | </code> | ||
| + | is replaced by | ||
| + | <code js> | ||
| + | // 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)); | ||
| + | }); | ||
| + | }); | ||
| + | } | ||
| + | </code> | ||
| + | |||
| + | \\ | ||
| + | |||
| + | With the generated classes: | ||
| + | |||
| + | <code> | ||
| + | class="lbCloseLink-XX" | ||
| + | class="lbNextLink-XX" | ||
| + | class="lbPrevLink-XX" | ||
| + | </code> | ||
| + | |||
| + | 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**. | ||
| \\ | \\ | ||