Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any way to translate enumeration in field #35

Closed
SirMishaa opened this issue Aug 3, 2021 · 1 comment
Closed

Is there any way to translate enumeration in field #35

SirMishaa opened this issue Aug 3, 2021 · 1 comment

Comments

@SirMishaa
Copy link

Hello!

I'm making a dashboard for French administrator, but for the relevance of the code, I obviously always use English.
The problem is that I don't see how to translate this, I haven't found any method to customize this on the field

image

My enum is declared like that :

<?php


namespace App\Enum;


use BenSampo\Enum\Enum;

final class StateType extends Enum
{
    const InStock = "in_stock";
    const OutStock = "out_stock";
    const DataNotAvailable = "data_not_available";
}

I would like to keep enum in English. Only the state in the select should be translated if possible.

@mdpoulter
Copy link
Member

Hi @SirMishaa. Thanks for your question 😄

Would the LocalizedEnum interface available in BenSampo/laravel-enum perhaps work for this? I haven't tested it myself, but I can't see why it wouldn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants