Skip to content

Conversation

@vctrchu
Copy link
Contributor

@vctrchu vctrchu commented Nov 6, 2025

Resolves https://github.com/shop/issues-retail/issues/20278

DO NOT MERGE UNTIL 1/19/2026 / POS 10.19

Problem

POS extension templates (pos-action, pos-block, pos-smart-grid) did not include locale files or demonstrate i18n usage, making it unclear to developers how to internationalize their POS extensions. This was inconsistent with admin extension templates which fully demonstrate localization.

Solution

  • Added locales folder structure with en.default.json.liquid and fr.json.liquid to all three POS templates
  • Updated shopify.extension.toml.liquid to use name = "t:name" for locale-based extension naming
  • Implemented i18n examples in all flavors (Preact, React, JavaScript):
    • Preact: shopify.i18n.translate()
    • React: i18n from useApi()
    • JavaScript: api.i18n.translate()
  • Created appropriate locale keys for each template:
    • pos-action: "name", "welcome"
    • pos-block: "name", "welcome", "block_heading", "block_content", "open_action"
    • pos-smart-grid: "name", "tile_heading", "tile_subheading", "modal_heading", "welcome"

Testing

Copy link
Contributor Author

vctrchu commented Nov 6, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@vctrchu vctrchu self-assigned this Nov 6, 2025
Copy link

@aaronschubert0 aaronschubert0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're shipping this in 2026-01 that doesn't support React, can we just leave those templates as is and solely focus on the Preact / JS variants instead?

type = "ui_extension"
name = "{{ name }}"
# Change the merchant-facing name of the extension in locales/en.default.json
name = "t:name"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vctrchu just doubling checking does the CLI support non-english values here?

Copy link
Contributor Author

@vctrchu vctrchu Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to believe so based on the assumption that other extensions such as admin-block, etc follow this pattern

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

vctrchu commented Nov 12, 2025

@aaronschubert0 That works for me. I made this change before the fact I realized that the il8n was not properly exposed and now that we are patching it to 2025-10 and releasing it for 2026-01, it makes sense to only update the preact/js templates.

@vctrchu vctrchu force-pushed the 11-06-include_localization_support_for_pos_ui_extension_templates branch from d3e8c1e to 0bec842 Compare November 12, 2025 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants