adds translations to edit and index of categories

This commit is contained in:
Godfrey M 2023-03-13 13:33:03 -07:00
parent 8a977c66f0
commit 576b8f8c48
2 changed files with 24 additions and 6 deletions

View file

@ -532,15 +532,33 @@ class Helper
{
$category_types = [
'' => '',
'accessory' => 'Accessory',
'asset' => 'Asset',
'consumable' => 'Consumable',
'component' => 'Component',
'license' => 'License',
'accessory' => trans('general.accessories'),
'asset' => trans('general.asset'),
'consumable' => trans('general.consumable'),
'component' => trans('general.component'),
'license' => trans('general.license'),
];
return $category_types;
}
public static function categoryType($category_type){
switch ($category_type) {
case ('accessory'):
return trans('general.accessory');
break;
case ('consumable'):
return trans('general.consumable');
break;
case ('component'):
return trans('general.component');
break;
case ('asset'):
return trans('general.asset');
case ('license'):
return trans('general.license');
}
}
/**
* Get the list of custom fields in an array to make a dropdown menu

View file

@ -47,7 +47,7 @@ class CategoriesTransformer
'id' => (int) $category->id,
'name' => e($category->name),
'image' => ($category->image) ? Storage::disk('public')->url('categories/'.e($category->image)) : null,
'category_type' => ucwords(e($category->category_type)),
'category_type' => Helper::categoryType($category->category_type),
'has_eula' => ($category->getEula() ? true : false),
'use_default_eula' => ($category->use_default_eula=='1' ? true : false),
'eula' => ($category->getEula()),