-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Conversation
// See: https://jestjs.io/docs/ecmascript-modules#differences-between-esm-and-commonjs | ||
// https://github.com/facebook/jest/issues/10025 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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[]} */ |
There was a problem hiding this comment.
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.
Closes #14049