MediaWiki:Skin/translate.js: Unterschied zwischen den Versionen

aus Kamelopedia, der wüsten Enzyklopädie
Zur Navigation springen Zur Suche springen
(Kategorien auch übersetzen)
(wenn keine Übersetzung angegeben)
Zeile 3: Zeile 3:
 
  *
 
  *
  
if (! window.jQuery)
+
if (window.jQuery == null)
 
{
 
{
 
     var s = document.createElement("SCRIPT");
 
     var s = document.createElement("SCRIPT");
Zeile 99: Zeile 99:
 
/* ausführen */
 
/* ausführen */
  
for (var x in translateMenu)
+
/* Menü übersetzen */
{
+
 
    jQuery(x).children("h5, a").text(translateMenu[x])
+
if (window.translateMenu != null)
}
+
for (var x in translateMenu)
 +
{
 +
    jQuery(x).children("h5, a").text(translateMenu[x])
 +
}
 +
 
 +
/* Tabs übersetzen */
  
for (var x in translateTabs)
+
if (window.translateTabs != null)
{
+
for (var x in translateTabs)
        jQuery(x).find(":last").text(translateTabs[x])
+
{
}
+
jQuery(x).find(":last").text(translateTabs[x])
 +
}
  
  
jQuery("#mw-normal-catlinks").children("a").text(translateCategoryTitle)
+
/* Kategorien übersetzen */
 +
if (window.translateCategoryTitle != null)
 +
jQuery("#mw-normal-catlinks").children("a").text(translateCategoryTitle)
  
for (var x in translateCategories)
+
if (window.translateCategories != null)
    jQuery("#mw-normal-catlinks").find("span a").filter( function () { return jQuery(this).text() == x } ).text(translateCategories[x]);
+
for (var x in translateCategories)
 +
    jQuery("#mw-normal-catlinks").find("span a").filter( function () { return jQuery(this).text() == x } ).text(translateCategories[x]);

Version vom 5. Oktober 2010, 15:31 Uhr

/* 
 * Nur zum Testen
 *

if (window.jQuery == null)
{
    var s = document.createElement("SCRIPT");
    s.type = "text/javascript";
    s.src = "/skins/common/jquery.js";
    document.body.appendChild(s);
}
*/

/*
 * Dieser Block muss in das jeweilige seitenspezifische Javascript!
 *

var translateMenu = {
    // --- Menü links ---

    "#p-Navigation": "Compass",
    "#n-Hauptseite": "Main Page",
    "#n-Aktuelle-Erregnisse": "Things that happened",
    "#n-Wegweiser": "Way wise man",
    "#n-Zuf\\.C3\\.A4lliger-Artikel": "Random article",
    "#n-Kamelionary": "Kameliothingy",
    "#n-help": "Help (I need somebody)",
 
    "#p-Mitmachen": "Participate",
    "#n-Letzte-\\.C3\\.84nderungen": "Yes we can!",
    "#n-Herden-Portal": "Cooker's Door",
    "#n-Forum": "Thing were you can write",
    "#n-Projekte": "Projects",
    "#n-Rettungsdienst": "Ambulance",
    "#n-GaGA-Wahl": "WhGA election",
    
    "#p-tb": "Toolbox",
    "#t-whatlinkshere": "Links hereher",
    "#t-recentchangeslinked": "Changes to verlinked leaves",
    "#t-upload": "High loading",
    "#t-specialpages": "Special Leaves",
    "#t-print": "Pressure version",
    "#t-permalink": "Permanent Thingy",
    "#t-rating": "Leave bevalueing",
    
    "#p-lang": "Other Kiwis",
    ".interwiki-test": "Testingthingy",
    ".interwiki-kamry": "Kameliothingy",
    ".interwiki-stupi": "Stupidthingy",
    ".interwiki-uncy": "Uncythingy (de)",
    ".interwiki-uncy-en": "Uncythingy (en)",
    ".interwiki-wiki": "THEM (de)",
    ".interwiki-wiki-en": "THEM (en)",
    ".interwiki-wikt": "Wikingthing",

    // --- oben ---
    "#pt-userpage": "*?*",
    "#pt-mytalk": "My Camelleave",
    "#pt-preferences": "Onpositions",
    "#pt-watchlist": "Becarelist",
    "#pt-mycontris": "Own nearcarries",
    "#pt-logout": "Offreport"

}
*/

/*
 * Dieser Block muss in das jeweilige seitenspezifische Javascript!
 *

var translateTabs = {
    "#ca-nstab-main": "Leave",
    "#ca-talk": "Speak",
    "#ca-view": "Look at",
    "#ca-edit": "Write",
    "#ca-history": "Geographics",
    "#ca-delete": "Dig",
    "#ca-move": "Deplace",
    "#ca-unprotect": "publish",

    // Beobachten: Denk dran, auch wgAjaxWatch zu überschreiben!

    "#ca-watch": "Becare",
    "#ca-unwatch": "Unbecare"
}
*/

/* 
 * Dieser Block muss in das jeweilige seitenspezifische Javascript!
 *

var translateCategoryTitle = "Thingies";
var translateCategories = {
    "Kamelopedia": "Kamelothingy",
    "Schifffahrt": "Ship thingy"
};
*/

/* ausführen */

/* Menü übersetzen */

if (window.translateMenu != null)
	for (var x in translateMenu)
	{
	    jQuery(x).children("h5, a").text(translateMenu[x])
	}

/* Tabs übersetzen */

if (window.translateTabs != null)
	for (var x in translateTabs)
	{
		jQuery(x).find(":last").text(translateTabs[x])
	}


/* Kategorien übersetzen */
if (window.translateCategoryTitle != null)
	jQuery("#mw-normal-catlinks").children("a").text(translateCategoryTitle)

if (window.translateCategories != null)
	for (var x in translateCategories)
	    jQuery("#mw-normal-catlinks").find("span a").filter( function () { return jQuery(this).text() == x } ).text(translateCategories[x]);