Skip to content

Conversation

@gpibarra
Copy link
Contributor

@gpibarra gpibarra commented Nov 2, 2024

This package has no translations, it only uses 2 labels placeholder and getEmptyLabel that can be configured. If not configured, they use a default English label from the javascript library.

This PR configures by default the filament labels that already have translations.

In the case of placeholder, both Select and SelectTree implement the HasPlaceholder trait. In the Select component, a translatable label is set on setup function.
https://github.com/filamentphp/forms/blob/3.x/src/Components/Select.php#L195
The same criteria is taken for SelectTree.

On the other hand, getEmptyLabel, the Select component and SelectTree implement a CanBeSearchable trait, which already has a noSearchResultsMessage property, where it has a translatable label.
https://github.com/filamentphp/forms/blob/3.x/src/Components/Concerns/CanBeSearchable.php#L75
The getEmptyLabel and emptyLabel functions now calls the trait's methods for compatibility.

@CodeWithDennis
Copy link
Owner

Looks good @gpibarra just a small conflict.

@gpibarra
Copy link
Contributor Author

gpibarra commented Nov 3, 2024

Fixed. It was a conflict with the previous PR dehydrated

@CodeWithDennis
Copy link
Owner

Thanks again!

@CodeWithDennis CodeWithDennis merged commit 21655e2 into CodeWithDennis:3.x Nov 3, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants