Filament Drawable Map uses Laravel’s standard translation system. The package ships with translation files for two languages, and adding support for additional locales is a matter of creating a single PHP file under your application’sDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/diegobas/filament-drawable-map/llms.txt
Use this file to discover all available pages before exploring further.
lang/vendor/ directory.
Bundled Languages
The following languages are included with the package out of the box:- English (
en) - Spanish (
es)
Translation Keys
The translation file contains two keys used by theDrawableMap component’s built-in clear button:
clear_zone key provides the button label that appears on the map control. The clear_zone_description key provides the button’s title tooltip text.
The Spanish equivalents ship as:
Publishing Translations
To customise the bundled translations or add new languages, first publish the translation files to your application:resources/lang/ directory into your application at:
Adding a New Language
Create a new locale directory under the published vendor path and add afilament-drawable-map.php file containing translations for all keys:
App::getLocale() returns 'fr', so no additional registration is required.
Clear Button Label at the Field Level
TheclearButtonLabel() method on DrawableMap lets you override the translated string for a specific field instance without changing the translation files. This is useful when different resources use different terminology for their zones.
__() with the full namespaced key means the label will still respect the active locale while allowing you to swap in an alternative key or hardcode a string for one-off cases.
Map Language
ViewableMap passes App::getLocale() to the Google Maps JavaScript API URL as the language query parameter when it loads the Maps script:
DrawableMap loads the Google Maps API through the @googlemaps/js-api-loader npm package and does not pass a language parameter. Map labels in DrawableMap will follow the browser’s or Google’s default language. Only ViewableMap applies the application locale to the map tile labels.