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

[CORL-2927] Use tenant locale to translate Graphql errors if available #4385

Merged

Conversation

nick-funk
Copy link
Contributor

What does this PR do?

Use tenant locale to translate Graphql errors if available.

Previously, it was grabbing the locale from the context only which was always set to en-US by default instead of retrieving from the tenant which has the accurate locale.

If the tenant is not available, we simply default back to the context locale to be safe.

This fixes the issue where reposting the same comment twice was not translating the "Are you sure? Your comment looks similar to your previous one" error correctly.

These changes will impact:

  • commenters
  • moderators
  • admins
  • developers

What changes to the GraphQL/Database Schema does this PR introduce?

None

Does this PR introduce any new environment variables or feature flags?

No

If any indexes were added, were they added to INDEXES.md?

No new indices.

How do I test this PR?

  • switch your language to French or Deutsch
    • weirdly, Espanol does not have these error codes translated in their errors.ftl yet, wild
  • try and post the same comment twice
  • see that the nudge prompt for "Are you sure you want to post the same comment twice?" is translated appropriately into French or German properly

Where any tests migrated to React Testing Library?

No

How do we deploy this PR?

No special considerations.

previously, it was grabbing the locale from the context only
which was always set to en-US by default instead of retrieving
from the tenant which has the accurate locale.

if the tenant is not available, we simply default back to the
context locale to be safe.
Copy link

netlify bot commented Oct 31, 2023

Deploy Preview for gallant-galileo-14878c canceled.

Name Link
🔨 Latest commit ec8261c
🔍 Latest deploy log https://app.netlify.com/sites/gallant-galileo-14878c/deploys/654135d9ab71a8000846ca9f

@kabeaty kabeaty added this pull request to the merge queue Dec 6, 2023
Merged via the queue into develop with commit b7d2c84 Dec 6, 2023
5 checks passed
@kabeaty kabeaty deleted the fix/CORL-2927-translate-errors-if-tenant-locale-available branch December 6, 2023 18:27
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.

3 participants