Skip to content

Conversation

@jeff-phillips-18
Copy link
Member

@openshift-ci-robot openshift-ci-robot added the component/knative Related to knative-plugin label Nov 24, 2020
@openshift-ci-robot openshift-ci-robot added component/kubevirt Related to kubevirt-plugin component/sdk Related to console-plugin-sdk component/shared Related to console-shared labels Nov 24, 2020
@jeff-phillips-18
Copy link
Member Author

/retest

Comment on lines 22 to 28
Copy link
Contributor

Choose a reason for hiding this comment

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

🤔 There is a pattern that can be used here...

Quick search through the codebase got me:

"teams-help": "Optionally list organizations. If specified, only GitHub users that are members of at least one of the listed organizations will be allowed to log in. Cannot be used in combination with <1>teams</1>.",

And:

            <Trans i18nKey="teams-help" ns="github-idp-form">
              Optionally list organizations. If specified, only GitHub users that are members of at
              least one of the listed organizations will be allowed to log in. Cannot be used in
              combination with <strong>teams</strong>.
            </Trans>

Ref: github-idp-form.tsx

cc @christianvogt might know more -- I'm reverse engineering here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting, you put t at the start of other methods 🤔

I have no opinion one way or another, just thought it was noteworthy.

Comment on lines 80 to 82
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be one translation otherwise it won't come out properly in other languages.

Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure I understand what is happening here... why this change? Seems like new functionality for an I18n PR.

@andrewballantyne
Copy link
Contributor

Add page looks translated...
Screen Shot 2020-11-26 at 2 48 34 PM
But we have actions that don't look translated:
Screen Shot 2020-11-26 at 2 48 21 PM
Screen Shot 2020-11-26 at 2 49 13 PM
Screen Shot 2020-11-26 at 2 52 31 PM


Sidebar has a lot of non-translated chunks... not sure if that's a topology package issue with the new code location 🤔
Screen Shot 2020-11-26 at 2 49 56 PM


All the actions but the two layouts look uncaught by I18n...
Screen Shot 2020-11-26 at 2 50 11 PM


Partially missing translation:
Screen Shot 2020-11-26 at 2 51 23 PM


Not sure who covers the build decorator 🤔 This is in the Topology package... so I assume this PR...
Screen Shot 2020-11-26 at 2 52 08 PM

Copy link
Contributor

@christianvogt christianvogt left a comment

Choose a reason for hiding this comment

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

Overall I question the use of passing around t over simply using the global translation function when the translation of errors isn't reactive anyways.

Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't necessary. It seems like the only reason for translation is related to error messages.
These error messages can be translated using the global i18next object because there's no way these will be reactive anyways to a change in locale. We wouldn't be running the callback again with the new lang so therefore it's a one time translation.

Copy link
Contributor

Choose a reason for hiding this comment

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

You should use labelKey for actions.

Copy link
Contributor

Choose a reason for hiding this comment

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

Unnecessary to pass t here because the modal has access to useTranslation or withTranslation.

Copy link
Contributor

Choose a reason for hiding this comment

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

You should use labelKey for actions.
Same comment for all actions.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer to have confirmModal accept a callback which is either executed in the render context so that the function can use useTranslation or it gets passed in the translation function. This would make it easier to use these modal launchers without the need for the consumer to provide it's own t function.

Copy link
Contributor

Choose a reason for hiding this comment

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

Again it seems we're passing around t to localize the return value of async operations that won't be re-run if the locale changes.
Seems unnecessary to pass t around everywhere for this and instead use the global i18next

Copy link
Contributor

Choose a reason for hiding this comment

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

The API accepts a ReactNode. TopologyShortcuts can make use of useTranslation

Suggested change
bodyContent={getTopologyShortcuts(t)}
bodyContent={<TopologyShortcuts />}

Copy link
Contributor

Choose a reason for hiding this comment

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

Use useTranslation instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

Use useTranslation instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

Actions can use labelKey

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 27, 2020
@openshift-ci-robot openshift-ci-robot added component/core Related to console core functionality component/dev-console Related to dev-console needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Nov 30, 2020
@jeff-phillips-18
Copy link
Member Author

@andrewballantyne Side bar is part of public/components/overview (not topology). I believe I have addressed other comments.

@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 1, 2020
@vikram-raj
Copy link
Member

/retest

Comment on lines 57 to 61
Copy link
Member

Choose a reason for hiding this comment

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

@jeff-phillips-18 Missed this Merge conflict marker encountered.

Copy link
Contributor

@andrewballantyne andrewballantyne left a comment

Choose a reason for hiding this comment

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

Not sure I misunderstand Trans vs t ... but I think you can use t for all strings, and Trans when React components or DOM elements get in the way

Comment on lines 113 to 115
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we still need the space 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

Don't think you need to use Trans on static strings 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

Copy link
Contributor

@andrewballantyne andrewballantyne Dec 1, 2020

Choose a reason for hiding this comment

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

Missed Connections string passed to SidebarSectionHeading on line 36.

image

Copy link
Contributor

Choose a reason for hiding this comment

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

Oooh, missed the title missing.

With the pseudo lang:
Screen Shot 2020-12-01 at 11 36 18 AM

With the "default" lang:
Screen Shot 2020-12-01 at 11 36 23 AM

Copy link
Member

@vikram-raj vikram-raj left a comment

Choose a reason for hiding this comment

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

missing header of the connector sidepanel
missing-connector-header

missing key warning
missing-key-warning

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
labelKey: 'Edit Health Checks',
labelKey: 'console-app~Edit Health Checks',

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return <Link to={href}>{t('topology~{{ready}} of {{desired}} pods', { ready, desired })}</Link>;
return <Link to={href}>{t('topology~{{ready, number}} of {{count, number}} pod', { ready, count: desired })}</Link>;

@jeff-phillips-18
Copy link
Member Author

@andrewballantyne @vikram-raj Updated per comments.

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return <Link to={href}>{t('topology~{{length}} pods', { length: filteredPods.length })}</Link>;
return <Link to={href}>{t('topology~{{count, number}} pod', { count: filteredPods.length })}</Link>;

Copy link
Contributor

@andrewballantyne andrewballantyne left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 1, 2020
@christianvogt
Copy link
Contributor

/approve

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 1, 2020
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Dec 1, 2020
@andrewballantyne
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 1, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andrewballantyne, christianvogt, jeff-phillips-18

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 838da0c into openshift:master Dec 2, 2020
@jeff-phillips-18 jeff-phillips-18 deleted the topology-i18n branch December 2, 2020 13:32
@spadgett spadgett added this to the v4.7 milestone Dec 9, 2020
@spadgett spadgett added the kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated label Jan 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. component/core Related to console core functionality component/dev-console Related to dev-console component/knative Related to knative-plugin component/kubevirt Related to kubevirt-plugin component/sdk Related to console-plugin-sdk component/shared Related to console-shared kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants