-
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
report(flow): import lhr strings #13215
Conversation
settings.formFactor === 'desktop' ? | ||
strings.runtimeDesktopEmulation : | ||
strings.runtimeMobileEmulation |
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.
We can now use lhr strings pretty easily.
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.
We can now use lhr strings pretty easily.
this is great
settings.formFactor === 'desktop' ? | ||
strings.runtimeDesktopEmulation : | ||
strings.runtimeMobileEmulation |
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.
We can now use lhr strings pretty easily.
this is great
// Set missing flow strings to default (english) values. | ||
...UIStrings, | ||
// `strings` is generated in build/build-report.js | ||
...strings[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.
how hard would it be to test this fallback mechanism? Delete a string from a locale, load a report with that locale, check that all the strings are present?
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 think it's possible. Most annoying part would probably be mocking the localized-strings.js
file.
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 was just trying to think of how we can have a test catch regressions in this system, because even when you manually check a report in one language you may not notice a single missing string, and we don't look at reports in other locales all that often.
Since the flow report strings are all known at build time (unlike the report strings, which depend partly on what's in the LHR), another option is to just go through all the locales and check that all the strings are there. When you pose it that way it kind of reveals itself as not that strong of a test, but it would be exhaustive, it should still be pretty fast, and it wouldn't require mocking :)
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 add an item to #11313
Looks like |
The report is borked if a navigation category has
null
score becauseUtil.i18n
is not initialized when rendering category gauges on the summary page.This PR imports the UI strings from the first lhr and uses them to initialize
Util.i18n
.#11313