Skip to content

Commit

Permalink
ensure trad
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Delcroix committed Dec 13, 2021
1 parent 5deab00 commit 5f4874e
Show file tree
Hide file tree
Showing 4 changed files with 476 additions and 261 deletions.
8 changes: 4 additions & 4 deletions front/medicalconsumable.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
}
Event::log($_POST["plugin_openmedis_medicalconsumableitems_id"], "plugin_openmedis_medicalconsumableitems", 4, "inventory",
//TRANS: %s is the user login
sprintf(__('%s adds medical consumables'), $_SESSION["glpiname"]));
sprintf(__('%s adds medical consumables', 'openmedis'), $_SESSION["glpiname"]));
Html::back();

} else if (isset($_POST["purge"])) {
Expand All @@ -56,7 +56,7 @@
if ($cart->delete($_POST, 1)) {
Event::log($_POST["plugin_openmedis_medicalconsumableitems_id"], "plugin_openmedis_medicalconsumableitems", 4, "inventory",
//TRANS: %s is the user login
sprintf(__('%s purges a medical consumable'), $_SESSION["glpiname"]));
sprintf(__('%s purges a medical consumable', 'openmedis'), $_SESSION["glpiname"]));
}
Html::back();

Expand All @@ -67,7 +67,7 @@
if ($cart->install($_POST["plugin_openmedis_medicaldevices_id"], $_POST["plugin_openmedis_medicalconsumableitems_id"])) {
Event::log($_POST["plugin_openmedis_medicaldevices_id"], "plugin_openmedis_medicaldevices", 5, "inventory",
//TRANS: %s is the user login
sprintf(__('%s installs a medical consumable'), $_SESSION["glpiname"]));
sprintf(__('%s installs a medical consumable', 'openmedis'), $_SESSION["glpiname"]));
}
}
}
Expand All @@ -79,7 +79,7 @@
if ($cart->update($_POST)) {
Event::log($_POST["plugin_openmedis_medicaldevices_id"], "plugin_openmedis_medicaldevices", 4, "inventory",
//TRANS: %s is the user login
sprintf(__('%s updates a medical consumable'), $_SESSION["glpiname"]));
sprintf(__('%s updates a medical consumable', 'openmedis'), $_SESSION["glpiname"]));
}
Html::back();

Expand Down
8 changes: 5 additions & 3 deletions inc/medicaldevice.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ function showForm($ID, $options = []) {
//do not display called elements per default; they'll be displayed or returned here
$params['display'] = false;
echo "<tr class='tab_bg_1'>";
echo "<td>".__("Parent")."</br>\n";
echo PluginOpenmedisMedicalDeviceCategory::getFieldLabel(0)."</td>\n";
echo "<td>".PluginOpenmedisMedicalDeviceCategory::getFieldLabel(0, 0)."</br>\n";
echo PluginOpenmedisMedicalDeviceCategory::getFieldLabel(0, 1)."</td>\n";
echo "<td>";
//$this->category = is_null($_POST['category'] ? $_POST['category'] : '');
$rand = mt_rand();
Expand All @@ -216,6 +216,8 @@ function showForm($ID, $options = []) {
'permit_select_parent' => true,
'displaywith' => ['code','label'],
'parentfieldid' => $parent_field_id ]);


echo "</td>";


Expand All @@ -234,7 +236,7 @@ function showForm($ID, $options = []) {
$tplmark = $this->getAutofillMark('name', $options);

//TRANS: %1$s is a string, %2$s a second one without spaces between them : to change for RTL
echo "<td>".sprintf(__('%1$s%2$s'), __('Name'), $tplmark);
echo "<td>".sprintf(__('%1$s%2$s'), __('Name', 'openmedis'), $tplmark);
echo "</td>";
echo "<td>";
//$this->fields['withtemplate'] = 2 ;
Expand Down
23 changes: 19 additions & 4 deletions inc/medicaldevicecategory.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,35 @@ static function getTypeName($nb = 0) {
return _n('Medical device category', 'Medical device categories', $nb, 'openmedis');
}

static function getFieldLabel($nb = 0) {
return _n('Category', 'Categories', $nb, 'openmedis');
static function getFieldLabel($nb = 0, $v = 0) {
switch ($v == 0)
{
case 2:
return _n('Code', 'Codes', $nb, 'openmedis');
break;
case 1:
return _n('Generic name', 'Generic names', $nb, 'openmedis');
break;
default:
case 0:
return _n('Category', 'Categories', $nb, 'openmedis');
break;
}



}



function getAdditionalFields() {

$tab = [['name' => 'code',
'label' => __('Code'),
'label' => $this->getFieldLabel(0,2),
'type' => 'text',
'list' => true],
['name' => 'label',
'label' => __('Label'),
'label' => $this->getFieldLabel(0,1),
'type' => 'text',
'list' => true],

Expand Down
Loading

0 comments on commit 5f4874e

Please sign in to comment.