simplemap icon indicating copy to clipboard operation
simplemap copied to clipboard

[Fix included] Localizing the Google Map using Craft site locale

Open rtrudel opened this issue 2 years ago • 2 comments

Not sure how MR works, I drop the fix here, hoping magic happens.

File: /src/services/EmbedService.php somewhere near line 144

$params = http_build_query([
   'key' => $settings->getMapToken(),
   
   // add next line to make the map load using the site language
   'language' => Craft::$app->getLocale()->getLanguageID(),
   
   'callback' => $callbackName,
]);

I guess the same trick also applies to other map providers?

rtrudel avatar May 10 '23 04:05 rtrudel

Thanks for suggesting this, @rtrudel. We'll take a look and adjust on our end as necessary.

alexjcollins avatar May 10 '23 05:05 alexjcollins

Perhaps it could be more clean to get the currentSite locale, I'm not sure. But I'm sure you'll do for the best :)

rtrudel avatar May 10 '23 07:05 rtrudel

Can't understand why, for me, doesn't get the currentSite locale. I have the cp setted in english. Only english available site and it shows to me the country field in italian language. So weird. Is there a possibility to force it through a config file?

plcdnl avatar May 27 '24 08:05 plcdnl