Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

[react-i18n] Pluralization should wait until the locales translations have loaded #1685

Open
4 tasks done
JesseNoseworthy opened this issue Nov 25, 2020 · 5 comments
Open
4 tasks done
Assignees

Comments

@JesseNoseworthy
Copy link
Contributor

Overview

Originally raised over Slack due to this support issue, I noticed that we load in en translations before the selected locales translations:

image

When using pluralization, for specific count values (the variable for this is PLURALIZATION_KEY_NAME in the Quilt repo) we'll receive back the fields "few" or "many". Because we've yet to load in the locale-specific translations, we'll default to the already loaded in en translations. With pluralization the "few" and "many" keys (specific to cs and pl locales) won't exist in en causing the app to crash.

Screen Shot 2020-11-25 at 4 08 08 PM

My proposal is to investigate how we can also fallback on the en pluralization if that locales translations haven't been loaded in yet. It looks like this can take place somewhere here.

Consuming repo

What repo were you working in when this issue occurred?

facebook-ads

Area

  • Add any relevant Area: <area> labels to this issue

Scope

  • Is this issue related to a specific package?

    • Tag it with the Package: <package_name> label.

Checklist

  • Please delete the labels section before submitting your issue
  • I have described this issue in a way that is actionable (if possible)
@movermeyer
Copy link
Contributor

cc @Shopify/web-essentials

@JesseNoseworthy
Copy link
Contributor Author

👋 Are there any updates on the prioritization of this ticket?

@jas7457
Copy link
Contributor

jas7457 commented Aug 16, 2022

Any updates with this? This causes some pretty large problems and throws errors in our app, which causes the app to crash. We got around it by adding an onError no-op to the I18nManager constructor, but this is not a good solution and can mask real problems.

@movermeyer
Copy link
Contributor

@jas7457 My understanding (though I never tested it) was that this was fixed by Bring Locale Specific I18N Builds Over The Finish Line project

@jas7457
Copy link
Contributor

jas7457 commented Aug 16, 2022

@movermeyer I can't say I know much about that project or the changes that were needed for it, but I'm not working in web, I work on the Shopify Search & Discovery first-party app.

That project makes it sound like they did something specific to web, not something that fixes the root problem for @shopify/react-i18n.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants