From daceb16ec5f5a543a68b10d208ad95573f61c82a Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Mon, 2 Apr 2018 12:26:11 -0500 Subject: [PATCH] Improve table for found language variables when translating - refs BT#14180 This show the translation with html code to help to translate the variable --- app/Resources/public/css/base.css | 4 --- main/admin/sub_language.php | 52 +++++++++++++++++++++++++------ 2 files changed, 42 insertions(+), 14 deletions(-) diff --git a/app/Resources/public/css/base.css b/app/Resources/public/css/base.css index d024f028a9..a61a21310f 100644 --- a/app/Resources/public/css/base.css +++ b/app/Resources/public/css/base.css @@ -4228,10 +4228,6 @@ ul.holder li.bit-box{ .control-course{ text-align: center; } -.data_table tr td .form-control{ - width: 20%; - display: inline-block; -} #settings .form-inline{ margin-bottom: 15px; } diff --git a/main/admin/sub_language.php b/main/admin/sub_language.php index 02051dfeb0..f363171b89 100755 --- a/main/admin/sub_language.php +++ b/main/admin/sub_language.php @@ -180,14 +180,31 @@ function search_language_term( $size =4; }*/ - $obj_text = ''; - $obj_button = ''; + $obj_text = Display::tag( + 'textarea', + $sub_language_name_variable, + [ + 'rows' => 10, + 'cols' => 40, + 'name' => 'txt|'.$parent_name_variable.'|'.$language_files_to_load_keys[$lang_file], + 'id' => 'txtid_'.$language_files_to_load_keys[$lang_file].'_'.$parent_name_variable, + ] + ); + $obj_button = Display::button( + 'btn|'.$parent_name_variable.'|'.$language_files_to_load_keys[$lang_file], + get_lang('Save'), + [ + 'class' => 'save btn btn-default btn-sm', + 'type' => 'button', + 'id' => 'btnid_'.$parent_name_variable, + ] + ); $list_info[$parent_name_variable] = [ $lang_file.'.inc.php', $parent_name_variable, - $english_name_variable, - $parent_variable_value, + htmlentities($english_name_variable), + htmlentities($parent_variable_value), $obj_text, $obj_button, ]; @@ -239,10 +256,25 @@ function search_language_term( $parent_variable_value = $parent_language_array[$lang_file][$name_variable]; } //config buttons - $obj_text = ''; - $obj_button = ''; + $obj_text = Display::tag( + 'textarea', + $sub_language_name_variable, + [ + 'rows' => 10, + 'cols' => 40, + 'name' => 'txt|'.$name_variable.'|'.$language_files_to_load_keys[$lang_file], + 'id' => 'txtid_'.$language_files_to_load_keys[$lang_file].'_'.$name_variable, + ] + ); + $obj_button = Display::button( + 'btn|'.$name_variable.'|'.$language_files_to_load_keys[$lang_file], + get_lang('Save'), + [ + 'class' => 'save btn btn-default btn-sm', + 'type' => 'button', + 'id' => 'btnid_'.$name_variable, + ] + ); //loading variable from the english array $english_name_variable = $english_language_array[$lang_file][$name_variable]; @@ -250,8 +282,8 @@ function search_language_term( $list_info[] = [ $lang_file.'.inc.php', $name_variable, - $english_name_variable, - $parent_variable_value, + htmlentities($english_name_variable), + htmlentities($parent_variable_value), $obj_text, $obj_button, ];