[Canvas] Converting workpad header components to typescript and adding i18n#45274
Conversation
|
Pinging @elastic/kibana-canvas |
💚 Build Succeeded |
💚 Build Succeeded |
💚 Build Succeeded |
0c2c7b1 to
cf2f081
Compare
clintandrewhall
left a comment
There was a problem hiding this comment.
There are a lot of things to confirm/tweak, so I'm just going to comment for now... hit me up when everything's addressed and I'll review again. I'd love to see @bmcconaghy or someone from #i18n to take a look at the plurals and keys.
There was a problem hiding this comment.
If these strings have already been translated, this will blow up in i18n parsing.
There was a problem hiding this comment.
That's true but I only merged in the first version of these i18n strings yesterday. Do they translate that quickly? #44943
There was a problem hiding this comment.
We extract the labels a few weeks before FF and at FF so they are not translated yet. Additionally the CI should fail if the translation files need a fix. Which can be fixed in the PR by running node/scripts i18n_check.js --fix
There was a problem hiding this comment.
This doesn't look properly formatted. Are you sure your IDE is configured properly?
There was a problem hiding this comment.
I'm not sure I see the formatting issue? The linter seems happy with it
...y/plugins/canvas/public/components/workpad_header/control_settings/auto_refresh_controls.tsx
Outdated
Show resolved
Hide resolved
...legacy/plugins/canvas/public/components/workpad_header/control_settings/control_settings.tsx
Outdated
Show resolved
Hide resolved
.../legacy/plugins/canvas/public/components/workpad_header/control_settings/custom_interval.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
nit: This is syntactic sugar around i18n, so we should probably extract out to a dictionary.
There was a problem hiding this comment.
Yeah I was curious about how to handle this case since the string needs to pass in a component with the <EuiCode>kibana.yml</EuiCode> block. My thought was maybe we don't want to import / use components in the i18n string dictionaries but I can always make that happen. I suppose alternatively I can always pass the <EuiCode>kibana.yml</EuiCode> to the string function. Any preference?
💔 Build Failed |
cf2f081 to
dc65760
Compare
💚 Build Succeeded |
Bamieh
left a comment
There was a problem hiding this comment.
Translations LGTM. Wrote a couple of comments
There was a problem hiding this comment.
We extract the labels a few weeks before FF and at FF so they are not translated yet. Additionally the CI should fail if the translation files need a fix. Which can be fixed in the PR by running node/scripts i18n_check.js --fix
| time: { | ||
| getSecondsText: (seconds: number) => | ||
| i18n.translate('xpack.canvas.units.time.seconds', { | ||
| defaultMessage: '{seconds} {seconds, plural, one {second} other {seconds}}', |
There was a problem hiding this comment.
You can write this instead
{seconds, plural, one {# second} other {# seconds}
the # here will return the value of seconds;
💔 Build Failed |
💚 Build Succeeded |
💚 Build Succeeded |
…g i18n (elastic#45274) * Converting workpad header components to typescript and adding i18n * i18n for custom interval * Refactor of i18n ids and better time text * Fixing help example * Refactor of some naming * More string refactor and finishing workpad export * Addressing some PR feedback * Changing plural format * Quick fix * Zoom controls * Fixing id
…g i18n (#45274) (#45927) * Converting workpad header components to typescript and adding i18n * i18n for custom interval * Refactor of i18n ids and better time text * Fixing help example * Refactor of some naming * More string refactor and finishing workpad export * Addressing some PR feedback * Changing plural format * Quick fix * Zoom controls * Fixing id
* master: (33 commits) [easy] Exclude __examples__ from coverage (elastic#45556) [DOCS] Update CCR links (elastic#44012) Use unique junit report filenames again (elastic#45897) [ftr/savedObjects] add simple saved object api client to ftr s… (elastic#45856) New visualization editor Lens (elastic#36437) Sort using unix timestamp value (elastic#43162) [APM] Use POST instead of implicit GET (elastic#45903) [Canvas] Converting workpad header components to typescript and adding i18n (elastic#45274) skip flaky test (elastic#45884) set IS_PIPELINE_JOB in intake jobs (elastic#45850) [Uptime] Fix/issue 48 integration popup closes after refresh (elastic#45759) [Logs UI] Support zoom by brushing in the log rate chart (elastic#45879) [DOCS] Changes name to host (elastic#45798) [ML] Add population job wizard test (elastic#45765) [skip-ci][Maps][File upload] Geojson indexing and styling docs (elastic#41394) remove setTimeoue for state change (elastic#45853) [Graph] Restructure folders and add readme (elastic#45782) [ML] Enhance job id error message (elastic#45349) [SIEM] Do not update state component when they did unmount (elastic#45847) [i18n] sync from 7.4 latest translations (elastic#45823) ...
Summary
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.- [ ] This was checked for cross-browser compatibility, including a check against IE11- [ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support- [ ] Documentation was added for features that require explanation or tutorials- [ ] Unit or functional tests were updated or added to match the most common scenarios- [ ] This was checked for keyboard-only and screenreader accessibilityFor maintainers