Side cart shows "Every 2 month" for multi-interval subscriptions

Aperta
#83 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript

Direzione di ricerca

Start in assets/js/spark-cart-drawer-renderer.js around line 77 and read how locale strings populate side_cart.default.frequency_template; then inspect the locale interval labels and the cart page's frequency text for the same issue. Run the relevant tests in tests/js/ and add coverage for count 1 and 2 in English and a translated locale. Done means translated singular/plural labels are selected by locale-aware plural rules, with the stated fallback behavior.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

A subscription line in the side cart with a delivery interval above 1 reads "Every 2 month" instead of "Every 2 months". The interval word never changes for plural counts, in any language.

Where: assets/js/spark-cart-drawer-renderer.js, around line 77, fills side_cart.default.frequency_template ("Every {count} {interval}") with the platform's interval value lowercased (month, week, day). The count is never used to choose a singular or plural form.

Why not a quick fix: adding an English s when the count is above 1 corrects English but produces wrong words in de, es and fr, whose frequency_template strings are translated ("Alle", "Cada", "Tous les"). The fix needs a translated word for each interval, in singular and plural form.


Done when:

  • Each locale has interval labels for day, week and month (and year if the platform sends it), each with a one and an other form, for example side_cart.interval.month.one and side_cart.interval.month.other.
  • The renderer picks the form from intervalCount, preferably with Intl.PluralRules for the store locale and falling back to other. It passes the translated word into frequency_template.
  • An unknown interval value falls back to the raw platform value, as today.
  • tests/js/ covers count 1 and count 2 for at least English and one translated locale.
  • The cart page's frequency text is checked for the same problem and fixed the same way if affected.
Lingua principale
JavaScript
Stelle
0
Fork
1
Merge medio
4g 16h
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di NextCommerceCo/spark

Tutte le issue di NextCommerceCo/spark

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.