Skip to content

Commit

Permalink
12759: Error loading language string when plugin is not current
Browse files Browse the repository at this point in the history
Signed-off-by: Damien Regad <damien.regad@merckgroup.com>
  • Loading branch information
Stéphane Veyret authored and dregad committed Jul 28, 2011
1 parent e39645d commit 9dda347
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions core/plugin_api.php
Expand Up @@ -243,15 +243,18 @@ function plugin_config_defaults( $p_options ) {
* @return string Language string * @return string Language string
*/ */
function plugin_lang_get( $p_name, $p_basename = null ) { function plugin_lang_get( $p_name, $p_basename = null ) {
if( is_null( $p_basename ) ) { if( !is_null( $p_basename ) ) {
$t_basename = plugin_get_current(); plugin_push_current( $p_basename );
} else {
$t_basename = $p_basename;
} }


$t_basename = plugin_get_current();
$t_name = 'plugin_' . $t_basename . '_' . $p_name; $t_name = 'plugin_' . $t_basename . '_' . $p_name;
$t_string = lang_get( $t_name );


return lang_get( $t_name ); if( !is_null( $p_basename ) ) {
plugin_pop_current();
}
return $t_string;
} }


function plugin_history_log( $p_bug_id, $p_field_name, $p_old_value, $p_new_value = '', $p_user_id = null, $p_basename = null ) { function plugin_history_log( $p_bug_id, $p_field_name, $p_old_value, $p_new_value = '', $p_user_id = null, $p_basename = null ) {
Expand Down

0 comments on commit 9dda347

Please sign in to comment.