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

Fix interface when locale is something other than English #561

Merged
merged 4 commits into from
Dec 12, 2018

Conversation

cbothner
Copy link
Member

@cbothner cbothner commented Dec 12, 2018

How wonderful: two bugs in one 🕷🦂

First, the i18n gem upgrade to 1.1.0 changed the behavior of locale fallbacks, removing the default locale from the default list of fallbacks. We were relying on that, and when a tag had no display_name in the current locale, we were serializing null. The interface broke when rendering the keywords index on the catalog page and when loading the image backgrounds for category tags.

Second, at some point react-intl locale data started being exported as an ES module, (aka with a default export), instead of a bare module.exports = ..., and addLocaleData started failing, and falling back to English. This meant that the leaf translated components were expecting English messages regardless of the locale set in IntlProvider. Of course, this was fine in English mode,
and all the messages failed to load otherwise.

Needless to say, this PR adds a test that would have caught either of these bugs.

Before i18n v1.1.0, i18n.fallbacks would eventually hit your
default_locale. That was changed without warning and broke
everything ruby-i18n/i18n#415. This restores the
previous behavior by explicity falling back to English.
@cbothner cbothner temporarily deployed to msc-gala-pr-561 December 12, 2018 17:08 Inactive
The translated name will, of course, come up empty, and a failed import
will take down the app.
@cbothner cbothner temporarily deployed to msc-gala-pr-561 December 12, 2018 19:08 Inactive
Otherwise, signing in in later tests can be messed up, since the button
still says "connexion"
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.

1 participant