Localize error message

Topic summary

A developer has created a cart validation function and is attempting to return a localized error message. They’re structuring the return value with two fields:

  • "target": field
  • "localizedMessage": string_key

However, the implementation isn’t working as expected. The developer shared a screenshot (dated October 30, 2023) demonstrating the issue, but the specific error or problem isn’t described in the text. The discussion remains open with no resolution or additional troubleshooting steps provided yet.

Summarized with AI on November 15. AI used: claude-sonnet-4-5-20250929.

I’ve develop a function to validate my cart,

I can return a translated string?

return {
    "target": field,
    "localizedMessage": "string_key"
}

dont’ work: