App reviews, troubleshooting, and recommendations
Hi,
I am making a shopify function to give discounts on products depending on a metafield, my question will be about the message field in FunctionRunResult.Discount, I can put a string to be shown instead of the title of the discount, I would like to tell the customer that if he buys 1 more he gets a better discount and for that I need to translate that.
My researches gave nothing, the "assistant" AI in the docs uses variables that doesn't exist and chatgpt says there is no way to translate in shopify functions. But why is there locales folder then?
Is there a way to translate or a workaround pls?
when nothing in message field:
when something in message field:
Solved! Go to the solution
This is an accepted solution.
I found a way, don't know if it is THE way.
So first I found there was a localization field in RunInput:
in run.graphql:
localization{
language{
isoCode
}
}
then I used this to select a json file in my locales folder:
This is an accepted solution.
I found a way, don't know if it is THE way.
So first I found there was a localization field in RunInput:
in run.graphql:
localization{
language{
isoCode
}
}
then I used this to select a json file in my locales folder:
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025