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

[Bug]: getRelationship() using getModelLabel() #3

Closed
TimeglitchD opened this issue Nov 3, 2023 · 1 comment
Closed

[Bug]: getRelationship() using getModelLabel() #3

TimeglitchD opened this issue Nov 3, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@TimeglitchD
Copy link

What happened?

I want to use the getModelLabel() function to set my translated labels, without interfering with this package.

How to reproduce the bug

The class Ancestor has the following function to get the relationship:

Ancestor.php

    public function getRelationship(): string
    {
        if (! $this->relationship) {
            return $this->getResource()::getModelLabel();
        }

        return $this->relationship;
    }

Problem is, I'm using getModelLabel to translate the navigation items, as suggested by the Filament documentation...
Filament example
afbeelding
My code

    public static function getModelLabel(): string
    {
        return ___('signeditor.signs', 1);
    }

...which results in the relationship sign() being translated into Bord(), which does not exist 😛
afbeelding

Package Version

1.0.0-alpha.5

PHP Version

8.2.11

Laravel Version

10.30.0

Which operating systems does with happen with?

Linux

Notes

No response

@TimeglitchD TimeglitchD added the bug Something isn't working label Nov 3, 2023
@TimeglitchD
Copy link
Author

My bad, just saw the relationship name option!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant