public static function translateArray(array & $data, bool $sort = false) {
		foreach ($data as $k => $v) {
			$data[$k]['name'] = i18n(null, $v['name']);
		}
		if ($sort) {
			array_key_sort($data, ['name' => SORT_ASC], ['name' => SORT_NATURAL]);
		}
	}
public static function translateArray(array & $data, bool $sort = false) {
		foreach ($data as $k => $v) {
			$data[$k]['name'] = i18n(null, $v['name']);
		}
		if ($sort) {
			array_key_sort($data, ['name' => SORT_ASC], ['name' => SORT_NATURAL]);
		}
	}
public static function translateArray ( array & $ data , bool $ sort = false ) { foreach ( $ data as $ k => $ v ) { $ data [ $ k ] [ 'name' ] = i18n ( null , $ v [ 'name' ] ) ; } if ( $ sort ) { array_key_sort ( $ data , [ 'name' => SORT_ASC ] , [ 'name' => SORT_NATURAL ] ) ; } }
Translate and sort an array

@param array $data
@param bool $sort
Translate and sort an array