Seriously can’t find this anywhere. If visitor chooses language “Spanish” for example, how do I save that for all future visits? I have a javascript around right now, but it involves a redirect on a re-visit, which I’m not a fan of. I’d prefer displaying spanish language immediately, without a redirect to “/es” folder. How would I achieve this? I’ve seen some website make it work, but can’t figure it out myself and can’t find any documentation either.
Topic summary
A user seeks to save visitor language preferences without triggering URL redirects on return visits. They’ve observed some websites (specifically pdlaopa.com) that maintain language selection via cookies while keeping the root URL unchanged, rather than redirecting to language-specific folders like /es/.
Staff Response:
- Shopify automatically saves language preferences to browser cookies
- Different languages typically use distinct URL paths (e.g., /es/ for Spanish)
- The example site uses a custom
customer_localecookie, not Shopify’s standard approach
Current Position:
Shopify maintains that each language should have its own URL structure as standard practice. The desired functionality (language persistence without URL changes) appears to require custom implementation beyond Shopify’s default behavior. The inquiry remains unresolved for achieving this within Shopify’s native framework.
Language preference is saved to that browser’s cookie, so there’s nothing you need to do here. There isn’t a redirect to /es folder, rather /es is where Spanish is (if that’s how your store is setup), if that makes sense. Different languages have different URL paths
Thanks for the answer! I’m aware, but I noticed some website achieved language preference cookie saving, which loads automatically on a re-visit, without redirecting to the language folder. Website I’m talking about is pdpaola.com, if you want to check. Just change the language and then vidit the root again, translation stays, but no redirect occurs.
Thanks for sharing that @hazzardt . We took a look internally - they are saving a customer_locale cookie which is custom to them; definitely not something Shopify does as standard. Our position is very much that a language should have its own URL structure. Sorry to not be able to be more help.