Skip to content
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

Bug 1982765: Networking - Services - Edit Pod Selector : An incomprehensible Japanese sentence #9701

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
42 changes: 24 additions & 18 deletions frontend/public/components/modals/labels-modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const BaseLabelsModal = withHandlePromise((props) => {
props.handlePromise(promise, props.close);
};

const { kind, resource, descriptionKey, messageKey, labelClassName } = props;
const { kind, resource, descriptionKey, messageKey, messageVariables, labelClassName } = props;

return (
<form onSubmit={submit} name="form" className="modal-content">
Expand All @@ -59,7 +59,7 @@ const BaseLabelsModal = withHandlePromise((props) => {
<div className="row co-m-form-row">
<div className="col-sm-12">
{messageKey
? t(messageKey)
? t(messageKey, messageVariables)
: t(
'public~Labels help you organize and select resources. Adding labels below will let you query for objects that have similar, overlapping or dissimilar labels.',
)}
Expand Down Expand Up @@ -97,19 +97,25 @@ export const labelsModal = createModalLauncher((props) => (
<BaseLabelsModal path={LABELS_PATH} {...props} />
));

export const podSelectorModal = createModalLauncher((props) => (
<BaseLabelsModal
path={
['replicationcontrolleres', 'services'].includes(props.kind.plural)
? '/spec/selector'
: '/spec/selector/matchLabels'
}
isPodSelector={true}
// t('public~Pod selector')
descriptionKey="public~Pod selector"
// t('public~Determines the set of pods targeted by this {{kind: props.kind.label.toLowerCase()}}.')
messageKey="public~Determines the set of pods targeted by this {{kind: props.kind.label.toLowerCase()}}."
labelClassName="co-text-pod"
{...props}
/>
));
export const podSelectorModal = createModalLauncher((props) => {
const { t } = useTranslation();
return (
<BaseLabelsModal
path={
['replicationcontrolleres', 'services'].includes(props.kind.plural)
? '/spec/selector'
: '/spec/selector/matchLabels'
}
isPodSelector={true}
// t('public~Pod selector')
descriptionKey="public~Pod selector"
// t('public~Determines the set of pods targeted by this {{kind}}.')
messageKey={'public~Determines the set of pods targeted by this {{kind}}.'}
messageVariables={{
kind: props.kind.labelKey ? t(props.kind.labelKey) : props.kind.label.toLowerCase(),
}}
labelClassName="co-text-pod"
{...props}
/>
);
});
2 changes: 1 addition & 1 deletion frontend/public/locales/en/public.json
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@
"Labels help you organize and select resources. Adding labels below will let you query for objects that have similar, overlapping or dissimilar labels.": "Labels help you organize and select resources. Adding labels below will let you query for objects that have similar, overlapping or dissimilar labels.",
"{{description}} for": "{{description}} for",
"Labels for": "Labels for",
"Determines the set of pods targeted by this {{kind: props.kind.label.toLowerCase()}}.": "Determines the set of pods targeted by this {{kind: props.kind.label.toLowerCase()}}.",
"Determines the set of pods targeted by this {{kind}}.": "Determines the set of pods targeted by this {{kind}}.",
"Edit language preference": "Edit language preference",
"Language": "Language",
"Select language": "Select language",
Expand Down