Skip to content

Commit

Permalink
Add gettext
Browse files Browse the repository at this point in the history
  • Loading branch information
rdeq08 authored and nijel committed Dec 12, 2011
1 parent c881a51 commit ad5ae4c
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 18 deletions.
10 changes: 10 additions & 0 deletions js/messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,23 @@
$js_messages['strFromSlowLog'] = __('From slow log');
$js_messages['strFromGeneralLog'] = __('From general log');
$js_messages['strAnalysingLogs'] = __('Analysing & loading logs. This may take a while.');
$js_messages['strCancelRequest'] = __('Cancel request');
$js_messages['strCountColumnExplanation'] = __('This column shows the amount of identical queries that are grouped together. However only the SQL query itself has been used as a grouping criteria, so the other attributes of queries, such as start time, may differ.');
$js_messages['strMoreCountColumnExplanation'] = __('Since grouping of INSERTs queries has been selected, INSERT queries into the same table are also being grouped together, disregarding of the inserted data.');
$js_messages['strLogDataLoaded'] = __('Log data loaded. Queries executed in this time span:');

$js_messages['strJumpToTable'] = __('Jump to Log table');
$js_messages['strNoDataFound'] = __('Log analysed, but no data found in this time span.');

$js_messages['strAnalyzing'] = __('Analyzing...');
$js_messages['strExplainOutput'] = __('Explain output');
$js_messages['strStatus'] = __('Status');
$js_messages['strTime'] = __('Time');
$js_messages['strTotalTime'] = __('Total time:');
$js_messages['strProfilingResults'] = __('Profiling results');
$js_messages['strTable'] = _pgettext('Display format', 'Table');
$js_messages['strChart'] = __('Chart');

/* l10n: A collection of available filters */
$js_messages['strFiltersForLogTable'] = __('Log table filter options');
/* l10n: Filter as in "Start Filtering" */
Expand Down
32 changes: 18 additions & 14 deletions js/server_status_monitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -1339,19 +1339,20 @@ $(function() {
$('#emptyDialog').html(PMA_messages['strAnalysingLogs'] +
' <img class="ajaxIcon" src="' + pmaThemeImage +
'ajax_clock_small.gif" alt="">');
var dlgBtns = {};

dlgBtns[PMA_messages['strCancelRequest']] = function() {
if (logRequest != null) {
logRequest.abort();
}

$(this).dialog("close");
}

$('#emptyDialog').dialog({
width: 'auto',
height: 'auto',
buttons: {
'Cancel request': function() {
if (logRequest != null) {
logRequest.abort();
}

$(this).dialog("close");
}
}
buttons: dlgBtns
});


Expand Down Expand Up @@ -1731,7 +1732,7 @@ $(function() {
var db = rowData.db || '';

$('div#queryAnalyzerDialog div.placeHolder').html(
'Analyzing... ' + '<img class="ajaxIcon" src="' +
PMA_messages['strAnalyzing'] + ' <img class="ajaxIcon" src="' +
pmaThemeImage + 'ajax_clock_small.gif" alt="">');

$.post('server_status.php?' + url_query, {
Expand All @@ -1752,7 +1753,7 @@ $(function() {
$('div#queryAnalyzerDialog div.placeHolder')
.html('<table width="100%" border="0"><tr><td class="explain"></td><td class="chart"></td></tr></table>');

var explain = '<b>Explain output</b> ' + explain_docu;
var explain = '<b>' + PMA_messages['strExplainOutput'] + '</b> ' + explain_docu;
if (data.explain.length > 1) {
explain += ' (';
for (var i = 0; i < data.explain.length; i++) {
Expand Down Expand Up @@ -1792,7 +1793,7 @@ $(function() {

if (data.profiling) {
var chartData = [];
var numberTable = '<table class="queryNums"><thead><tr><th>Status</th><th>Time</th></tr></thead><tbody>';
var numberTable = '<table class="queryNums"><thead><tr><th>' + PMA_messages['strStatus'] + '</th><th>' + PMA_messages['strTime'] + '</th></tr></thead><tbody>';
var duration;

for (var i = 0; i < data.profiling.length; i++) {
Expand All @@ -1803,10 +1804,13 @@ $(function() {

numberTable += '<tr><td>' + data.profiling[i].state + ' </td><td> ' + PMA_prettyProfilingNum(duration, 2) + '</td></tr>';
}
numberTable += '<tr><td><b>Total time:</b></td><td>' + PMA_prettyProfilingNum(totalTime, 2) + '</td></tr>';
numberTable += '<tr><td><b>' + PMA_messages['strTotalTime'] + '</b></td><td>' + PMA_prettyProfilingNum(totalTime, 2) + '</td></tr>';
numberTable += '</tbody></table>';

$('div#queryAnalyzerDialog div.placeHolder td.chart').append('<b>Profiling results ' + profiling_docu + '</b> (<a href="#showNums">Table</a>, <a href="#showChart">Chart</a>)<br/>' + numberTable + ' <div id="queryProfiling"></div>');
$('div#queryAnalyzerDialog div.placeHolder td.chart').append(
'<b>' + PMA_messages['strProfilingResults'] + ' ' + profiling_docu + '</b> ' +
'(<a href="#showNums">' + PMA_messages['strTable'] + '</a>, <a href="#showChart">' + PMA_messages['strChart'] + '</a>)<br/>' +
numberTable + ' <div id="queryProfiling"></div>');

$('div#queryAnalyzerDialog div.placeHolder a[href="#showNums"]').click(function() {
$('div#queryAnalyzerDialog div#queryProfiling').hide();
Expand Down
8 changes: 4 additions & 4 deletions libraries/Advisor.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,16 +323,16 @@ function PMA_bytime($num, $precision)
{
$per = '';
if ($num >= 1) { // per second
$per = "per second";
$per = __('per second');
} elseif ($num*60 >= 1) { // per minute
$num = $num*60;
$per = "per minute";
$per = __('per minute');
} elseif ($num*60*60 >=1 ) { // per hour
$num = $num*60*60;
$per = "per hour";
$per = __('per hour');
} else {
$num = $num*60*60*24;
$per = "per day";
$per = __('per day');
}

$num = round($num, $precision);
Expand Down

0 comments on commit ad5ae4c

Please sign in to comment.