Yahoo! Developer Network Home - Help

YUI Library Examples: ProfilerViewer Control (beta): ProfilerViewer Internationalization: German

ProfilerViewer Control (beta): ProfilerViewer Internationalization: German

The ProfilerViewer Control can be easily internationalized by modifying the STRINGS member of YAHOO.widget.ProfilerViewer In this example, a German translation provided by Christian Heilmann is applied to the UI.

Adding a German Translation for the ProfilerViewer UI:

Customizing the ProfilerViewer UI for non-English languages is easy. In the example below, we've applied a German translation provided by Christian Heilmann to the ProfilerViewer.

This example has the following dependencies:

1<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/http://yui.yahooapis.com/2.5.2//build/calendar/assets/skins/sam/calendar.css">  
2<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.5.2/build/profilerviewer/assets/skins/sam/profilerviewer.css"
3 
4<script type="text/javascript" src="http://yui.yahooapis.com/2.5.2/build/utilities/utilities.js"></script> 
5<script type="text/javascript" src="http://yui.yahooapis.com/2.5.2/build/element/element-beta-min.js"></script> 
6<script type="text/javascript" src="http://yui.yahooapis.com/2.5.2/build/calendar/calendar.js"></script> 
7<script type="text/javascript" src="http://yui.yahooapis.com/2.5.2/build/yuiloader/yuiloader-beta-min.js"></script> 
8<script type="text/javascript" src="http://yui.yahooapis.com/2.5.2/build/profiler/profiler-beta-min.js"></script> 
9<script type="text/javascript" src="http://yui.yahooapis.com/2.5.2/build/profilerviewer/profilerviewer-beta-min.js"></script> 
view plain | print | ?

All of the interface's language strings live in the static member YAHOO.widget.ProfilerViewer.STRINGS. Customizing the interface simply involves modifying or replacing that object prior to creating your ProfilerViewer instance.

1<div id="container">YAHOO.widget.ProfilerViewer.STRINGS = { 
2    title: "YUI Profiler (beta)"
3    buttons: { 
4        viewprofiler: "Profiler Daten anzeigen"
5        hideprofiler: "Profiler Report verstecken"
6        showchart: "Diagramm anzeigen"
7        hidechart: "Diagramm verstecken"
8        refreshdata: "Daten neu laden" 
9    }, 
10    colHeads: { 
11        //key: [column label, column width in px] 
12        fn: ["Funktion/Methode"null], 
13        calls: ["Aufrufe", 60], 
14        avg: ["Durchschnitt", 90], 
15        min: ["Schnellste", 80], 
16        max: ["Langsamste", 85], 
17        total: ["Zeit total", 80], 
18        pct: ["Prozent", 70] 
19    }, 
20    millisecondsAbbrev: "ms"
21    initMessage: "Diagramm wird vorbereitet..."
22    installFlashMessage: "Konnte Flash Inhalt nicht laden. YUI Charts Control erfordert Flash Player 9.0.45 or neuer. Bitten laden Sie die neueste Version des Flash Players beim <a href='http://www.adobe.com/go/getflashplayer'>Adobe Flash Player Download Center</a> herunter." 
23}; 
view plain | print | ?

Copyright © 2008 Yahoo! Inc. All rights reserved.

Privacy Policy - Terms of Service - Copyright Policy - Job Openings