Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MERC-7830 region name localization support #245

Merged
merged 1 commit into from
Jul 19, 2021

Conversation

kchu93
Copy link
Contributor

@kchu93 kchu93 commented Jul 1, 2021

Note, but build should pass once paper-handlebars PR has been merged and released. Currently build is failing to install packages as I am using a remote url for paper-handlebars package.

Dependencies

  • Paper-handlebars: PR to allow adding data-content-region-translation attribute
  • Paper (This PR): Update to paper-handlebars version to support new data attribute
  • Storefront-renderer: Update to paper version to support new parsing of region translations
  • Stencil-cli: Update to stencil cli to parse translation from theme and generate manifest with new translation data.
  • Page builder = Add support to use the correct translation if provided from schemaTranslations.

What? Why?

Region name localization support. This PR is to add content-region-translation data attribute if translation is provided in the html handlebars from the theme. This will be used to surface the correct translation on the front end (page builder) for a particular region.

Screen Shot 2021-07-06 at 11 48 34 AM

Screen Shot 2021-07-06 at 11 47 45 AM

How was it tested?

Steps to test

(1) Pull down the storefront-render PR and run locally (or can run the container image)

(2) Pull down stencil-cli PR and create theme with {{{region name="header_bottom" translation="i18n.RegionName.HeaderBottom"}}} and i18n.RegionName.HeaderBottom dummy translation within schema.json. EXAMPLE PROVIDED BELOW

(3) Change store language to non english language (chinese and french example provided)

(4) Upload test theme, load page builder and load layers pane to see the correct language.

Example Region + Schema.json

Region
{{{region name="header_bottom" translation="i18n.RegionName.HeaderBottom"}}}

Schema.json

  "i18n.RegionName.HeaderBottom": {
    "default": "Header Bottom",
    "en": "Header Bottom",
    "fr-FR": "Bas de l'en-tête",
    "zh": "标题底部",
    "zh-CN": "标题底部"
  }

cc @bigcommerce/storefront-team

@jkanive jkanive merged commit 822d895 into bigcommerce:master Jul 19, 2021
@kchu93 kchu93 deleted the MERC-7830 branch July 19, 2021 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants