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

[Bug]: Theme Check - locale keys with _html and pluralisation. #4589

Closed
2 tasks done
pocallaghan-function opened this issue Oct 7, 2024 · 3 comments
Closed
2 tasks done
Labels
Area: @shopify/theme @shopify/theme package issues moderate lowest severity for theme related bug Type: Bug Something isn't working

Comments

@pocallaghan-function
Copy link

Please confirm that you have:

  • Searched existing issues to see if your issue is a duplicate. (If you’ve found a duplicate issue, feel free to add additional information in a comment on it.)
  • Reproduced the issue in the latest CLI version.

In which of these areas are you experiencing a problem?

Theme

Expected behavior

It should be possible to use pluralisation with html keys without a ValidJSON error getting triggered.

Actual behavior

A ValidJSON error is triggered.

Verbose output

info ─────────────────────────────────────────────────────────────────────────

locales/en.default.json

Incorrect type. Expected "string".

208 "count_html": {
209 "one": "There is <span class="count">{{ count }} item",
210 "other": "There are <span class="count">{{ count }} items"
211 }

Reproduction steps

  1. Add this to your locales file:
  "example": {
    "count_html": {
      "one": "There is <span class=\"count\">{{ count }}</span> item",
      "other": "There are <span class=\"count\">{{ count }}</span> items"
    }
  },
  1. Add this to your liquid file:
      {{ 'example.count_html' | t: count: 1 }}<br/>
      {{ 'example.count_html' | t: count: 2 }}<br/>
  1. Run shopify theme check

The file is reported as invalid, however if you preview the theme the pluralisation clearly works.

Operating System

Mac OS Sonoma

Shopify CLI version (check your project's package.json if you're not sure)

3.68.0

Shell

zsh

Node version (run node -v if you're not sure)

No response

What language and version are you using in your application?

No response

@pocallaghan-function pocallaghan-function added the Type: Bug Something isn't working label Oct 7, 2024
@mgmanzella mgmanzella added moderate lowest severity for theme related bug Area: @shopify/theme @shopify/theme package issues labels Oct 7, 2024
@mgmanzella
Copy link
Contributor

👋 thanks for reporting, to confirm is this the same issue you're facing? Shopify/theme-liquid-docs#798

@pocallaghan-function
Copy link
Author

Hi @mgmanzella, yes, it certainly is. Apologies if I reported in the wrong place, I did check this repo for open tickets, but not the other one. I'm not entirely familiar with how the various Shopify repos are linked / where the boundaries are.

@mgmanzella
Copy link
Contributor

np! im closing as duplicate

@mgmanzella mgmanzella closed this as not planned Won't fix, can't repro, duplicate, stale Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: @shopify/theme @shopify/theme package issues moderate lowest severity for theme related bug Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants