mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
adds translations to edit and index of categories
This commit is contained in:
parent
8a977c66f0
commit
576b8f8c48
|
@ -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
|
||||
|
|
|
@ -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()),
|
||||
|
|
Loading…
Reference in a new issue