How can I use a Forms app liquid tag for different languages?

Topic summary

Goal: Insert an inline Shopify Forms app form on a blog for multiple languages (using Markets and Translate & Adapt) and select the correct form per locale.

Context: Five separate forms exist (EN, DE, FR, IT, ES), each with its own auto-assigned ID. Current implementation uses locale-based conditionals to render language-specific snippets (e.g., render ‘form-EN’). The requester seeks a Liquid tag that can target a specific Forms app form by ID within those snippets to avoid long conditionals.

Proposal: Use a dynamic Liquid tag: {% form ‘form-’ | append: locale %}, assuming IDs follow a pattern like ‘form-EN’, ‘form-DE’, etc., to simplify and scale code.

Update/Outcome: The requester reports this does not work because the Forms app IDs are automatically assigned and cannot be edited to match the locale pattern. Therefore, the proposed dynamic approach is invalid with current IDs.

Status: Unresolved. No confirmed Liquid tag method to render a specific Shopify Forms app instance by its auto-assigned ID was provided. Key question remains whether the Forms app supports a per-ID Liquid include. Code snippets are central to the issue.

Summarized with AI on January 8. AI used: gpt-5.

@n0glitch

Certainly! To achieve this, you can use the {% form 'form-ID' %} liquid tag in your code. Here’s how you can modify your template:

{% assign locale = request.locale %}

{% form 'form-' | append: locale %}

This assumes that your form IDs are constructed as ‘form-EN’, ‘form-DE’, etc. The append filter will concatenate ‘form-’ with the current locale, giving you the correct form ID dynamically.

This simplifies your code and makes it more scalable, especially when adding more languages in the future.