Changeset 176 in t29-www for shared


Ignore:
Timestamp:
Aug 9, 2010, 9:42:58 PM (10 years ago)
Author:
sven
Message:

Kleinigkeiten:

  • head.inc.shtm: Whitespaces korrigiert ;-)
  • tools.js: mini-gettext-Implementierung geschrieben
File:
1 edited

Legend:

Unmodified
Added
Removed
  • shared/js/tools.js

    r173 r176  
    1616var t29 = {}; // the t29 namespace
    1717
    18 // allgemeine funktionen:
     18/**
     19 * Common helper functions
     20 **/
     21 
     22// get the language of the current document
    1923t29.language = function(){ return $("h1").hasClass("de") ? "de" : "en"; }
     24
     25// T29 Gettext. Usage:
     26//   t29.gettext("deutscher text", "englsischer text");
     27//   t29.gettext({ de: "deutscher Text", en: "englischer Text" });
     28//   t29.gettext(anything, null) wont work, use t29.gettext({ de: anything, en: null});
     29t29.gettext  = function(de, en) {
     30        if(!en){ en=de.en; de = de.de; }
     31        return t29.language()=="de" ? de : en;
     32}
    2033
    2134/**
     
    166179                        href: "#"+anchor,
    167180                        name: anchor,
    168                         title: t29.language()=="de" ? "Direktlink zu diesem Abschnitt" : "Link to this section"
     181                        title: t29.gettext("Direktlink zu diesem Abschnitt", "Link to this section")
    169182                }).appendTo(this);
    170183        });
Note: See TracChangeset for help on using the changeset viewer.
© 2008 - 2013 technikum29 • Sven Köppel • Some rights reserved
Powered by Trac
Expect where otherwise noted, content on this site is licensed under a Creative Commons 3.0 License