diff --git a/app/Helpers/Helper.php b/app/Helpers/Helper.php index 78693b60c4..1f1228bb0a 100644 --- a/app/Helpers/Helper.php +++ b/app/Helpers/Helper.php @@ -532,20 +532,23 @@ class Helper * @since [v2.5] * @return array */ - public static function categoryTypeList() + public static function categoryTypeList($selection=null) { $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'), ]; + if($selection != null){ + return $category_types[$selection]; + } + else return $category_types; } - /** * Get the list of custom fields in an array to make a dropdown menu * diff --git a/app/Http/Transformers/CategoriesTransformer.php b/app/Http/Transformers/CategoriesTransformer.php index 64550b6370..faf05f7f4b 100644 --- a/app/Http/Transformers/CategoriesTransformer.php +++ b/app/Http/Transformers/CategoriesTransformer.php @@ -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::categoryTypeList($category->category_type), 'has_eula' => ($category->getEula() ? true : false), 'use_default_eula' => ($category->use_default_eula=='1' ? true : false), 'eula' => ($category->getEula()),