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
added "on" label to checkbox #28087
added "on" label to checkbox #28087
Conversation
Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
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.
LGTM, let's also make sure to backport this.
@@ -25,7 +33,7 @@ export const OptionComponent = (props: UserProfileFieldProps) => { | |||
key={option} | |||
id={option} | |||
data-testid={option} | |||
label={option} | |||
label={props.t(unWrap(optionLabel?.on || option))} |
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.
Do we need to unWrap(label)
here as well, or can we get away with:
label={props.t(unWrap(optionLabel?.on || option))} | |
label={props.t(optionLabel?.on ? unWrap(optionLabel.on) : option)} |
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.
No, it can be a translation key, see the issue
Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
@@ -25,7 +33,7 @@ export const OptionComponent = (props: UserProfileFieldProps) => { | |||
key={option} | |||
id={option} | |||
data-testid={option} | |||
label={option} | |||
label={props.t(unWrap(optionLabel?.on || option))} |
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 seems that using optionLabel?.on
will look for a entry in inputOptionLabels
for the key "on". My guess is that this should rather look for the key option
.
Suggestion:
label={props.t(unWrap(optionLabel?.[option] || option))}
fixes: #28078
Signed-off-by: Erik Jan de Wit erikjan.dewit@gmail.com