Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ const AnsibleContentTableWrapper = ({
<EmptyState variant={EmptyStateVariant.xl}>
<EmptyStateHeader
headingLevel="h4"
titleText="No Ansible content in this organization"
titleText={_('No Ansible content in this organization')}
icon={<EmptyStateIcon icon={ResourcesEmptyIcon} />}
/>
<EmptyStateBody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ const AnsibleContentWizard: React.FC<AnsibleContentWizardProps> = ({
setIsContentWizardOpen(false);
resetWizard();
}}
closeButtonAriaLabel="Close wizard"
closeButtonAriaLabel={_('Close wizard')}
/>
}
onClose={() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const ProviderSelectionStep: React.FC<ProviderSelectionStepProps> = ({
<FlexItem style={{ width: '30%' }}>
{' '}
<Tile
title="Ansible Galaxy"
title={_('Ansible Galaxy')}
icon={<TopologyIcon />}
isStacked
isDisplayLarge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
} from '@patternfly/react-core';
import TopologyIcon from '@patternfly/react-icons/dist/esm/icons/topology-icon';
import CodeBranchIcon from '@patternfly/react-icons/dist/esm/icons/code-branch-icon';
import { translate as _ } from 'foremanReact/common/I18n';
import {
AnsibleContentUnitCreateType,
isAnsibleGalaxyContentUnitCreate,
Expand Down Expand Up @@ -104,7 +105,7 @@ export const ReviewStep: React.FC<ReviewStepProps> = ({
<DataListAction
aria-labelledby="single-action-item1 single-action-action1"
id="single-action-action1"
aria-label="Actions"
aria-label={_('Actions')}
>
<Button
onClick={() => {
Expand Down Expand Up @@ -168,7 +169,7 @@ export const ReviewStep: React.FC<ReviewStepProps> = ({
<DataListAction
aria-labelledby="single-action-item1 single-action-action1"
id="single-action-action1"
aria-label="Actions"
aria-label={_('Actions')}
>
<Button
onClick={() => {
Expand All @@ -190,7 +191,7 @@ export const ReviewStep: React.FC<ReviewStepProps> = ({

return (
<React.Fragment>
<DataList aria-label="single action data list example">
<DataList aria-label={_('single action data list example')}>
{listItems()}
</DataList>
</React.Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { WizardFooter, useWizardContext } from '@patternfly/react-core';
import { useForemanOrganization } from 'foremanReact/Root/Context/ForemanContext';
import { useDispatch } from 'react-redux';
import { addToast } from 'foremanReact/components/ToastsList';
import { translate as _ } from 'foremanReact/common/I18n';
import { translate as _, sprintf as __ } from 'foremanReact/common/I18n';
import {
AnsibleContentUnitCreateType,
isAnsibleGalaxyContentUnitCreate,
Expand Down Expand Up @@ -50,8 +50,9 @@ const FinishFooter: React.FC<FinishFooterProps> = ({
addToast({
type: 'success',
key: `IMPORT_CU_${contentUnits.length}_SUCC`,
message:
'Successfully imported Ansible content units from YAML file"!',
message: _(
'Successfully imported Ansible content units from YAML file!'
),
sticky: false,
})
);
Expand Down Expand Up @@ -89,11 +90,13 @@ const FinishFooter: React.FC<FinishFooterProps> = ({
addToast({
type: 'success',
key: `IMPORT_CU_${contentUnits.length}_SUCC`,
message: `Successfully imported ${
contentUnits.length
} Ansible content ${
contentUnits.length === 1 ? 'unit' : 'units'
}"!`,
message: __(
_('Successfully imported %(count) Ansible content %(unit)!'),
{
count: contentUnits.length,
unit: contentUnits.length === 1 ? _('unit') : _('units'),
}
),
sticky: false,
})
);
Expand All @@ -103,11 +106,15 @@ const FinishFooter: React.FC<FinishFooterProps> = ({
addToast({
type: 'danger',
key: `IMPORT_CU_${contentUnits.length}_ERR`,
message: `Importing of ${
contentUnits.length
} Ansible content units failed with error code "${
(err as { response: AxiosResponse }).response.status
}".`,
message: __(
_(
'Importing of %(count)s Ansible content units failed with error code "%(status)s"'
),
{
count: contentUnits.length,
status: (err as { response: AxiosResponse }).response.status,
}
),
sticky: false,
})
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,14 @@ export const GalaxyContentUnitInput: React.FunctionComponent<GalaxyContentUnitIn
onChange={handleUnitSourceChange}
id="cu-source-input-01"
type="text"
aria-label="content unit source input"
aria-label={_('content unit source input')}
validated={contentUnitSourceValidation}
/>
</InputGroupItem>
<InputGroupItem>
<Button
variant="control"
aria-label="popover for input"
aria-label={_('popover for input')}
onClick={
() => {
setContentUnitSource(defaultGalaxy);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export const GitContentUnitInput: React.FunctionComponent<GitContentUnitInputPro
>
<button
type="button"
aria-label="More info for repo url field"
aria-label={_('More info for repo url field')}
onClick={e => e.preventDefault()}
aria-describedby="content-unit-identifier-field-01"
className={styles.formGroupLabelHelp}
Expand All @@ -207,7 +207,7 @@ export const GitContentUnitInput: React.FunctionComponent<GitContentUnitInputPro
{/* <InputGroupItem>
<Button
variant="control"
aria-label="inspect repository"
aria-label={_('inspect repository')}
onClick={() => {}}
>
{_('Inspect repository')}
Expand Down Expand Up @@ -238,7 +238,7 @@ export const GitContentUnitInput: React.FunctionComponent<GitContentUnitInputPro
>
<button
type="button"
aria-label="More info for git ref field"
aria-label={_('More info for git ref field')}
onClick={e => e.preventDefault()}
aria-describedby="git-ref-field-01"
className={styles.formGroupLabelHelp}
Expand Down Expand Up @@ -266,7 +266,7 @@ export const GitContentUnitInput: React.FunctionComponent<GitContentUnitInputPro
<TabTitleText>{_('Commit or manual input')}</TabTitleText>{' '}
</>
}
aria-label="filled tabs with icons content users"
aria-label={_('filled tabs with icons content users')}
/>
{/* <Tab
eventKey={'branch' as refTabKeys}
Expand Down Expand Up @@ -297,7 +297,7 @@ export const GitContentUnitInput: React.FunctionComponent<GitContentUnitInputPro

<GitRefInput gitRefs={gitRefs} setGitRefs={setGitRefs} />

<ChipGroup categoryName="Only import: " numChips={10}>
<ChipGroup categoryName={_('Only import: ')} numChips={10}>
{contentUnitVersions.map(unitVersion => (
<Chip
key={unitVersion}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const GitRefInput: React.FC<VersionInputProps> = ({
id="cu-source-input-01"
data-testid="git-ref-input"
type="text"
aria-label="content unit source input"
aria-label={_('content unit source input')}
/>
</InputGroupItem>
<InputGroupItem>
Expand All @@ -83,12 +83,12 @@ export const GitRefInput: React.FC<VersionInputProps> = ({
<FormHelperText>
<HelperText>
<HelperTextItem>
{'Ref list does not conform to the pattern: "<Ref>, <Ref>"'}
{_('Ref list does not conform to the pattern: "<Ref>, <Ref>"')}
</HelperTextItem>
</HelperText>
</FormHelperText>
)}
<ChipGroup categoryName="Only import: " numChips={10}>
<ChipGroup categoryName={_('Only import: ')} numChips={10}>
{gitRefs.map(unitVersion => (
<Chip
key={unitVersion}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const VersionInput: React.FC<VersionInputProps> = ({
>
<button
type="button"
aria-label="More info for unit id field"
aria-label={_('More info for unit id field')}
onClick={e => e.preventDefault()}
aria-describedby="content-unit-identifier-field-01"
className={styles.formGroupLabelHelp}
Expand All @@ -98,7 +98,7 @@ export const VersionInput: React.FC<VersionInputProps> = ({
}
id="cu-source-input-01"
type="text"
aria-label="content unit source input"
aria-label={_('content unit source input')}
/>
</InputGroupItem>
<InputGroupItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export const AnsibleVariablesSelector = ({
<Stack>
<StackItem>
<SearchInput
placeholder="Find by name"
placeholder={_('Find by name')}
value={roleFilter}
onChange={(_event, value) => {
setRoleFilter(value);
Expand Down Expand Up @@ -186,7 +186,7 @@ export const AnsibleVariablesSelector = ({
<Stack>
<StackItem>
<SearchInput
placeholder="Find by name"
placeholder={_('Find by name')}
value={variableFilter}
onChange={(_event, value) => setVariableFilter(value)}
onClear={() => setVariableFilter('')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
TextInputGroupUtilities,
} from '@patternfly/react-core';
import TimesIcon from '@patternfly/react-icons/dist/esm/icons/times-icon';
import { translate as _ } from 'foremanReact/common/I18n';

interface MatcherSelectorProps {
matcherOptions: SelectOptionProps[];
Expand Down Expand Up @@ -147,7 +148,7 @@ export const MatcherSelector = ({
<MenuToggle
ref={toggleRef}
variant="typeahead"
aria-label="Typeahead menu toggle"
aria-label={_('Typeahead menu toggle')}
onClick={onToggleClick}
isExpanded={isMatcherValueSelectOpen}
isFullWidth
Expand All @@ -160,7 +161,7 @@ export const MatcherSelector = ({
id="typeahead-select-input"
autoComplete="off"
innerRef={textInputRef}
placeholder="Select a matcher value"
placeholder={_('Select a matcher value')}
{...(activeItemId && { 'aria-activedescendant': activeItemId })}
role="combobox"
isExpanded={isMatcherValueSelectOpen}
Expand All @@ -173,7 +174,7 @@ export const MatcherSelector = ({
<Button
variant="plain"
onClick={onClearButtonClick}
aria-label="Clear input value"
aria-label={_('Clear input value')}
>
<TimesIcon aria-hidden />
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ export const OverrideManagementModal = ({
}
/>
<Popover
aria-label="Basic popover"
aria-label={_('Basic popover')}
headerContent={<div>Matcher creation type</div>}
bodyContent={
<div>
Expand All @@ -255,7 +255,7 @@ export const OverrideManagementModal = ({
</div>
}
>
<Button variant="plain" aria-label="Action" isInline>
<Button variant="plain" aria-label={_('Action')} isInline>
<OutlinedQuestionCircleIcon />
</Button>
</Popover>
Expand Down Expand Up @@ -297,7 +297,7 @@ export const OverrideManagementModal = ({
}}
id="horizontal-form-title"
name="horizontal-form-title"
aria-label="Your title"
aria-label={_('Your title')}
>
{matcherTypes.map((option, index) => (
<FormSelectOption
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import axios, { AxiosResponse } from 'axios';
import { foremanUrl } from 'foremanReact/common/helpers';
import { addToast } from 'foremanReact/components/ToastsList';
import { useDispatch } from 'react-redux';
import { translate as _ } from 'foremanReact/common/I18n';
import ResourcesEmptyIcon from '@patternfly/react-icons/dist/esm/icons/resources-empty-icon';
import {
AnsibleVariableDetail,
Expand Down Expand Up @@ -171,7 +172,7 @@ export const OverridesTabContent = ({
) : (
<EmptyState>
<EmptyStateHeader
titleText="Variable does not have any overrides defined."
titleText={_('Variable does not have any overrides defined.')}
headingLevel="h4"
icon={<EmptyStateIcon icon={ResourcesEmptyIcon} />}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { ReactElement } from 'react';
import { ToggleGroup, ToggleGroupItem } from '@patternfly/react-core';
import { translate as _ } from 'foremanReact/common/I18n';

interface BooleanAdapterProps {
isEditMode: boolean;
Expand All @@ -14,13 +15,13 @@ export const BooleanAdapter = ({
}: BooleanAdapterProps): ReactElement => (
<ToggleGroup areAllGroupsDisabled={!isEditMode}>
<ToggleGroupItem
text="True"
text={_('True')}
buttonId="toggle-group-single-1"
isSelected={value}
onChange={(_event, selected) => selected && onChange(true)}
/>
<ToggleGroupItem
text="False"
text={_('False')}
buttonId="toggle-group-single-1"
isSelected={!value}
onChange={(_event, selected) => selected && onChange(false)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { ReactElement } from 'react';
import { Bullseye, NumberInput } from '@patternfly/react-core';
import { translate as _ } from 'foremanReact/common/I18n';

interface IntegerAdapterProps {
isEditMode: boolean;
Expand Down Expand Up @@ -29,9 +30,9 @@ export const IntegerAdapter = ({
}}
onPlus={() => onChange(value + 1)}
inputName="input1"
inputAriaLabel="number input 1"
minusBtnAriaLabel="input 2 minus"
plusBtnAriaLabel="input 2 plus"
inputAriaLabel={_('number input 1')}
minusBtnAriaLabel={_('input 2 minus')}
plusBtnAriaLabel={_('input 2 plus')}
widthChars={10}
/>
</Bullseye>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { ReactElement } from 'react';
import { Bullseye, NumberInput } from '@patternfly/react-core';
import { translate as _ } from 'foremanReact/common/I18n';

interface RealAdapterProps {
isEditMode: boolean;
Expand Down Expand Up @@ -29,9 +30,9 @@ export const RealAdapter = ({
}}
onPlus={() => onChange(value + 0.1)}
inputName="input1"
inputAriaLabel="number input 1"
minusBtnAriaLabel="input 2 minus"
plusBtnAriaLabel="input 2 plus"
inputAriaLabel={_('number input 1')}
minusBtnAriaLabel={_('input 2 minus')}
plusBtnAriaLabel={_('input 2 plus')}
widthChars={10}
/>
</Bullseye>
Expand Down
Loading
Loading