Localisation with App Proxy

kevin_mittal
Shopify Partner
10 0 5

Hello,

 

Is there any way to use localised URLs with App Proxy?

 

For an instance, a store with multiple active locale will have;

 

https://abc.myshopify.com/products/handle (default)

https://abc.myshopify.com/fr-CA/products/handle (fr-CA)

 

However, for an App Proxy, the same isn't working;

 

https://abc.myshopify.com/tools/my-app (working)

https://abc.myshopify.com/fr-CA/tools/my-app (not working)

 

Is there anyway to render locale specific data within App Proxy liquid files? Currently, request.locale is always returning shop's primary locale within App Proxy.

 

Looking forward to a solution 🙂

 

Thank you.

Replies 36 (36)
SBD_
Shopify Staff
Shopify Staff
1098 146 227

-- Updated Feb 2020 --

Hey @kevin_mittal,

 

Localised URLs now work with app proxies. The language is passed along in the accept-language header.

/es/apps/example -> accept-language: es;q=1.0, en;q=0.5

 

 

Scott | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

jagmelis
New Member
4 0 0

Hi Scotty,

 

I have the same problem with our "custom app" (proxy app).

 

I can confirm I'm receiving the "accept-language"-header,

but this doesn't contain the published languages from our shop.

It looks like it sends the languages from the clients-browser...

 

Published languages in our shop:

English = default, German and French


Received languages header in proxy app:

Chrome: [HTTP_ACCEPT_LANGUAGE] => nl,nl-NL;q=0.9,en;q=0.8,en-US;q=0.7,de;q=0.6,fr;q=0.5,sv;q=0.4,it;q=0.3,lb;q=0.2,da;q=0.1,la;q=0.1,es;q=0.1
IE edge: [HTTP_ACCEPT_LANGUAGE] => nl-NL,nl;q=0.8,en-GB;q=0.5,en;q=0.3

 

A much bigger issue for me is that front-end isn't accepting localised URL's;

So:

- myshop.com/apps/customapp > is working

- myshop.com/de/customapp > isn't working (404)

(I've already re-installed the app, and made sure that "read_locales" and "read_translations" are in the app scopes).

 

Can you please advise?

jagmelis
New Member
4 0 0

In my question above I made one mistake in the explanation...

And to be sure the problem is clear;

 

- myshop.com/apps/customapp > is working

- myshop.com/de/apps/customapp > isn't working (404)

- myshop.com/nl/apps/customapp > isn't working (404)

- myshop.com/fr/apps/customapp > isn't working (404)

 

So at this moment Shopify doesn't point the localised urls to my proxy app.

SBD_
Shopify Staff
Shopify Staff
1098 146 227

Thanks @jagmelis 

 

We had to roll back the proxy locale fix, a new fix should be deployed soon. Keep you posted.

Scott | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

jagmelis
New Member
4 0 0

 Hi @SBD_ ,

 

Thanks for your response.

I hope it will be implemented soon, as the deadline for our multilingual store is April 14th.

jagmelis
New Member
4 0 0

Hi @SBD_  and @Jordan (Jordan Valenzuela),

 

Any news on this?

I have a feeling it doesn't look very promising at this moment.

And while my boss is breathing on my neck and the 14th of April is approaching very soon, I'll guess I have to fall back on the Dutch Saying...

"sticking bicycle tires" ?

 

Please keep me posted if you have any news.

Kind regards,

Jeroen

 

SBD_
Shopify Staff
Shopify Staff
1098 146 227

Hey @jagmelis 

The fix is being reviewed - unfortunately there's no ETA, keep you posted.

Scott | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Andrew-W
Shopify Partner
24 3 11

Hi @SBD_,

 

Any update on this?

 

Thanks!

Andrew

FrankieB
Tourist
5 0 2

Hi Scotty,

Any news? Could you give us an update on this matter?

Marc_M
Shopify Partner
47 1 10

@SBD_ 

We are facing the same problem. Please keep us updated

Andrew-Corknine
Explorer
76 1 26

Also facing this issue.  Is that an ETA for a fix that allows app proxies in translated routes?

SBD_
Shopify Staff
Shopify Staff
1098 146 227

Nothing to report yet. I'll update this thread as soon as there's news.

Scott | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Marc_M
Shopify Partner
47 1 10

@SBD_ sorry to stress but we kinda moved our Shop over from Magento 2 recently and now all of our spanish/italian/portoguese/danish/norwegian/swedish/polish customers have to use the shop in English which lead to a significant drop in our conversion rate.
It's because our product pages are implemented through an app proxy (as it's a customized product)

Would appreciate if you could give a rough estimate when this can be fixed

SBD_
Shopify Staff
Shopify Staff
1098 146 227

@Marc_M sorry I'm unable to provide an ETA. Are you able to use a workaround for the time being? Here are two approaches:

 

1. Parse the language from the headers. For example proxied requests should contain a referer header:

 

Referer: https://shop.com/es/products/some-product

2. Use JS to attach the language as a query parameter:

 

/app/example?language=es

 

Scott | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Marc_M
Shopify Partner
47 1 10

@SBD_ we tried this one but once you select Spanish on the home page and then visit /app/product?language=es ( without /es/ ) it redirects to /es/product?language=es which leads to a  404
I guess because Shopify sets a cookie so it always squeezes in the language /es/ in the URL once a customer has set this language. Which makes sense

SBD_
Shopify Staff
Shopify Staff
1098 146 227

@Marc_M can you please DM me a link to an example?

Scott | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

_Dominik_
Shopify Partner
23 0 6

Hi @SBD_ we tried both those methods you described and more, nothing worked

  • Parameter ?language=de
  • Parameter ?locale=de
  • Request Header Accept-Language: de
  • Referer

How can we render translated content via liquid through an app proxy?

Is there a workaround that should work?

 

 

Thanks for your help.

 

 

SBD_
Shopify Staff
Shopify Staff
1098 146 227

@_Dominik_ the work arounds will only allow you to translate content returned by the proxy, not the entire theme.

 

For example, /apps/proxy-url?language=es will proxy to your URL with a language parameter.

Scott | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

AvocadosLab
Shopify Partner
46 3 32

@SBD_ any update around this?

 

I'm also having trouble showing my app contents over app proxy when merchants have translations apps that serve content by changing URL (ex. /fr, /de)