YUI Library Home

YUI Library Examples: ProfilerViewer Control: ProfilerViewer Internationalization: Spanish

ProfilerViewer Control: ProfilerViewer Internationalization: Spanish

The ProfilerViewer Control can be easily internationalized by modifying the STRINGS member of YAHOO.widget.ProfilerViewer In this example, a Spanish translation provided by Caridy Patiño Mayea is applied to the UI.

Adding a Spanish Translation for the ProfilerViewer UI:

Customizing the ProfilerViewer UI for non-English languages is easy. In the example below, we've applied a translation provided by Caridy Patiño Mayea 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.7.0//build/calendar/assets/skins/sam/calendar.css">  
2<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.7.0/build/profilerviewer/assets/skins/sam/profilerviewer.css">  
3 
4<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/utilities/utilities.js"></script> 
5<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/element/element-min.js"></script> 
6<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/calendar/calendar.js"></script> 
7<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/yuiloader/yuiloader-min.js"></script> 
8<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/profiler/profiler-min.js"></script> 
9<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/profilerviewer/profilerviewer-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 instantiating your ProfilerViewer instance.

1<div id="container">YAHOO.widget.ProfilerViewer.STRINGS = { 
2    title: "YUI Profiler (beta)"
3    buttons: { 
4        viewprofiler: "Mostrar datos del Profiler"
5        hideprofiler: "Ocultar reporte del Profiler"
6        showchart: "Mostrar Gráfica"
7        hidechart: "Ocultar Gráfica"
8        refreshdata: "Refrescar Datos" 
9    }, 
10    colHeads: { 
11        //key: [column label, column width in px] 
12        fn: ["Función/Método"null], 
13        calls: ["Llamadas", 70], 
14        avg: ["Promedio", 70], 
15        min: ["Menor", 70], 
16        max: ["Mayor", 70], 
17        total: ["Tiempo Total", 90], 
18        pct: ["Porcentaje", 80] 
19    }, 
20    millisecondsAbbrev: "ms"
21    initMessage: "Inicializando gráfica..."
22    installFlashMessage: "No se pudo cargar el contenido Flash. El control YUI Charts requiere Flash Player 9.0.45 o superior. Usted puede descargar la última versión del Flash Player del <a href='http://www.adobe.com/go/getflashplayer?Lang=Spanish'>Centro de descargas de Adobe Flash Player</a>." 
23}; 
view plain | print | ?

Configuration for This Example

You can load the necessary JavaScript and CSS for this example from Yahoo's servers. Click here to load the YUI Dependency Configurator with all of this example's dependencies preconfigured.

Copyright © 2009 Yahoo! Inc. All rights reserved.

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