Have you seen our video tutorials? Check 'em out!

Set locale not only by URI like /en, /ru, /lt but by domain.com, domain.ru, domain.lt

huglester - 2 months ago

Hello,

can someone point where to search for this kind of functionality?

Thank you

Answer

ryanthompson - 2 months ago

So this is called locale hinting: https://github.com/anomalylabs/streams-platform/blob/master/resources/config/locales.php#L21

By default both sub-domain and URI segment hinting will apply. So yourdomain.com/lt/* will trigger lt locale. Same with lt.yourdomain.com/*.

ryanthompson - 2 months ago

So this is called locale hinting: https://github.com/anomalylabs/streams-platform/blob/master/resources/config/locales.php#L21

By default both sub-domain and URI segment hinting will apply. So yourdomain.com/lt/* will trigger lt locale. Same with lt.yourdomain.com/*.

huglester - 2 months ago

So if I have different domains, like: webas.lt webas.eu

I would need hint to false, and handle the stuff myself somehow. Thanks.

ryanthompson - 2 months ago

You could - different domains in the domains table can force a locale. I would have to double check to make sure it's hooked up properly.

It was one of those things I knew I would need but didn't need at the time and might have not finished.

maxximus007 - 3 weeks ago

This would be very interesting for me too.. Can handle it myself, but it's way cleaner if it's working out of the box.