Skip to content

Conversation

@csh-tech
Copy link
Contributor

@csh-tech csh-tech commented Nov 5, 2025

Description

After adding the filament-language-switch plugin, I noticed that the autocomplete field labels and placeholders remained in English regardless of the selected language.

I thought it would be beneficial to add autocompleteLabel and autocompletePlaceholder as default keys in the language files to support automatic localization.

Changes

Added two new translation keys to enable automatic translation based on the application's locale:

'autocomplete.label' => 'Address',
'autocomplete.placeholder' => 'Search for an address...',

These keys integrate with Filament's existing localization system, allowing the field to automatically display labels and placeholders in the user's language.

Usage Example

GoogleAutocompleteField::make('address')

This will automatically display all text in the application's current locale without any additional configuration.

Benefits

  • Eliminates the need to manually set translated strings for each language
  • Ensures consistency with Filament's localization patterns
  • Works seamlessly with language switcher plugins

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.

1 participant