Browse files

Replace plugin_lang_get with new gettext approach (part 2)

  • Loading branch information...
1 parent 5bf9b2e commit 52c646c8d33336404b46ec3ad96a9d0c2d50fce7 @grangeway grangeway committed Feb 4, 2013
Showing with 118 additions and 151 deletions.
  1. +6 −39 core/plugin_api.php
  2. +3 −3 plugins/MantisCoreFormatting/MantisCoreFormatting.php
  3. +12 −12 plugins/MantisCoreFormatting/pages/config.php
  4. +11 −11 plugins/MantisGraph/MantisGraph.php
  5. +11 −11 plugins/MantisGraph/core/Period.php
  6. +14 −14 plugins/MantisGraph/core/graph_api.php
  7. +1 −1 plugins/MantisGraph/pages/bug_graph_bystatus.php
  8. +9 −9 plugins/MantisGraph/pages/bug_graph_page.php
  9. +14 −14 plugins/MantisGraph/pages/config.php
  10. +1 −1 plugins/MantisGraph/pages/summary_graph_bycategory_pct.php
  11. +1 −1 plugins/MantisGraph/pages/summary_graph_bypriority_mix.php
  12. +1 −1 plugins/MantisGraph/pages/summary_graph_bypriority_pct.php
  13. +1 −1 plugins/MantisGraph/pages/summary_graph_byresolution_mix.php
  14. +1 −1 plugins/MantisGraph/pages/summary_graph_byresolution_pct.php
  15. +1 −1 plugins/MantisGraph/pages/summary_graph_byseverity_mix.php
  16. +1 −1 plugins/MantisGraph/pages/summary_graph_byseverity_pct.php
  17. +1 −1 plugins/MantisGraph/pages/summary_graph_bystatus_pct.php
  18. +1 −1 plugins/MantisGraph/pages/summary_graph_imp_category.php
  19. +1 −1 plugins/MantisGraph/pages/summary_graph_imp_priority.php
  20. +1 −1 plugins/MantisGraph/pages/summary_graph_imp_resolution.php
  21. +1 −1 plugins/MantisGraph/pages/summary_graph_imp_severity.php
  22. +1 −1 plugins/MantisGraph/pages/summary_graph_imp_status.php
  23. +5 −5 plugins/XmlImportExport/XmlImportExport.php
  24. +18 −18 plugins/XmlImportExport/pages/import.php
  25. +1 −1 plugins/XmlImportExport/pages/import_action.php
View
45 core/plugin_api.php
@@ -33,7 +33,6 @@
* @uses event_api.php
* @uses helper_api.php
* @uses history_api.php
- * @uses lang_api.php
*/
require_api( 'access_api.php' );
@@ -43,7 +42,6 @@
require_api( 'event_api.php' );
require_api( 'helper_api.php' );
require_api( 'history_api.php' );
-require_api( 'lang_api.php' );
# Cache variables #####
@@ -241,25 +239,6 @@ function plugin_config_defaults( $p_options ) {
}
/**
- * Get a language string for the plugin.
- * Automatically prepends plugin_<basename> to the string requested.
- * @param string $p_name Language string name
- * @param string $p_basename Plugin basename
- * @return string Language string
- */
-function plugin_lang_get( $p_name, $p_basename = null ) {
- if( is_null( $p_basename ) ) {
- $t_basename = plugin_get_current();
- } else {
- $t_basename = $p_basename;
- }
-
- $t_name = 'plugin_' . $t_basename . '_' . $p_name;
-
- return lang_get( $t_name );
-}
-
-/**
* log history event from plugin
* @param int $p_bug_id bug id
* @param string $p_field_name field name
@@ -281,24 +260,6 @@ function plugin_history_log( $p_bug_id, $p_field_name, $p_old_value, $p_new_valu
}
/**
- * Trigger a plugin-specific error with the given name and type.
- * @param string $p_error_name Error name
- * @param int $p_error_type Error type
- * @param string $p_basename Plugin basename
- */
-function plugin_error( $p_error_name, $p_error_type = ERROR, $p_basename = null ) {
- if( is_null( $p_basename ) ) {
- $t_basename = plugin_get_current();
- } else {
- $t_basename = $p_basename;
- }
-
- $t_error_code = "plugin_${t_basename}_${p_error_name}";
-
- trigger_error( $t_error_code, $p_error_type );
-}
-
-/**
* Hook a plugin's callback function to an event.
* @param string $p_name Event name
* @param string $p_callback Callback function
@@ -751,6 +712,7 @@ function plugin_include( $p_basename, $p_child = null ) {
* @return mixed
*/
function plugin_register( $p_basename, $p_return = false, $p_child = null ) {
+ global $localeManager;
global $g_plugin_cache;
$t_basename = is_null( $p_child ) ? $p_basename : $p_child;
@@ -772,6 +734,11 @@ function plugin_register( $p_basename, $p_return = false, $p_child = null ) {
if( class_exists( $t_classname ) && is_subclass_of( $t_classname, 'MantisPlugin' ) ) {
plugin_push_current( is_null( $p_child ) ? $p_basename : $p_child );
+ # Load the plugin's default text domain
+ $t_locale_path = config_get( 'plugin_path' );
+ $t_locale_path .= $p_basename . '/locale/';
+ $localeManager->addTextDomain('plugin_' . $p_basename, $t_locale_path);
+
$t_plugin = new $t_classname( is_null( $p_child ) ? $p_basename : $p_child );
plugin_pop_current();
View
6 plugins/MantisCoreFormatting/MantisCoreFormatting.php
@@ -27,11 +27,11 @@ class MantisCoreFormattingPlugin extends MantisFormattingPlugin {
* A method that populates the plugin information and minimum requirements.
*/
function register( ) {
- $this->name = lang_get( 'plugin_format_title' );
- $this->description = lang_get( 'plugin_format_description' );
+ $this->name = d___('plugin_MantisCoreFormatting', 'MantisBT Formatting');
+ $this->description = d___('plugin_MantisCoreFormatting', 'Official text processing and formatting plugin.');
$this->page = 'config';
- $this->version = '1.0a';
+ $this->version = '2.0.0';
$this->requires = array(
'MantisCore' => '2.0.0',
);
View
24 plugins/MantisCoreFormatting/pages/config.php
@@ -25,7 +25,7 @@
auth_reauthenticate( );
access_ensure_global_level( config_get( 'manage_plugin_threshold' ) );
-html_page_top( lang_get( 'plugin_format_title' ) );
+html_page_top( d___('plugin_MantisCoreFormatting', 'MantisBT Formatting') );
print_manage_menu( );
@@ -45,50 +45,50 @@
<tr>
<td class="form-title" colspan="3">
- <?php echo lang_get( 'plugin_format_title' ) . ': ' . lang_get( 'plugin_format_config' )?>
+ <?php echo d___('plugin_MantisCoreFormatting', 'MantisBT Formatting Configuration') ?>
</td>
</tr>
<tr>
<td class="category">
- <?php echo lang_get( 'plugin_format_process_text' )?>
- <br /><span class="small"><?php echo lang_get( 'plugin_format_process_text_warning_notice' )?></span>
+ <?php echo d___('plugin_MantisCoreFormatting', 'Text Processing') ?>
+ <br /><span class="small"><?php echo d___('plugin_MantisCoreFormatting', 'Do not turn off unless you really know what you\'re doing. In the off state, cross site scripting (XSS) attacks are possible.') ?></span>
</td>
<td class="center">
<label><input type="radio" name="process_text" value="1" <?php echo( ON == plugin_config_get( 'process_text' ) ) ? 'checked="checked" ' : ''?>/>
- <?php echo lang_get( 'plugin_format_enabled' )?></label>
+ <?php echo d___('plugin_MantisCoreFormatting', 'On') ?></label>
</td>
<td class="center">
<label><input type="radio" name="process_text" value="0" <?php echo( OFF == plugin_config_get( 'process_text' ) ) ? 'checked="checked" ' : ''?>/>
- <?php echo lang_get( 'plugin_format_disabled' )?></label>
+ <?php echo d___('plugin_MantisCoreFormatting', 'Off') ?></label>
</td>
</tr>
<tr>
<th class="category">
- <?php echo lang_get( 'plugin_format_process_urls' )?>
+ <?php echo d___('plugin_MantisCoreFormatting', 'URL Processing') ?>
</th>
<td class="center">
<label><input type="radio" name="process_urls" value="1" <?php echo( ON == plugin_config_get( 'process_urls' ) ) ? 'checked="checked" ' : ''?>/>
- <?php echo lang_get( 'plugin_format_enabled' )?></label>
+ <?php echo d___('plugin_MantisCoreFormatting', 'On') ?></label>
</td>
<td class="center">
<label><input type="radio" name="process_urls" value="0" <?php echo( OFF == plugin_config_get( 'process_urls' ) ) ? 'checked="checked" ' : ''?>/>
- <?php echo lang_get( 'plugin_format_disabled' )?></label>
+ <?php echo d___('plugin_MantisCoreFormatting', 'Off') ?></label>
</td>
</tr>
<tr>
<th class="category">
- <?php echo lang_get( 'plugin_format_process_buglinks' )?>
+ <?php echo d___('plugin_MantisCoreFormatting', 'MantisBT Links ( Issue/Issuenote )') ?>
</th>
<td class="center">
<label><input type="radio" name="process_buglinks" value="1" <?php echo( ON == plugin_config_get( 'process_buglinks' ) ) ? 'checked="checked" ' : ''?>/>
- <?php echo lang_get( 'plugin_format_enabled' )?></label>
+ <?php echo d___('plugin_MantisCoreFormatting', 'On') ?></label>
</td>
<td class="center">
<label><input type="radio" name="process_buglinks" value="0" <?php echo( OFF == plugin_config_get( 'process_buglinks' ) ) ? 'checked="checked" ' : ''?>/>
- <?php echo lang_get( 'plugin_format_disabled' )?></label>
+ <?php echo d___('plugin_MantisCoreFormatting', 'Off') ?></label>
</td>
</tr>
View
22 plugins/MantisGraph/MantisGraph.php
@@ -26,11 +26,11 @@ class MantisGraphPlugin extends MantisPlugin {
* A method that populates the plugin information and minimum requirements.
*/
function register( ) {
- $this->name = lang_get( 'plugin_graph_title' );
- $this->description = lang_get( 'plugin_graph_description' );
+ $this->name = d___('plugin_MantisGraph', 'Mantis Graphs');
+ $this->description = d___('plugin_MantisGraph', 'Official graph plugin.');
$this->page = 'config';
- $this->version = '1.0';
+ $this->version = '2.0.0';
$this->requires = array(
'MantisCore' => '2.0.0',
);
@@ -94,26 +94,26 @@ function hooks( ) {
* generate summary menu
*/
function summary_menu( ) {
- return array( '<a href="' . plugin_page( 'summary_jpgraph_page' ) . '">' . plugin_lang_get( 'menu_advanced_summary' ) . '</a>', );
+ return array( '<a href="' . plugin_page( 'summary_jpgraph_page' ) . '">' . d___('plugin_MantisGraph', 'Advanced Summary') . '</a>', );
}
/**
* generate graph filter menu
*/
function graph_filter_menu( ) {
- return array( '<a href="' . plugin_page( 'bug_graph_page.php' ) . '">' . plugin_lang_get( 'graph_bug_page_link' ) . '</a>', );
+ return array( '<a href="' . plugin_page( 'bug_graph_page.php' ) . '">' . d___('plugin_MantisGraph', 'Graph') . '</a>', );
}
/**
* generate summary submenu
*/
function summary_submenu( ) {
- return array( '<a href="' . helper_mantis_url( 'summary_page.php' ) . '"><img src="' . helper_mantis_url( 'themes/' . config_get( 'theme' ) . '/images/synthese.png' ) . '" alt="" />' . plugin_lang_get( 'synthesis_link' ) . '</a>',
- '<a href="' . plugin_page( 'summary_graph_imp_status.php' ) . '"><img src="' . helper_mantis_url( 'themes/' . config_get( 'theme' ) . '/images/synthgraph.png' ) . '" alt="" />' . plugin_lang_get( 'status_link' ) . '</a>',
- '<a href="' . plugin_page( 'summary_graph_imp_priority.php' ) . '"><img src="' . helper_mantis_url( 'themes/' . config_get( 'theme' ) . '/images/synthgraph.png' ) . '" alt="" />' . plugin_lang_get( 'priority_link' ) . '</a>',
- '<a href="' . plugin_page( 'summary_graph_imp_severity.php' ) . '"><img src="' . helper_mantis_url( 'themes/' . config_get( 'theme' ) . '/images/synthgraph.png' ) . '" alt="" />' . plugin_lang_get( 'severity_link' ) . '</a>',
- '<a href="' . plugin_page( 'summary_graph_imp_category.php' ) . '"><img src="' . helper_mantis_url( 'themes/' . config_get( 'theme' ) . '/images/synthgraph.png' ) . '" alt="" />' . plugin_lang_get( 'category_link' ) . '</a>',
- '<a href="' . plugin_page( 'summary_graph_imp_resolution.php' ) . '"><img src="' . helper_mantis_url( 'themes/' . config_get( 'theme' ) . '/images/synthgraph.png' ) . '" alt="" />' . plugin_lang_get( 'resolution_link' ) . '</a>',
+ return array( '<a href="' . helper_mantis_url( 'summary_page.php' ) . '"><img src="' . $t_icon_path . 'synthese.gif" alt="" />' . d___('plugin_MantisGraph', 'Synthesis') . '</a>',
+ '<a href="' . plugin_page( 'summary_graph_imp_status.php' ) . '"><img src="' . $t_icon_path . 'synthgraph.gif" alt="" />' . d___('plugin_MantisGraph', 'Per state') . '</a>',
+ '<a href="' . plugin_page( 'summary_graph_imp_priority.php' ) . '"><img src="' . $t_icon_path . 'synthgraph.gif" alt="" />' . d___('plugin_MantisGraph', 'Per priority') . '</a>',
+ '<a href="' . plugin_page( 'summary_graph_imp_severity.php' ) . '"><img src="' . $t_icon_path . 'synthgraph.gif" alt="" />' . d___('plugin_MantisGraph', 'Per severity') . '</a>',
+ '<a href="' . plugin_page( 'summary_graph_imp_category.php' ) . '"><img src="' . $t_icon_path . 'synthgraph.gif" alt="" />' . d___('plugin_MantisGraph', 'Per category') . '</a>',
+ '<a href="' . plugin_page( 'summary_graph_imp_resolution.php' ) . '"><img src="' . $t_icon_path . 'synthgraph.gif" alt="" />' . d___('plugin_MantisGraph', 'Per resolution') . '</a>',
);
}
}
View
22 plugins/MantisGraph/core/Period.php
@@ -256,17 +256,17 @@ function get_elapsed_days() {
*/
function period_selector( $p_control_name ) {
$t_periods = array(
- 0 => plugin_lang_get( 'period_none' ),
- 7 => plugin_lang_get( 'period_this_week' ),
- 8 => plugin_lang_get( 'period_last_week' ),
- 9 => plugin_lang_get( 'period_two_weeks' ),
- 1 => plugin_lang_get( 'period_this_month' ),
- 2 => plugin_lang_get( 'period_last_month' ),
- 3 => plugin_lang_get( 'period_this_quarter' ),
- 4 => plugin_lang_get( 'period_last_quarter' ),
- 5 => plugin_lang_get( 'period_year_to_date' ),
- 6 => plugin_lang_get( 'period_last_year' ),
- 10 => plugin_lang_get( 'period_select' ),
+ 0 => d___('plugin_MantisGraph', 'None'),
+ 7 => d___('plugin_MantisGraph', 'This Week'),
+ 8 => d___('plugin_MantisGraph', 'Last Week'),
+ 9 => d___('plugin_MantisGraph', 'Last Two Weeks'),
+ 1 => d___('plugin_MantisGraph', 'This Month'),
+ 2 => d___('plugin_MantisGraph', 'Last Month'),
+ 3 => d___('plugin_MantisGraph', 'This Quarter'),
+ 4 => d___('plugin_MantisGraph', 'Last Quarter'),
+ 5 => d___('plugin_MantisGraph', 'Year to Date'),
+ 6 => d___('plugin_MantisGraph', 'Last Year'),
+ 10 => d___('plugin_MantisGraph', 'Arbitrary Dates'),
);
$t_default = gpc_get_int( $p_control_name, 0 );
$t_formatted_start = $this->get_start_formatted();
View
28 plugins/MantisGraph/core/graph_api.php
@@ -272,23 +272,23 @@ function graph_group( $p_metrics, $p_title = '', $p_graph_width = 350, $p_graph_
$tot = new BarPlot( array_values( $total ) );
$tot->SetFillColor( 'lightblue' );
$tot->SetWidth( 0.7 );
- $tot->SetLegend( plugin_lang_get( 'legend_total' ) );
+ $tot->SetLegend( d___('plugin_MantisGraph', 'Total') );
$graph->Add( $tot );
$p1 = new BarPlot( array_values( $p_metrics['open'] ) );
$p1->SetFillColor( 'yellow' );
$p1->SetWidth( 1 );
- $p1->SetLegend( plugin_lang_get( 'legend_opened' ) );
+ $p1->SetLegend( d___('plugin_MantisGraph', 'Opened') );
$p2 = new BarPlot( array_values( $p_metrics['closed'] ) );
$p2->SetFillColor( 'blue' );
$p2->SetWidth( 1 );
- $p2->SetLegend( plugin_lang_get( 'legend_closed' ) );
+ $p2->SetLegend( d___('plugin_MantisGraph', 'Closed') );
$p3 = new BarPlot( array_values( $p_metrics['resolved'] ) );
$p3->SetFillColor( 'red' );
$p3->SetWidth( 1 );
- $p3->SetLegend( plugin_lang_get( 'legend_resolved' ) );
+ $p3->SetLegend( d___('plugin_MantisGraph', 'Resolved') );
$gbplot = new GroupBarPlot( array( $p1, $p3, $p2 ) );
$graph->Add( $gbplot );
@@ -389,7 +389,7 @@ function graph_pie( $p_metrics, $p_title = '', $p_graph_width = 500, $p_graph_he
function graph_cumulative_bydate( $p_metrics, $p_graph_width = 300, $p_graph_height = 380 ) {
$t_graph_font = graph_get_font();
- error_check( is_array( $p_metrics ) ? count( $p_metrics ) : 0, plugin_lang_get( 'cumulative' ) . ' ' . _( 'By Date (days)' ) );
+ error_check( is_array( $p_metrics ) ? count( $p_metrics ) : 0, d___('plugin_MantisGraph', 'Cumulative by date (days)') );
if ( plugin_config_get( 'eczlibrary' ) == ON ) {
$graph = new ezcGraphLineChart();
@@ -402,15 +402,15 @@ function graph_cumulative_bydate( $p_metrics, $p_graph_width = 300, $p_graph_hei
$graph->xAxis = new ezcGraphChartElementNumericAxis();
$graph->data[0] = new ezcGraphArrayDataSet( $p_metrics[0] );
- $graph->data[0]->label = plugin_lang_get( 'legend_reported' );
+ $graph->data[0]->label = d___('plugin_MantisGraph', 'Reported');
$graph->data[0]->color = '#FF0000';
$graph->data[1] = new ezcGraphArrayDataSet( $p_metrics[1] );
- $graph->data[1]->label = plugin_lang_get( 'legend_resolved' );
+ $graph->data[1]->label = d___('plugin_MantisGraph', 'Resolved');
$graph->data[1]->color = '#0000FF';
$graph->data[2] = new ezcGraphArrayDataSet( $p_metrics[2] );
- $graph->data[2]->label = plugin_lang_get( 'legend_still_open' );
+ $graph->data[2]->label = d___('plugin_MantisGraph', 'Still Open');
$graph->data[2]->color = '#000000';
$graph->additionalAxis[2] = $nAxis = new ezcGraphChartElementNumericAxis();
@@ -433,7 +433,7 @@ function graph_cumulative_bydate( $p_metrics, $p_graph_width = 300, $p_graph_hei
$graph->driver->options->jpegQuality = 100;
$graph->driver->options->imageFormat = IMG_JPEG;
- $graph->title = plugin_lang_get( 'cumulative' ) . ' ' . _( 'By Date (days)' );
+ $graph->title = d___('plugin_MantisGraph', 'Cumulative by date (days)');
$graph->options->font = $t_graph_font ;
$graph->renderToOutput( $p_graph_width, $p_graph_height);
@@ -457,7 +457,7 @@ function graph_cumulative_bydate( $p_metrics, $p_graph_width = 300, $p_graph_hei
$graph->SetY2Scale("lin");
$graph->SetMarginColor( 'white' );
$graph->SetFrame( false );
- $graph->title->Set( plugin_lang_get( 'cumulative' ) . ' ' . _( 'By Date (days)' ) );
+ $graph->title->Set( d___('plugin_MantisGraph', 'Cumulative by date (days)') );
$graph->title->SetFont( $t_graph_font, FS_BOLD );
$graph->legend->Pos( 0.05, 0.9, 'right', 'bottom' );
@@ -482,19 +482,19 @@ function graph_cumulative_bydate( $p_metrics, $p_graph_width = 300, $p_graph_hei
$p1 = new LinePlot( $reported_plot, $plot_date );
$p1->SetColor( 'blue' );
$p1->SetCenter();
- $p1->SetLegend( plugin_lang_get( 'legend_reported' ) );
+ $p1->SetLegend( d___('plugin_MantisGraph', 'Reported') );
$graph->AddY2( $p1 );
$p3 = new LinePlot( $still_open_plot, $plot_date );
$p3->SetColor( 'red' );
$p3->SetCenter();
- $p3->SetLegend( plugin_lang_get( 'legend_still_open' ) );
+ $p3->SetLegend( d___('plugin_MantisGraph', 'Still Open') );
$graph->Add( $p3 );
$p2 = new LinePlot( $resolved_plot, $plot_date );
$p2->SetColor( 'black' );
$p2->SetCenter();
- $p2->SetLegend( plugin_lang_get( 'legend_resolved' ) );
+ $p2->SetLegend( d___('plugin_MantisGraph', 'Resolved') );
$graph->AddY2( $p2 );
if( helper_show_query_count() ) {
@@ -932,7 +932,7 @@ function error_check( $p_bug_count, $p_title ) {
if( 0 == $p_bug_count ) {
$t_graph_font = graph_get_font();
- error_text( $p_title, plugin_lang_get( 'not_enough_data' ) );
+ error_text( $title, d___('plugin_MantisGraph', 'Not enough data to create graph') );
}
}
View
2 plugins/MantisGraph/pages/bug_graph_bystatus.php
@@ -149,7 +149,7 @@
ksort($t_view_status);
/* @todo - these should probably be separate strings, but in the summary page context,
the string is used as the title for all columns */
-$t_label_string = lang_get( 'orct' ); //use the (open/resolved/closed/total) label
+$t_label_string = d___('plugin_MantisGraph', '(open/resolved/closed/total)');
$t_label_strings = explode('/', mb_substr($t_label_string, 1, strlen($t_label_string)-2));
// add headers for table
View
18 plugins/MantisGraph/pages/bug_graph_page.php
@@ -49,20 +49,20 @@
$f_type = gpc_get_int( 'graph_type', 0 );
$f_show_as_table = gpc_get_bool( 'show_table', FALSE );
-html_page_top1( plugin_lang_get( 'graph_page' ) );
+html_page_top1( d___('plugin_MantisGraph', 'Graph Issue History') );
$t_path = config_get( 'path' );
html_page_top2();
$t_period = new Period();
$t_period->set_period_from_selector( 'interval' );
-$t_types = array( 0 => plugin_lang_get( 'select' ),
- 2 => plugin_lang_get( 'select_bystatus'),
- 3 => plugin_lang_get( 'select_summbystatus'),
- 4 => plugin_lang_get( 'select_bycat'),
- 6 => plugin_lang_get( 'select_both') );
+$t_types = array( 0 => d___('plugin_MantisGraph', 'Please Select'),
+ 2 => d___('plugin_MantisGraph', 'by Status'),
+ 3 => d___('plugin_MantisGraph', 'Summary by Status'),
+ 4 => d___('plugin_MantisGraph', 'Summary by Category'),
+ 6 => d___('plugin_MantisGraph', 'Summary by Status and Category') );
-$t_show = array( 0 => plugin_lang_get( 'show_as_graph' ),
- 1 => plugin_lang_get( 'show_as_table' ) );
+$t_show = array( 0 => d___('plugin_MantisGraph', 'Show as Graph'),
+ 1 => d___('plugin_MantisGraph', 'Show as Table') );
?>
<form name="graph_form" method="post" action="<?php echo plugin_page( 'bug_graph_page.php' ); ?>">
<table class="width100" cellspacing="1">
@@ -78,7 +78,7 @@
<?php echo get_dropdown( $t_show, 'show_table', $f_show_as_table ? 1 : 0 ); ?>
</td>
<td>
- <input type="submit" name="show" value="<?php echo plugin_lang_get( 'show_graph' ); ?>" />
+ <input type="submit" name="show" value="<?php echo d___('plugin_MantisGraph', 'Show Graph'); ?>" />
</td>
</tr>
</table>
View
28 plugins/MantisGraph/pages/config.php
@@ -25,7 +25,7 @@
auth_reauthenticate( );
access_ensure_global_level( config_get( 'manage_plugin_threshold' ) );
-html_page_top( plugin__( 'Title' ) );
+html_page_top( d___('plugin_MantisGraph', 'Mantis Graphs') );
print_manage_menu( );
@@ -77,16 +77,16 @@ function print_font_checked( $p_font_name ) {
<tr>
<td class="form-title" colspan="3">
- <?php echo plugin__( 'Title' ) . ': ' . plugin_lang_get( 'config' )?>
+ <?php echo d___('plugin_MantisGraph', 'Mantis Graphs') . ': ' . d___('plugin_MantisGraph', 'Configuration')?>
</td>
</tr>
<tr>
<th class="category">
- <?php echo plugin_lang_get( 'library' )?>
+ <?php echo d___('plugin_MantisGraph', 'Graph library to use')?>
</th>
<td class="center">
- <label><input type="radio" name="eczlibrary" value="1" <?php echo( ON == plugin_config_get( 'eczlibrary' ) ) ? 'checked="checked" ' : ''?>/><?php echo plugin_lang_get( 'bundled' )?></label>
+ <label><input type="radio" name="eczlibrary" value="1" <?php echo( ON == plugin_config_get( 'eczlibrary' ) ) ? 'checked="checked" ' : ''?>/><?php echo d___('plugin_MantisGraph', 'Bundled')?></label>
</td>
<td class="center">
<label><input type="radio" name="eczlibrary" value="0" <?php echo( OFF == plugin_config_get( 'eczlibrary' ) ) ? 'checked="checked" ' : ''?>/>JpGraph</label>
@@ -97,7 +97,7 @@ function print_font_checked( $p_font_name ) {
<tr>
<th class="category">
- <?php echo plugin_lang_get( 'window_width' )?>
+ <?php echo d___('plugin_MantisGraph', 'Graph width (in pixels)')?>
</th>
<td class="center" colspan="2">
<input type="text" name="window_width" value="<?php echo plugin_config_get( 'window_width' )?>" />
@@ -106,7 +106,7 @@ function print_font_checked( $p_font_name ) {
<tr>
<th class="category">
- <?php echo plugin_lang_get( 'bar_aspect' )?>
+ <?php echo d___('plugin_MantisGraph', 'Bar graph aspect ratio (height/width)')?>
</th>
<td class="center" colspan="2">
<input type="text" name="bar_aspect" value="<?php echo plugin_config_get( 'bar_aspect' )?>" />
@@ -115,7 +115,7 @@ function print_font_checked( $p_font_name ) {
<tr>
<th class="category">
- <?php echo plugin_lang_get( 'summary_graphs_per_row' )?>
+ <?php echo d___('plugin_MantisGraph', 'Graphs to display per row on the advanced summary page')?>
</th>
<td class="center" colspan="2">
<input type="text" name="summary_graphs_per_row" value="<?php echo plugin_config_get( 'summary_graphs_per_row' )?>" />
@@ -124,7 +124,7 @@ function print_font_checked( $p_font_name ) {
<tr>
<th class="category">
- <?php echo plugin_lang_get( 'font' )?>
+ <?php echo d___('plugin_MantisGraph', 'Font')?>
</th>
<td style="vertical-align: top">
Sans-serif:<br />
@@ -149,8 +149,8 @@ function print_font_checked( $p_font_name ) {
<?php if ( current_user_is_administrator() ) {?>
<tr>
<td class="category">
- <?php echo plugin_lang_get( 'jpgraph_path' )?>
- <br /><span class="small"><?php echo plugin_lang_get( 'jpgraph_path_default' )?></span>
+ <?php echo d___('plugin_MantisGraph', 'JpGraph library system path')?>
+ <br /><span class="small"><?php echo d___('plugin_MantisGraph', 'Leave blank for default: {mantisroot}/library/jpgraph')?></span>
</td>
<td class="center" colspan="2">
<input type="text" name="jpgraph_path" value="<?php echo plugin_config_get( 'jpgraph_path' )?>" />
@@ -160,14 +160,14 @@ function print_font_checked( $p_font_name ) {
<tr>
<td class="category">
- <?php echo plugin_lang_get( 'jpgraph_antialias' )?>
- <br /><span class="small"><?php echo plugin_lang_get( 'jpgraph_antialias_info' )?></span>
+ <?php echo d___('plugin_MantisGraph', 'JpGraph anti-aliasing')?>
+ <br /><span class="small"><?php echo d___('plugin_MantisGraph', 'Anti-aliasing improves the visual appearance of certain graphs at the expense of performance (up to 8x slower)')?></span>
</td>
<td class="center">
- <label><input type="radio" name="jpgraph_antialias" value="1" <?php echo( ON == plugin_config_get( 'jpgraph_antialias' ) ) ? 'checked="checked" ' : ''?>/><?php echo plugin_lang_get( 'enabled' )?></label>
+ <label><input type="radio" name="jpgraph_antialias" value="1" <?php echo( ON == plugin_config_get( 'jpgraph_antialias' ) ) ? 'checked="checked" ' : ''?>/><?php echo d___('plugin_MantisGraph', 'On')?></label>
</td>
<td class="center">
- <label><input type="radio" name="jpgraph_antialias" value="0" <?php echo( OFF == plugin_config_get( 'jpgraph_antialias' ) ) ? 'checked="checked" ' : ''?>/><?php echo plugin_lang_get( 'disabled' )?></label>
+ <label><input type="radio" name="jpgraph_antialias" value="0" <?php echo( OFF == plugin_config_get( 'jpgraph_antialias' ) ) ? 'checked="checked" ' : ''?>/><?php echo d___('plugin_MantisGraph', 'Off')?></label>
</td>
</tr>
View
2 plugins/MantisGraph/pages/summary_graph_bycategory_pct.php
@@ -37,4 +37,4 @@
$t_metrics = unserialize( $t_token );
}
-graph_pie( $t_metrics, plugin_lang_get( 'by_category_pct' ), $f_width, $f_width );
+graph_pie( $t_metrics, d___('plugin_MantisGraph', 'By category percentage'), $f_width, $f_width );
View
2 plugins/MantisGraph/pages/summary_graph_bypriority_mix.php
@@ -39,4 +39,4 @@
$t_metrics = unserialize( $t_token );
}
-graph_group( $t_metrics, plugin_lang_get( 'by_priority_mix' ), $f_width, $f_width * $t_ar );
+graph_group( $t_metrics, d___('plugin_MantisGraph', 'By priority and status'), $f_width, $f_width * $t_ar );
View
2 plugins/MantisGraph/pages/summary_graph_bypriority_pct.php
@@ -38,4 +38,4 @@
$t_metrics = graph_total_metrics( unserialize( $t_token ) );
}
-graph_pie( $t_metrics, plugin_lang_get( 'by_priority_pct' ), $f_width, $f_width );
+graph_pie( $t_metrics, d___('plugin_MantisGraph', 'By priority percentage'), $f_width, $f_width );
View
2 plugins/MantisGraph/pages/summary_graph_byresolution_mix.php
@@ -38,4 +38,4 @@
$t_metrics = unserialize( $t_token );
}
-graph_group( $t_metrics, plugin_lang_get( 'by_resolution_mix' ), $f_width, $f_width * $t_ar );
+graph_group( $t_metrics, d___('plugin_MantisGraph', 'By resolution and status'), $f_width, $f_width * $t_ar );
View
2 plugins/MantisGraph/pages/summary_graph_byresolution_pct.php
@@ -38,5 +38,5 @@
$t_metrics = graph_total_metrics( unserialize( $t_token ) );
}
-graph_pie( $t_metrics, plugin_lang_get( 'by_resolution_pct' ), $f_width, $f_width );
+graph_pie( $t_metrics, d___('plugin_MantisGraph', 'By resolution percentage'), $f_width, $f_width );
View
2 plugins/MantisGraph/pages/summary_graph_byseverity_mix.php
@@ -39,4 +39,4 @@
$t_metrics = unserialize( $t_token );
}
-graph_group( $t_metrics, plugin_lang_get( 'by_severity_mix' ), $f_width, $f_width * $t_ar );
+graph_group( $t_metrics, d___('plugin_MantisGraph', 'By severity and status'), $f_width, $f_width * $t_ar );
View
2 plugins/MantisGraph/pages/summary_graph_byseverity_pct.php
@@ -38,4 +38,4 @@
$t_metrics = graph_total_metrics( unserialize( $t_token ) );
}
-graph_pie( $t_metrics, plugin_lang_get( 'by_severity_pct' ), $f_width, $f_width );
+graph_pie( $t_metrics, d___('plugin_MantisGraph', 'By severity percentage'), $f_width, $f_width );
View
2 plugins/MantisGraph/pages/summary_graph_bystatus_pct.php
@@ -37,4 +37,4 @@
$t_metrics = unserialize( $t_token );
}
-graph_pie( $t_metrics, plugin_lang_get( 'by_status_pct' ), $f_width, $f_width );
+graph_pie( $t_metrics, d___('plugin_MantisGraph', 'By status percentage'), $f_width, $f_width );
View
2 plugins/MantisGraph/pages/summary_graph_imp_category.php
@@ -47,7 +47,7 @@
<table class="width100" cellspacing="1">
<tr>
<td class="form-title">
- <?php echo plugin_lang_get( 'graph_imp_category_title' ) ?>
+ <?php echo d___('plugin_MantisGraph', 'Synthesis graphs by category') ?>
</td>
</tr>
<tr>
View
2 plugins/MantisGraph/pages/summary_graph_imp_priority.php
@@ -48,7 +48,7 @@
<table class="width100" cellspacing="1">
<tr>
<td class="form-title">
- <?php echo plugin_lang_get( 'graph_imp_priority_title' ) ?>
+ <?php echo d___('plugin_MantisGraph', 'Synthesis graphs by priority') ?>
</td>
</tr>
<tr>
View
2 plugins/MantisGraph/pages/summary_graph_imp_resolution.php
@@ -47,7 +47,7 @@
<table class="width100" cellspacing="1">
<tr>
<td class="form-title">
- <?php echo plugin_lang_get( 'graph_imp_resolution_title' ) ?>
+ <?php echo d___('plugin_MantisGraph', 'Synthesis graphs by resolution') ?>
</td>
</tr>
<tr>
View
2 plugins/MantisGraph/pages/summary_graph_imp_severity.php
@@ -45,7 +45,7 @@
<table class="width100" cellspacing="1">
<tr>
<td class="form-title">
- <?php echo plugin_lang_get( 'graph_imp_severity_title' ) ?>
+ <?php echo d___('plugin_MantisGraph', 'Synthesis graphs by severity') ?>
</td>
</tr>
<tr>
View
2 plugins/MantisGraph/pages/summary_graph_imp_status.php
@@ -45,7 +45,7 @@
<table class="width100" cellspacing="1">
<tr>
<td class="form-title">
- <?php echo plugin_lang_get( 'graph_imp_status_title' ) ?>
+ <?php echo d___('plugin_MantisGraph', 'Synthesis graphs by status') ?>
</td>
</tr>
<tr>
View
10 plugins/XmlImportExport/XmlImportExport.php
@@ -32,8 +32,8 @@ class XmlImportExportPlugin extends MantisPlugin {
* A method that populates the plugin information and minimum requirements.
*/
function register( ) {
- $this->name = plugin__( 'Title' );
- $this->description = plugin__( 'Description' );
+ $this->name = d___('plugin_XmlImportExport', 'Import/Export issues');
+ $this->description = d___('plugin_XmlImportExport', 'Adds XML based import and export capabilities to MantisBT.');
$this->page = '';
$this->version = '1.0';
@@ -61,14 +61,14 @@ function hooks( ) {
* Import Issues Menu
*/
function import_issues_menu( ) {
- return array( '<a href="' . plugin_page( 'import' ) . '">' . plugin_lang_get( 'import' ) . '</a>', );
+ return array( '<a href="' . plugin_page( 'import' ) . '">' . d___('plugin_XmlImportExport', 'Import issues') . '</a>', );
}
/**
* Export Issues Menu
*/
function export_issues_menu( ) {
- return array( '<a href="' . plugin_page( 'export' ) . '">' . plugin_lang_get( 'export' ) . '</a>', );
+ return array( '<a href="' . plugin_page( 'export' ) . '">' . d___('plugin_XmlImportExport', 'XML Export') . '</a>', );
}
/**
@@ -77,7 +77,7 @@ function export_issues_menu( ) {
function install() {
$result = extension_loaded("xmlreader") && extension_loaded("xmlwriter");
if ( ! $result ) {
- throw new MantisBT\Exception\Plugin\PluginInstallationFailed( plugin_lang_get( 'error_no_xml' ) );
+ throw new MantisBT\Exception\Plugin\PluginInstallationFailed( d___('plugin_XmlImportExport', 'Import/Export issues'), d___('plugin_XmlImportExport', 'can not find xmlreader and xmlwriter extensions') );
}
return $result;
}
View
36 plugins/XmlImportExport/pages/import.php
@@ -24,7 +24,7 @@
auth_reauthenticate( );
-html_page_top( plugin_lang_get( 'import' ) );
+html_page_top( d___('plugin_XmlImportExport', 'Import issues') );
$t_this_page = plugin_page('import'); //FIXME with plugins this does not work...
print_manage_menu( $t_this_page );
@@ -59,7 +59,7 @@
<tr>
<td class="form-title" colspan="2">
<?php
- echo plugin_lang_get( 'importing_in_project' ) . ' ' . string_display( project_get_field( $t_project_id, 'name' ) );
+ echo d___('plugin_XmlImportExport', 'Importing issues in project:') . ' ' . string_display( project_get_field( $t_project_id, 'name' ) );
?>
</td>
</tr>
@@ -77,32 +77,32 @@
<tr>
<td class="form-title" colspan="2">
<?php
- echo plugin_lang_get( 'import_options' );
+ echo d___('plugin_XmlImportExport', 'Import options');
?>
</td>
</tr>
<tr class="row-2">
<th class="category">
- <?php echo plugin_lang_get( 'cross_references' );?>
+ <?php echo d___('plugin_XmlImportExport', 'Cross references');?>
</th>
<td>
- <p><?php echo plugin_lang_get( 'default_strategy' );?>
+ <p><?php echo d___('plugin_XmlImportExport', 'Default conversion strategy:' );?>
<select name="strategy">
- <option value="renumber" title="<?php echo plugin_lang_get( 'renumber_desc' );?>">
- <?php echo plugin_lang_get( 'renumber' );?></option>
- <option value="link" title="<?php echo plugin_lang_get( 'link_desc' );?>">
- <?php echo plugin_lang_get( 'link' );?></option>
- <option value="disable" title="<?php echo plugin_lang_get( 'disable_desc' );?>">
- <?php echo plugin_lang_get( 'disable' );?></option>
+ <option value="renumber" title="<?php echo d___('plugin_XmlImportExport', 'Try to convert references to new numbering' );?>">
+ <?php echo d___('plugin_XmlImportExport', 'Renumber' );?></option>
+ <option value="link" title="<?php echo d___('plugin_XmlImportExport', 'Convert into a link to the original item' );?>">
+ <?php echo d___('plugin_XmlImportExport', 'Link' );?></option>
+ <option value="disable" title="<?php echo d___('plugin_XmlImportExport', 'Disable the link' );?>">
+ <?php echo d___('plugin_XmlImportExport', 'Disable' );?></option>
</select>
</p>
- <p><?php echo plugin_lang_get( 'fallback' );?>
+ <p><?php d___('plugin_XmlImportExport', 'Fallback strategy (when "Renumber" does not apply):' );?>
<select name="fallback">
- <option value="link" title="<?php echo plugin_lang_get( 'link_desc' );?>">
- <?php echo plugin_lang_get( 'link' );?></option>
- <option value="disable" title="<?php echo plugin_lang_get( 'disable_desc' );?>">
- <?php echo plugin_lang_get( 'disable' );?></option>
+ <option value="link" title="<?php echo d___('plugin_XmlImportExport', 'Convert into a link to the original item' );?>">
+ <?php echo d___('plugin_XmlImportExport', 'Link' );?></option>
+ <option value="disable" title="<?php echo d___('plugin_XmlImportExport', 'Disable the link' );?>">
+ <?php echo d___('plugin_XmlImportExport', 'Disable' );?></option>
</select>
</p>
@@ -112,10 +112,10 @@
<tr class="row-2">
<th class="category"><?php echo _( 'Categories' );?></th>
<td>
- <p><label for="keepcategory"><?php echo plugin_lang_get( 'keep_same_category' );?></label>
+ <p><label for="keepcategory"><?php echo d___('plugin_XmlImportExport', 'Try keeping same category' );?></label>
<input type="checkbox" checked="checked" id="keepcategory" name="keepcategory" /></p>
- <p><?php echo plugin_lang_get( 'fallback_category' );?>
+ <p><?php echo d___('plugin_XmlImportExport', 'Fallback category:' );?>
<select name="defaultcategory">
<?php print_category_option_list( );?>
</select>
View
2 plugins/XmlImportExport/pages/import_action.php
@@ -42,7 +42,7 @@
form_security_purge( 'plugin_xml_import_action' );
-html_page_top( plugin_lang_get( 'import' ) );
+html_page_top( d___('plugin_XmlImportExport', 'Import issues') );
print_manage_menu( 'import_issues_page.php' );

0 comments on commit 52c646c

Please sign in to comment.