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

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

Closed
rtrudel opened this issue May 10, 2023 · 3 comments
Closed

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

rtrudel opened this issue May 10, 2023 · 3 comments

Comments

@rtrudel
Copy link

rtrudel commented May 10, 2023

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?

@alexjcollins
Copy link
Member

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

@rtrudel
Copy link
Author

rtrudel commented May 10, 2023

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 :)

@Tam Tam closed this as completed in 5de1d9a Apr 4, 2024
@plcdnl
Copy link

plcdnl commented May 27, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants