alextselegidis / easyappointments

:date: Easy!Appointments - Self Hosted Appointment Scheduler
https://easyappointments.org
GNU General Public License v3.0
3.36k stars 1.28k forks source link

Set the displayed language with a URL query parameter #1566

Closed CarlSinclair closed 3 months ago

CarlSinclair commented 4 months ago

Is it possible to localize the booking widget using a language parameter in the URL? That would make it easy to make the iframe match the language of the parent page. If not, is there another way to do this currently without having users manually select translations? Or having the translation button get clicked automatically based on the language/URL of the parent page? Because as far as I can tell, the language selection is done using JS and not via URI.

alextselegidis commented 4 months ago

Hello!

Thanks for posting your question.

We will be adding this in the next release.

Currently this is not possible, but you should be able to change the language with a GET parameter.

Alex Tselegidis, Easy!Appointments Creator
Need a customization? Get a free quote!

CarlSinclair commented 4 months ago

image

It seems the language files aren't publicly accessible, not at the requested URL language/**/translations_lang.php or at the correct URL application/language/**/translations_lang.php.

Is this simply a matter of surfacing this file (likely by overriding rewrite rules) or is it more complex than that?

alextselegidis commented 3 months ago

Hello!

Can you try with "?language=spanish"?

Alex Tselegidis, Easy!Appointments Creator
Need a customization? Get a free quote!

CarlSinclair commented 3 months ago

That's working perfectly! Thank you! I was trying with language codes like es. I never thought to use the full language name.

CarlSinclair commented 3 months ago

Note that it's only working when appended to the root domain. Appending it to index.php or ?embed doesn't work. Embed never did anything for me though so it's all good.