Skip to content

[Bug]: Breadcrumb for asset status filter is not translatabl #18209

@nichicom-yasutake

Description

@nichicom-yasutake

Snipe-IT Version

v8.3.5

PHP Version

8.3

Composer Version

2.8.12

MySQL/MariaDB version

10.6

How did you install Snipe-IT?

Docker

Is this a fresh install or an upgrade?

Fresh install

What happened?

Describe the bug

Thank you for developing and maintaining this great project!

When filtering assets by status (e.g., Deleted, Archived, Undeployable), the breadcrumb displays the raw status value instead of using a translated string.

For example:

  • Deleted 資産 (expected: 削除済み 資産)
  • Archived 資産 (expected: 廃棄済み 資産)

Steps to reproduce

  1. Go to Assets list
  2. Filter by status (e.g., "Deleted" or "Archived")
  3. Look at the breadcrumb

Expected behavior

The status name in the breadcrumb should be translated using trans() function, similar to how other breadcrumbs handle deleted items.

Root cause

In app/Providers/BreadcrumbsServiceProvider.php, the asset status breadcrumb uses the raw request parameter:

if ((request()->is('hardware*')) && (request()->status!='')) {
    ->push(request()->status.' '.trans('general.assets'), route('hardware.index', ['status' => request()->status]))

However, for models and users, proper translation keys are used:

->push(trans('general.deleted_models'), route('models.index', ['status' => request()->status]))
->push(trans('general.deleted_users'), route('users.index'))

Suggested fix

Use translation keys for asset status breadcrumbs as well, for example:

->push(trans('general.'.strtolower(request()->status).'_assets'), route('hardware.index', ['status' => request()->status]))

Or create specific translation keys like general.deleted_assets, general.archived_assets, etc.


I would be happy to submit a PR if this approach is acceptable.

What browsers are you seeing the problem on?

Chrome

Can you reproduce this on the public demo?

N/A

Do you have full multiple company support enabled?

No

If you have full multiple company support enabled, do you have location scoping to company enabled?

I do not have full multiple company support enabled

Application log output

Browser console output

Common Issues

  • I have searched this repo for existing issues related to my issue (including closed issues)
  • My APP_URL is set correctly in my .env file (including http or https and no trailing slash)
  • I have searched the official Snipe-IT documentation and have checked the Common Issues documentation (where applicable)
  • I have run database migrations (where applicable).
  • I have attached screenshots and/or videos of the issue (where applicable)

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions