Replaced t() calls with bts() in Views configuration (to enable translation of field value strings)

(DBOINCP-141)
This commit is contained in:
Tristan Olive 2015-04-23 01:35:35 -04:00
parent 51ccfd94da
commit ba58bda785
4 changed files with 165 additions and 84 deletions

View File

@ -972,14 +972,14 @@ function teams_views_default_views() {
'hide_empty' => 0,
'empty_zero' => 0,
'hide_alter_empty' => 1,
'value' => '<?php
global $user;
if ($data->user_send_email OR boincuser_lookup_uid($data->id) == $user->uid) {
echo $data->user_email_addr;
}
else {
echo \'(\' . t(\'hidden\') . \')\';
}
'value' => '<?php
global $user;
if ($data->user_send_email OR boincuser_lookup_uid($data->id) == $user->uid) {
echo $data->user_email_addr;
}
else {
echo \'(\' . bts(\'hidden\') . \')\';
}
?>',
'exclude' => 0,
'id' => 'phpcode',
@ -1170,13 +1170,13 @@ else {
'hide_empty' => 0,
'empty_zero' => 0,
'hide_alter_empty' => 1,
'value' => '<?php
global $user;
$team_id = arg(2);
$user_id = boincuser_lookup_uid($data->id);
if (!boincteam_is_founder($team_id, $user_id) AND ($user_id != $user->uid)) {
echo l(t(\'Remove\'), "community/teams/{$team_id}/edit/members/remove/{$user_id}");
}
'value' => '<?php
global $user;
$team_id = arg(2);
$user_id = boincuser_lookup_uid($data->id);
if (!boincteam_is_founder($team_id, $user_id) AND ($user_id != $user->uid)) {
echo l(bts(\'Remove\'), "community/teams/{$team_id}/edit/members/remove/{$user_id}");
}
?>',
'exclude' => 1,
'id' => 'phpcode_1',
@ -1824,14 +1824,14 @@ else {
'hide_empty' => 0,
'empty_zero' => 0,
'hide_alter_empty' => 1,
'value' => '<?php
global $user;
if ($data->user_send_email OR boincuser_lookup_uid($data->id) == $user->uid) {
echo $data->user_email_addr;
}
else {
echo \'(\' . t(\'hidden\') . \')\';
}
'value' => '<?php
global $user;
if ($data->user_send_email OR boincuser_lookup_uid($data->id) == $user->uid) {
echo $data->user_email_addr;
}
else {
echo \'(\' . bts(\'hidden\') . \')\';
}
?>',
'exclude' => 0,
'id' => 'phpcode',
@ -1993,13 +1993,13 @@ else {
'hide_empty' => 0,
'empty_zero' => 0,
'hide_alter_empty' => 1,
'value' => '<?php
global $user;
$team_id = arg(2);
$user_id = boincuser_lookup_uid($data->id);
if (!boincteam_is_founder($team_id, $user_id) AND ($user_id != $user->uid)) {
echo l(t(\'Remove\'), "community/teams/{$team_id}/edit/members/remove/{$user_id}");
}
'value' => '<?php
global $user;
$team_id = arg(2);
$user_id = boincuser_lookup_uid($data->id);
if (!boincteam_is_founder($team_id, $user_id) AND ($user_id != $user->uid)) {
echo l(bts(\'Remove\'), "community/teams/{$team_id}/edit/members/remove/{$user_id}");
}
?>',
'exclude' => 0,
'id' => 'phpcode_1',
@ -2370,7 +2370,7 @@ if ($data->user_send_email OR boincuser_lookup_uid($data->id) == $user->uid) {
echo $data->user_email_addr;
}
else {
echo \'(\' . t(\'hidden\') . \')\';
echo \'(\' . bts(\'hidden\') . \')\';
}
?>',
'exclude' => 1,
@ -2538,7 +2538,7 @@ else {
$team_id = arg(2);
$user_id = boincuser_lookup_uid($data->id);
if (!boincteam_is_founder($team_id, $user_id) AND ($user_id != $user->uid)) {
echo l(t(\'Make founder\'), "community/teams/{$team_id}/edit/founder/set/{$user_id}");
echo l(bts(\'Make founder\'), "community/teams/{$team_id}/edit/founder/set/{$user_id}");
}
?>',
'exclude' => 0,
@ -3056,6 +3056,8 @@ else {
$handler->override_option('cache', array(
'type' => 'none',
));
$handler->override_option('header_format', '1');
$handler->override_option('header_empty', 1);
$handler = $view->new_display('panel_pane', 'Top teams pane', 'panel_pane_1');
$handler->override_option('use_more', 1);
$handler->override_option('use_more_always', 1);
@ -3766,7 +3768,7 @@ else {
'value' => '<?php
$team_id = boincteam_lookup_nid($data->id);
$user_id = get_drupal_id($data->team_admin_userid);
echo l(t(\'Remove\'), "community/teams/{$team_id}/edit/admins/remove/{$user_id}");
echo l(bts(\'Remove\'), "community/teams/{$team_id}/edit/admins/remove/{$user_id}");
?>',
'exclude' => 0,
'id' => 'phpcode',
@ -3885,8 +3887,6 @@ echo l(t(\'Remove\'), "community/teams/{$team_id}/edit/admins/remove/{$user_id}"
'relationship' => 'none',
),
));
$handler->override_option('header_format', '1');
$handler->override_option('header_empty', 1);
$handler->override_option('empty', 'There are currently no team admins.');
$handler->override_option('empty_format', '5');
$handler->override_option('style_plugin', 'table');

View File

@ -69,8 +69,10 @@ function user_account_host_list_views_default_views() {
'text' => '',
'make_link' => 0,
'path' => '',
'absolute' => 0,
'link_class' => '',
'alt' => '',
'rel' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
@ -85,8 +87,9 @@ function user_account_host_list_views_default_views() {
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'value' => '<?php
echo l(\'Details\', "host/{$data->id}") . \'&nbsp;|&nbsp;\' . l(\'Tasks\', "host/{$data->id}/tasks");
'hide_alter_empty' => 1,
'value' => '<?php
echo l(bts(\'Details\'), "host/{$data->id}") . \'&nbsp;|&nbsp;\' . l(bts(\'Tasks\'), "host/{$data->id}/tasks");
?>',
'exclude' => 0,
'id' => 'phpcode_3',

View File

@ -221,7 +221,7 @@ function user_profiles_views_default_views() {
switch($data->node_type) {
case \'forum\':
$action = t(\'started discussion\');
$action = bts(\'started discussion\');
$url = "node/{$data->node_nid}";
break;
//case \'wiki_page\':
@ -229,17 +229,17 @@ case \'forum\':
// $url = \'/\' . drupal_lookup_path(\'alias\',"node/{$data->node_nid}");
// break;
case \'story\':
$action = t(\'published\');
$action = bts(\'published\');
//$url = \'/news/blogs/\' . basename(drupal_lookup_path(\'alias\',"node/{$data->node_nid}"));
$url = "node/{$data->node_nid}";
break;
case \'comment\':
$action = t(\'commented on\');
$action = bts(\'commented on\');
$url = "node/{$data->node_nid}";
$fragment = "comment-{$data->vid}";
break;
default:
$action = t(\'posted\');
$action = bts(\'posted\');
}
$uid = $data->users_node_revisions_uid;

View File

@ -53,14 +53,16 @@ function work_and_host_stats_views_default_views() {
'relationship' => 'none',
),
'workunitid' => array(
'label' => 'Work unit ID',
'label' => 'Workunit ID',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 1,
'path' => 'workunit/[workunitid]',
'absolute' => 0,
'link_class' => '',
'alt' => '',
'rel' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
@ -75,10 +77,14 @@ function work_and_host_stats_views_default_views() {
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'hide_alter_empty' => 1,
'set_precision' => FALSE,
'precision' => 0,
'decimal' => '.',
'separator' => '',
'format_plural' => 0,
'format_plural_singular' => '1',
'format_plural_plural' => '@count',
'prefix' => '',
'suffix' => '',
'exclude' => 0,
@ -508,14 +514,16 @@ function work_and_host_stats_views_default_views() {
'relationship' => 'none',
),
'elapsed_time' => array(
'label' => 'Run time (sec)',
'label' => 'Run time',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'absolute' => 0,
'link_class' => '',
'alt' => '',
'rel' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
@ -530,10 +538,14 @@ function work_and_host_stats_views_default_views() {
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'hide_alter_empty' => 1,
'set_precision' => 1,
'precision' => '2',
'decimal' => '.',
'separator' => ',',
'format_plural' => 0,
'format_plural_singular' => '1',
'format_plural_plural' => '@count',
'prefix' => '',
'suffix' => '',
'exclude' => 0,
@ -543,14 +555,16 @@ function work_and_host_stats_views_default_views() {
'relationship' => 'none',
),
'cpu_time' => array(
'label' => 'CPU time (sec)',
'label' => 'CPU time',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'absolute' => 0,
'link_class' => '',
'alt' => '',
'rel' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
@ -565,10 +579,14 @@ function work_and_host_stats_views_default_views() {
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'hide_alter_empty' => 1,
'set_precision' => 1,
'precision' => '2',
'decimal' => '.',
'separator' => ',',
'format_plural' => 0,
'format_plural_singular' => '1',
'format_plural_plural' => '@count',
'prefix' => '',
'suffix' => '',
'exclude' => 0,
@ -1671,13 +1689,15 @@ function work_and_host_stats_views_default_views() {
if ($showIP) {
$last_ip = $data->host_last_ip_addr;
if ($last_ip) {
echo "{$data->host_last_ip_addr} (same the last {$data->host_nsame_ip_addr} times)";
echo bts(\'@ip_address (same the last @count times)\',
array(\'@ip_address\' => $data->host_last_ip_addr, \'@count\' => $data->host_nsame_ip_addr)
);
}
else {
echo \'n/a\';
}
} else {
echo l(\'Show IP address\', arg(0).\'/\'.arg(1).\'/1\');
echo l(bts(\'Show IP address\'), arg(0).\'/\'.arg(1).\'/1\');
}
}
?>',
@ -1829,8 +1849,10 @@ function work_and_host_stats_views_default_views() {
'text' => '',
'make_link' => 0,
'path' => '',
'absolute' => 0,
'link_class' => '',
'alt' => '',
'rel' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
@ -1845,10 +1867,11 @@ function work_and_host_stats_views_default_views() {
'empty' => '',
'hide_empty' => 1,
'empty_zero' => 0,
'value' => '<?php
if (is_current_boinc_user($data->host_userid)) {
echo \'UTC \' . ($data->host_timezone > 0 ? \'+\' : \'\') . $data->host_timezone / 3600 . \' hours\';
}
'hide_alter_empty' => 1,
'value' => '<?php
if (is_current_boinc_user($data->host_userid)) {
echo \'UTC \' . ($data->host_timezone > 0 ? \'+\' : \'\') . $data->host_timezone / 3600 . \' \' . bts(\'hours\');
}
?>',
'exclude' => 0,
'id' => 'phpcode_4',
@ -1922,7 +1945,7 @@ function work_and_host_stats_views_default_views() {
$owner = BoincUser::lookup_id($data->host_userid);
$drupal_id = get_drupal_id($owner->id);
$profile_link = ($drupal_id) ? l($owner->name, "user/{$drupal_id}") : $owner->name;
echo ($owner->show_hosts) ? $profile_link : \'Anonymous\';
echo ($owner->show_hosts) ? $profile_link : bts(\'Anonymous\');
}
?>',
'exclude' => 0,
@ -2891,8 +2914,10 @@ function work_and_host_stats_views_default_views() {
'text' => '',
'make_link' => 0,
'path' => '',
'absolute' => 0,
'link_class' => '',
'alt' => '',
'rel' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
@ -2907,8 +2932,11 @@ function work_and_host_stats_views_default_views() {
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'value' => '<?php
echo round($data->host_p_fpops/(1000*1000), 2) . \' million ops/sec\';
'hide_alter_empty' => 1,
'value' => '<?php
echo bts(\'@count million ops/sec\',
array(\'@count\' => round($data->host_p_fpops/(1000*1000), 2))
);
?>',
'exclude' => 0,
'id' => 'phpcode_13',
@ -2923,8 +2951,10 @@ function work_and_host_stats_views_default_views() {
'text' => '',
'make_link' => 0,
'path' => '',
'absolute' => 0,
'link_class' => '',
'alt' => '',
'rel' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
@ -2939,8 +2969,11 @@ function work_and_host_stats_views_default_views() {
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'value' => '<?php
echo round($data->host_p_iops/(1000*1000), 2) . \' million ops/sec\';
'hide_alter_empty' => 1,
'value' => '<?php
echo bts(\'@count million ops/sec\',
array(\'@count\' => round($data->host_p_iops/(1000*1000), 2))
);
?>',
'exclude' => 0,
'id' => 'phpcode_14',
@ -2955,8 +2988,10 @@ function work_and_host_stats_views_default_views() {
'text' => '',
'make_link' => 0,
'path' => '',
'absolute' => 0,
'link_class' => '',
'alt' => '',
'rel' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
@ -2971,9 +3006,10 @@ function work_and_host_stats_views_default_views() {
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'value' => '<?php
$rate = round($data->host_n_bwup/(1024), 2);
echo ($rate > 0) ? "{$rate} KiB/sec" : \'Unknown\';
'hide_alter_empty' => 1,
'value' => '<?php
$rate = round($data->host_n_bwup/(1024), 2);
echo ($rate > 0) ? bts(\'@rate KiB/sec\', array(\'@rate\' => $rate)) : bts(\'Unknown\');
?>',
'exclude' => 0,
'id' => 'phpcode_15',
@ -2988,8 +3024,10 @@ function work_and_host_stats_views_default_views() {
'text' => '',
'make_link' => 0,
'path' => '',
'absolute' => 0,
'link_class' => '',
'alt' => '',
'rel' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
@ -3004,9 +3042,10 @@ function work_and_host_stats_views_default_views() {
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'value' => '<?php
$rate = round($data->host_n_bwdown/(1024), 2);
echo ($rate > 0) ? "{$rate} KiB/sec" : \'Unknown\';
'hide_alter_empty' => 1,
'value' => '<?php
$rate = round($data->host_n_bwdown/(1024), 2);
echo ($rate > 0) ? bts(\'@rate KiB/sec\', array(\'@rate\' => $rate)) : bts(\'Unknown\');
?>',
'exclude' => 0,
'id' => 'phpcode_16',
@ -3021,8 +3060,10 @@ function work_and_host_stats_views_default_views() {
'text' => '',
'make_link' => 0,
'path' => '',
'absolute' => 0,
'link_class' => '',
'alt' => '',
'rel' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
@ -3037,8 +3078,9 @@ function work_and_host_stats_views_default_views() {
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'value' => '<?php
echo round($data->host_avg_turnaround/(60*60*24), 2) . \' days\';
'hide_alter_empty' => 1,
'value' => '<?php
echo bts(\'@count days\', array(\'@count\' => round($data->host_avg_turnaround/(60*60*24), 2)));
?>',
'exclude' => 0,
'id' => 'phpcode_17',
@ -4850,8 +4892,10 @@ Cross-project stats:
'text' => '',
'make_link' => 0,
'path' => '',
'absolute' => 0,
'link_class' => '',
'alt' => '',
'rel' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
@ -4866,8 +4910,9 @@ Cross-project stats:
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'value' => '<?php
echo l(\'Details\', "host/{$data->id}") . \'&nbsp;|&nbsp;\' . l(\'Tasks\', "host/{$data->id}/tasks");
'hide_alter_empty' => 1,
'value' => '<?php
echo l(bts(\'Details\'), "host/{$data->id}") . \'&nbsp;|&nbsp;\' . l(bts(\'Tasks\'), "host/{$data->id}/tasks");
?>',
'exclude' => 0,
'id' => 'phpcode_3',
@ -5766,8 +5811,10 @@ Cross-project stats:
'text' => '',
'make_link' => 0,
'path' => '',
'absolute' => 0,
'link_class' => '',
'alt' => '',
'rel' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
@ -5782,14 +5829,18 @@ Cross-project stats:
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'value' => '<?php
echo l(\'Details\', "host/{$data->id}") . \'&nbsp;|&nbsp;\' . l(\'Tasks\', "host/{$data->id}/tasks");
'hide_alter_empty' => 1,
'value' => '<?php
echo l(bts(\'Details\'), "host/{$data->id}") . \'&nbsp;|&nbsp;\' . l(bts(\'Tasks\'), "host/{$data->id}/tasks");
?>',
'exclude' => 0,
'id' => 'phpcode_3',
'table' => 'customfield',
'field' => 'phpcode',
'relationship' => 'none',
'override' => array(
'button' => 'Use default',
),
),
'host_cpid' => array(
'label' => 'Cross project ID',
@ -5923,13 +5974,13 @@ Cross-project stats:
'hide_empty' => 0,
'empty_zero' => 0,
'hide_alter_empty' => 1,
'value' => '<?php
$uid = get_drupal_id($data->user_host_id);
if ($data->user_host_show_hosts) {
echo l($data->user_host_name, "user/{$uid}");
}
else {
echo \'Anonymous\';
'value' => '<?php
$uid = get_drupal_id($data->user_host_id);
if ($data->user_host_show_hosts) {
echo l($data->user_host_name, "user/{$uid}");
}
else {
echo bts(\'Anonymous\');
}',
'exclude' => 0,
'id' => 'phpcode_5',
@ -6837,14 +6888,16 @@ else {
'relationship' => 'none',
),
'elapsed_time' => array(
'label' => 'Run time (sec)',
'label' => 'Run time',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'absolute' => 0,
'link_class' => '',
'alt' => '',
'rel' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
@ -6859,10 +6912,14 @@ else {
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'hide_alter_empty' => 1,
'set_precision' => 1,
'precision' => '2',
'decimal' => '.',
'separator' => ',',
'format_plural' => 0,
'format_plural_singular' => '1',
'format_plural_plural' => '@count',
'prefix' => '',
'suffix' => '',
'exclude' => 0,
@ -6872,14 +6929,16 @@ else {
'relationship' => 'none',
),
'cpu_time' => array(
'label' => 'CPU time (sec)',
'label' => 'CPU time',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'absolute' => 0,
'link_class' => '',
'alt' => '',
'rel' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
@ -6894,10 +6953,14 @@ else {
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'hide_alter_empty' => 1,
'set_precision' => 1,
'precision' => '2',
'decimal' => '.',
'separator' => ',',
'format_plural' => 0,
'format_plural_singular' => '1',
'format_plural_plural' => '@count',
'prefix' => '',
'suffix' => '',
'exclude' => 0,
@ -9523,8 +9586,10 @@ else {
'text' => '',
'make_link' => 0,
'path' => '',
'absolute' => 0,
'link_class' => '',
'alt' => '',
'rel' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
@ -9539,12 +9604,13 @@ else {
'empty' => '',
'hide_empty' => 1,
'empty_zero' => 0,
'value' => '<?php
if ($data->app_target_nresults <= 0 OR $data->workunit_canonical_resultid) {
if ($data->workunit_need_validate) {
echo \'Pending\';
}
}
'hide_alter_empty' => 1,
'value' => '<?php
if ($data->app_target_nresults <= 0 OR $data->workunit_canonical_resultid) {
if ($data->workunit_need_validate) {
echo bts(\'Pending\');
}
}
?>',
'exclude' => 0,
'id' => 'phpcode_7',
@ -10093,14 +10159,16 @@ else {
'relationship' => 'none',
),
'elapsed_time' => array(
'label' => 'Run time (sec)',
'label' => 'Run time',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'absolute' => 0,
'link_class' => '',
'alt' => '',
'rel' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
@ -10115,10 +10183,14 @@ else {
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'hide_alter_empty' => 1,
'set_precision' => 1,
'precision' => '2',
'decimal' => '.',
'separator' => ',',
'format_plural' => 0,
'format_plural_singular' => '1',
'format_plural_plural' => '@count',
'prefix' => '',
'suffix' => '',
'exclude' => 0,
@ -10128,14 +10200,16 @@ else {
'relationship' => 'none',
),
'cpu_time' => array(
'label' => 'CPU time (sec)',
'label' => 'CPU time',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'absolute' => 0,
'link_class' => '',
'alt' => '',
'rel' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
@ -10150,10 +10224,14 @@ else {
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'hide_alter_empty' => 1,
'set_precision' => 1,
'precision' => '2',
'decimal' => '.',
'separator' => ',',
'format_plural' => 0,
'format_plural_singular' => '1',
'format_plural_plural' => '@count',
'prefix' => '',
'suffix' => '',
'exclude' => 0,