Merge pull request #12661 from Godmartinz/gh12655_missing_translations

Adds translations for category types to index and edit of categories
This commit is contained in:
snipe 2023-03-24 07:09:40 -07:00 committed by GitHub
commit 6bc0df73e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 8 deletions

View file

@ -532,20 +532,23 @@ class Helper
* @since [v2.5] * @since [v2.5]
* @return array * @return array
*/ */
public static function categoryTypeList() public static function categoryTypeList($selection=null)
{ {
$category_types = [ $category_types = [
'' => '', '' => '',
'accessory' => 'Accessory', 'accessory' => trans('general.accessories'),
'asset' => 'Asset', 'asset' => trans('general.asset'),
'consumable' => 'Consumable', 'consumable' => trans('general.consumable'),
'component' => 'Component', 'component' => trans('general.component'),
'license' => 'License', 'license' => trans('general.license'),
]; ];
if($selection != null){
return $category_types[$selection];
}
else
return $category_types; return $category_types;
} }
/** /**
* Get the list of custom fields in an array to make a dropdown menu * 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, 'id' => (int) $category->id,
'name' => e($category->name), 'name' => e($category->name),
'image' => ($category->image) ? Storage::disk('public')->url('categories/'.e($category->image)) : null, '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), 'has_eula' => ($category->getEula() ? true : false),
'use_default_eula' => ($category->use_default_eula=='1' ? true : false), 'use_default_eula' => ($category->use_default_eula=='1' ? true : false),
'eula' => ($category->getEula()), 'eula' => ($category->getEula()),