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

core(user-flow): i18n default names #14455

Merged
merged 4 commits into from
Oct 20, 2022
Merged

core(user-flow): i18n default names #14455

merged 4 commits into from
Oct 20, 2022

Conversation

adamraine
Copy link
Member

Closes #14049

@adamraine adamraine merged commit 70d5652 into main Oct 20, 2022
@adamraine adamraine deleted the i18n-default-step-names branch October 20, 2022 21:46
Comment on lines +23 to +24
// See: https://jestjs.io/docs/ecmascript-modules#differences-between-esm-and-commonjs
// https://github.com/facebook/jest/issues/10025
Copy link
Member

Choose a reason for hiding this comment

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

seems weird to still be linking to jest docs for this, though

Copy link
Member Author

Choose a reason for hiding this comment

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

It matches everything else so probably good for now

*/
defaultFlowName: 'User flow ({url})',
/**
* @description Default name for a user flow step that analyzes a page navigation.
Copy link
Member

Choose a reason for hiding this comment

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

"user flow" isn't going to mean anything to a translator here, and doesn't really seem to matter for the name anyways. Seems better just to explain what's meant by "navigation" and "report"?

(same for timespan/snapshot below)

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll do this one in a follow up

*/
function translate(message, values, locale) {
const icuMessage = str_(message, values);
return getFormatted(icuMessage, locale);
Copy link
Member

Choose a reason for hiding this comment

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

Feels weird to be immediately removing the IcuMessage. Should this be handled by either the flow report's i18n or by the LHR's typical replaceIcuMessages flow?

This won't work with swapping locales, but looks like there's nowhere you can swap a flow report's locale anyways.

Copy link
Member Author

Choose a reason for hiding this comment

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

The messages are designed to be customized, so I want to avoid shipping ICU messages as the step/flow names.

@@ -331,38 +326,38 @@ describe('UserFlow', () => {
},
};

/** @type {LH.UserFlow.GatherStep[]} */
Copy link
Member

Choose a reason for hiding this comment

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

why not

// @ts-expect-error - incomplete mock.
/** @type {LH.UserFlow.GatherStep[]} */

or whatever? This file can also just be removed from the tsconfig if mocking continues to make it too annoying to maintain the types.

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

Successfully merging this pull request may close these issues.

Cleanup FR API for Release
4 participants