Skip to content

[CORL-2349] Use translation keys for relayNetworkRequestError strings#3786

Merged
kodiakhq[bot] merged 4 commits intodevelopfrom
fix/CORL-2349-rrnl-error-translation
Nov 18, 2021
Merged

[CORL-2349] Use translation keys for relayNetworkRequestError strings#3786
kodiakhq[bot] merged 4 commits intodevelopfrom
fix/CORL-2349-rrnl-error-translation

Conversation

@nick-funk
Copy link
Copy Markdown
Contributor

@nick-funk nick-funk commented Nov 16, 2021

What does this PR do?

Use translation keys to get error message text for the RelayNetworkRequestError defined in src/core/client/framework/lib/errors/relayNetworkRequestError.ts.

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

None

How do I test this PR?

Put the following after line 14 in your customErrorMiddleware:

const msg = getMessage(
    localeBundles,
    "common-error-relayNetworkRequestError-anUnexpectedNetworkError",
    "THIS FAILED AND USED DEFAULT"
  );
  // eslint-disable-next-line no-console
  console.log("LOOK HERE", msg);

Import getMessage from i18n in customErrorMiddleware via:

import { getMessage } from "../i18n";

Have any error throw client side and see that the console shows the LOOK HERE translation as translated correctly from common.ftl with An unexpected network error occured, please try again later. and is not using the text THIS FAILED AND USED DEFAULT.

How do we deploy this PR?

N/A

@netlify
Copy link
Copy Markdown

netlify bot commented Nov 16, 2021

✔️ Deploy Preview for gallant-galileo-14878c canceled.

🔨 Explore the source changes: e1c0593

🔍 Inspect the deploy log: https://app.netlify.com/sites/gallant-galileo-14878c/deploys/6196718b49ad8800079d7996

Copy link
Copy Markdown
Contributor

@kabeaty kabeaty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and works as expected! Left one small note on the translations file, but approved.

@nick-funk nick-funk force-pushed the fix/CORL-2349-rrnl-error-translation branch from 5da81c7 to 80f48ca Compare November 17, 2021 22:00
@tessalt tessalt added the 🚀 merge it! Pull requests that should be merged after status checks pass with a review label Nov 18, 2021
@tessalt tessalt added this to the v6.16.1 milestone Nov 18, 2021
@kodiakhq kodiakhq bot merged commit 4111c84 into develop Nov 18, 2021
@kodiakhq kodiakhq bot deleted the fix/CORL-2349-rrnl-error-translation branch November 18, 2021 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🚀 merge it! Pull requests that should be merged after status checks pass with a review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants