Skip to content

Commit

Permalink
refactor(locale): component strings (#179)
Browse files Browse the repository at this point in the history
* additional component strings
* vCenter casing
  • Loading branch information
cdcabrera committed Oct 20, 2022
1 parent 255bc01 commit 5c22489
Show file tree
Hide file tree
Showing 11 changed files with 388 additions and 123 deletions.
45 changes: 40 additions & 5 deletions public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
"confirmation_heading_add-source_edit": "Are you sure you want to cancel updating this source?",
"confirmation_title_add-source": "Cancel Add Source",
"confirmation_title_add-source_edit": "Cancel Updating Source",
"confirmation_title_add-scan": "Cancel Add Scan",
"confirmation_body_add-source_exit": "The wizard is in a pending state and will continue adding this source.",
"confirmation_body_add-source_exit_edit": "The wizard is in a pending state and will continue updating this source.",
"confirmation_heading_add-source_exit": "Are you sure you want to exit this wizard?",
"confirmation_title_add-source_exit": "Exit Wizard",
"confirmation_heading_add-scan": " Are you sure you want to cancel this scan?",
"confirmation_heading_delete-credential": "Are you sure you want to delete the credential <0>{{name}}</0>?",
"confirmation_heading_delete-credential_other": "Are you sure you want to delete the following credentials?",
"confirmation_title_delete-credential": "Delete Credential",
Expand All @@ -31,6 +33,14 @@
"confirmation_title_delete-source_other": "Delete Sources",
"confirmation_heading_delete-source": "Are you sure you want to delete the source <0>{{name}}</0>?",
"confirmation_heading_delete-source_other": "Are you sure you want to delete the following sources?",
"confirmation_body_merge-reports_valid": "Scans to be included in the merged report:",
"confirmation_body_merge-reports_invalid": "Failed scans that cannot be included in the merged report:",
"confirmation_body_merge-reports_list": "{{name}}",
"confirmation_body_merge-reports_list_id": "ID {{name}}",
"confirmation_footer_merge-reports": "Once the scan reports are merged, the results will be downloaded to your local machine.",
"confirmation_heading_merge-reports_valid": "Warning, only the selected scans with successful most recent scans will be included in the report.",
"confirmation_heading_merge-reports_invalid": "This action is invalid. You must select at least two scans with successful most recent scans.",
"confirmation_title_merge-reports": "Merge reports",
"empty-state_description_add-source": "{{context}}",
"empty-state_description_add-source_error": "There are errors on a previous step. Use the Back button to review your settings and try again.",
"empty-state_description_add-source_pending": "Please wait while source {{name}} is being created.",
Expand All @@ -41,6 +51,8 @@
"empty-state_title_add-source_error_edit": "Error Updating Source",
"empty-state_title_add-source_pending": "Creating Source...",
"empty-state_title_add-source_pending_edit": "Updating Source...",
"empty-state_title_create-scan_pending": "Scan updating...",
"empty-state_title_merge-reports_pending": "Merging reports...",
"label": "{{context}}",
"label_add": "Add",
"label_add-credential": "Add a credential",
Expand All @@ -49,11 +61,13 @@
"label_confirm": "Confirm",
"label_connection": "Connection",
"label_credential": "Credential",
"label_credential_error": "A credential is required",
"label_decision-manager": "Decision Manager",
"label_decision-manager_full": "Red Hat Decision Manager, formerly Red Hat JBoss BRMS",
"label_deep-scan": "Deep scan for these products",
"label_deep-scan_tooltip": "Deep scanning provides more accurate detection, but will take longer.",
"label_delete": "Delete",
"label_error": "Error",
"label_fuse": "Fuse",
"label_fuse_full": "Red Hat Fuse",
"label_jboss": "JBoss EAP",
Expand All @@ -80,14 +94,17 @@
"label_option_network_credential": "Network Credential",
"label_option_satellite": "Satellite",
"label_option_satellite_credential": "Satellite Credential",
"label_option_vcenter": "VCenter",
"label_option_vcenter_credential": "VCenter Credential",
"label_option_vcenter": "vCenter",
"label_option_vcenter_credential": "vCenter Credential",
"label_placeholder_add-credential": "Add Credential",
"label_placeholder_add-source_credential": "Select a credential",
"label_placeholder_add-source_credential_add": "Add a credential",
"label_placeholder_add-source_credential_multi": "Select one or more credentials",
"label_placeholder_add-source_credential_multi_add": "Add one or more credentials",
"label_paramiko": "Connect using Paramiko instead of Open <0>SSH</0>",
"label_port": "Port",
"label_port_error": "Port must be valid",
"label_port_placeholder": "Default port is 22",
"label_satellite": "Satellite",
"label_search-address": "IP address or hostname",
"label_search-address_error": "A valid IP address or hostname is required",
Expand All @@ -98,22 +115,36 @@
"label_search-addresses_help": "IP addresses, IP ranges, DNS host names, and wildcards are valid. Use CIDR or Ansible notation for ranges.",
"label_search-addresses_placeholder": "Enter values separated by commas",
"label_scan-alt-directories": "Scan alternate directories",
"label_scan-alt-directories_error": "Directories must begin with a root reference (/)",
"label_scan-alt-directories_help": "Default directories are /, /opt, /app, /home, /usr",
"label_scan-alt-directories_placeholder": "Optional. Enter values separated by commas",
"label_scan-concurrency": "Maximum concurrent scans",
"label_scan-concurrency_help": "Minimum value 1, maximum value 200",
"label_scan-name": "$t(form-dialog.label_name)",
"label_scan-name_error": "'A scan name is required",
"label_scan-name_placeholder": "Enter a name for the scan",
"label_sources": "Sources",
"label_source-type": "Select source type",
"label_ssh": "Secure Shell",
"label_ssl-certificate": "Verify SSL certificate",
"label_submit": "Submit",
"label_submit_add-source": "Save",
"label_submit_confirmation": "Confirm",
"label_submit_create-credential": "Save",
"label_submit_create-scan": "Scan",
"label_submit_merge-reports": "Merge",
"label_touchspin_input": "Number input",
"label_touchspin_max": "Increase number button",
"label_touchspin_min": "Decrease number button",
"label_vcenter": "vCenter",
"label_vcenter-server": "vCenter Server",
"label_yes": "Yes",
"title_add-source": "Add Source",
"title_add-source_edit": "Edit Source",
"title_add-source_step": "Source Type",
"title_add-source_step_two": "Credentials",
"title_add-source_step_three": "Confirm"
"title_add-source_step_three": "Confirm",
"title_create-scan": "Scan"
},
"modal": {
"aria-label-default": "Application modal"
Expand Down Expand Up @@ -210,7 +241,7 @@
"label_status_tooltip_success_sources_other": "{{count}} Successful Authentications",
"label_status_tooltip_unreachable": "{{count}} Unreachable System",
"label_status_tooltip_unreachable_other": "{{count}} Unreachable Systems",
"label_vcenter": "VCenter",
"label_vcenter": "vCenter",
"label_view": "View",
"tooltip_merge-reports": "Merge selected scan results into a single report"
},
Expand All @@ -229,11 +260,13 @@
"description_deleted-source_error": "Error removing source {{name}}. {{message}}",
"description_deleted-source_error_other": "Error removing sources {{name}} and more. {{message}}",
"description_error": "Application error",
"description_merge-reports_download": "Merged report downloaded.",
"description_scan-report_canceled": "Scan <0>{{name}}</0> stopped",
"description_scan-report_download": "Report <0>{{name}}</0> downloaded",
"description_scan-report_paused": "Scan <0>{{name}}</0> paused",
"description_scan-report_restart": "Scan <0>{{name}}</0> resumed",
"description_scan-report_play": "Scan <0>{{name}}</0> started",
"description_scan-report_start": "$t(toast-notifications.description_scan-report_play)",
"description_warning": "Application warning",
"title": "Notification",
"title_add-source_hidden": "Success creating source",
Expand All @@ -244,14 +277,16 @@
"title_deleted-credential_other": "Success deleting credentials",
"title_deleted-source": "Success deleting source",
"title_deleted-source_other": "Success deleting sources",
"title_merge-reports_error": "'Error merging reports",
"title_scan-report_start_error": "Error creating scan {{name}}",
"title_error": "Error",
"title_warning": "Warning"
},
"toolbar": {
"label_chip": "{{context}}",
"label_chip_network": "Network",
"label_chip_satellite": "Satellite",
"label_chip_vcenter": "VCenter",
"label_chip_vcenter": "vCenter",
"label_clear-filters": "Reset filters",
"label_option": "",
"label_option_name": "Name",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ exports[`AddSourceWizardStepTwo Component should display different forms for sou
id="port"
maxlength="5"
name="port"
placeholder="Default port is 22"
placeholder="t(form-dialog.label_port, {\\"context\\":\\"placeholder\\"})"
type="text"
value=""
/>
Expand Down Expand Up @@ -258,12 +258,7 @@ exports[`AddSourceWizardStepTwo Component should display different forms for sou
class="pf-c-check__label"
for="optionParamiko"
>
Connect using Paramiko instead of Open
<abbr
title="Secure Shell"
>
SSH
</abbr>
t(form-dialog.label, {"context":"paramiko"}, [object Object])
</label>
</div>
</div>
Expand Down Expand Up @@ -684,7 +679,7 @@ exports[`AddSourceWizardStepTwo Component should render a non-connected componen
id="port"
maxlength="5"
name="port"
placeholder="Default port is 22"
placeholder="t(form-dialog.label_port, {\\"context\\":\\"placeholder\\"})"
type="text"
value=""
/>
Expand Down Expand Up @@ -818,12 +813,7 @@ exports[`AddSourceWizardStepTwo Component should render a non-connected componen
class="pf-c-check__label"
for="optionParamiko"
>
Connect using Paramiko instead of Open
<abbr
title="Secure Shell"
>
SSH
</abbr>
t(form-dialog.label, {"context":"paramiko"}, [object Object])
</label>
</div>
</div>
Expand Down
14 changes: 10 additions & 4 deletions src/components/addSourceWizard/addSourceWizardStepTwo.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,17 @@ class AddSourceWizardStepTwo extends React.Component {
<FormGroup
label={t('form-dialog.label', { context: 'port' })}
error={(touched.port && errors.port) || stepTwoErrorMessages.port}
errorMessage="Port must be valid"
errorMessage={t('form-dialog.label', {
context: ['port', 'error']
})}
>
<TextInput
name="port"
value={values.port}
maxLength={5}
placeholder="Default port is 22"
placeholder={t('form-dialog.label', {
context: ['port', 'placeholder']
})}
onChange={handleOnEvent}
onClear={handleOnEvent}
validated={
Expand Down Expand Up @@ -376,7 +380,7 @@ class AddSourceWizardStepTwo extends React.Component {
<FormGroup
label={t('form-dialog.label', { context: 'credential' })}
error={(touched.credentials && errors.credentials) || stepTwoErrorMessages.credentials}
errorMessage={stepTwoErrorMessages.credentials || 'A credential is required'}
errorMessage={stepTwoErrorMessages.credentials || t('form-dialog.label', { context: ['credential', 'error'] })}
>
<InputGroup>
<DropdownSelect
Expand Down Expand Up @@ -437,7 +441,9 @@ class AddSourceWizardStepTwo extends React.Component {
return (
<FormGroup error={stepTwoErrorMessages.options} errorMessage={stepTwoErrorMessages.options}>
<Checkbox name="optionParamiko" checked={checked.optionParamiko || false} onChange={handleOnEvent}>
Connect using Paramiko instead of Open <abbr title="Secure Shell">SSH</abbr>
{t('form-dialog.label', { context: 'paramiko' }, [
<abbr title={t('form-dialog.label', { context: 'ssh' })} />
])}
</Checkbox>
</FormGroup>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ exports[`CreateScanDialog Component should handle multiple error responses: basi
>
Danger alert:
</span>
Error
t(form-dialog.label, {"context":"error"})
</h4>
<div
class="pf-c-alert__description"
Expand Down Expand Up @@ -119,7 +119,7 @@ exports[`CreateScanDialog Component should render a component, pending: pending
data-ouia-component-type="PF4/Title"
data-ouia-safe="true"
>
Scan
t(form-dialog.title, {"context":"create-scan"})
</h4>
</header>
<div
Expand Down Expand Up @@ -159,7 +159,7 @@ exports[`CreateScanDialog Component should render a component, pending: pending
data-ouia-component-type="PF4/Title"
data-ouia-safe="true"
>
Scan updating...
t(form-dialog.empty-state_title_create-scan, {"context":"pending"})
</h3>
</div>
</div>
Expand Down Expand Up @@ -224,7 +224,7 @@ exports[`CreateScanDialog Component should render a non-connected component: non
data-ouia-component-type="PF4/Title"
data-ouia-safe="true"
>
Scan
t(form-dialog.title, {"context":"create-scan"})
</h4>
</header>
<div
Expand All @@ -248,7 +248,7 @@ exports[`CreateScanDialog Component should render a non-connected component: non
<span
class="pf-c-form__label-text"
>
Name
t(form-dialog.label, {"context":"scan-name"})
</span>
</label>
Expand All @@ -265,7 +265,7 @@ exports[`CreateScanDialog Component should render a non-connected component: non
id="scanName"
maxlength="256"
name="scanName"
placeholder="Enter a name for the scan"
placeholder="t(form-dialog.label_scan-name, {\\"context\\":\\"placeholder\\"})"
type="text"
value=""
/>
Expand All @@ -284,7 +284,7 @@ exports[`CreateScanDialog Component should render a non-connected component: non
<span
class="pf-c-form__label-text"
>
Sources
t(form-dialog.label, {"context":"sources"})
</span>
</label>
Expand Down Expand Up @@ -317,7 +317,7 @@ exports[`CreateScanDialog Component should render a non-connected component: non
<span
class="pf-c-form__label-text"
>
Maximum concurrent scans
t(form-dialog.label, {"context":"scan-concurrency"})
</span>
</label>
Expand All @@ -333,7 +333,7 @@ exports[`CreateScanDialog Component should render a non-connected component: non
>
<button
aria-disabled="false"
aria-label="Decrease number button"
aria-label="t(form-dialog.label_touchspin, {\\"context\\":\\"min\\"})"
class="pf-c-button pf-m-control"
data-ouia-component-id="OUIA-Generated-Button-control-1"
data-ouia-component-type="PF4/Button"
Expand All @@ -356,7 +356,7 @@ exports[`CreateScanDialog Component should render a non-connected component: non
</button>
<input
aria-invalid="false"
aria-label="Number Input"
aria-label="t(form-dialog.label_touchspin, {\\"context\\":\\"input\\"})"
class="pf-c-form-control"
data-ouia-component-id="OUIA-Generated-TextInputBase-2"
data-ouia-component-type="PF4/TextInput"
Expand All @@ -367,7 +367,7 @@ exports[`CreateScanDialog Component should render a non-connected component: non
/>
<button
aria-disabled="false"
aria-label="Increase number button"
aria-label="t(form-dialog.label_touchspin, {\\"context\\":\\"max\\"})"
class="pf-c-button pf-m-control"
data-ouia-component-id="OUIA-Generated-Button-control-2"
data-ouia-component-type="PF4/Button"
Expand All @@ -393,7 +393,7 @@ exports[`CreateScanDialog Component should render a non-connected component: non
<div
class="pf-c-form__helper-text"
>
Minimum value 1, maximum value 200
t(form-dialog.label_scan-concurrency, {"context":"help"})
</div>
</div>
</div>
Expand Down Expand Up @@ -570,13 +570,13 @@ exports[`CreateScanDialog Component should render a non-connected component: non
disabled=""
id="displayScanDirectories"
name="displayScanDirectories"
placeholder="Optional. Enter values separated by commas"
placeholder="t(form-dialog.label_scan-alt-directories, {\\"context\\":\\"placeholder\\"})"
rows="4"
/>
<div
class="pf-c-form__helper-text"
>
Default directories are /, /opt, /app, /home, /usr
t(form-dialog.label_scan-alt-directories, {"context":"help"})
</div>
</div>
</div>
Expand Down
Loading

0 comments on commit 5c22489

Please sign in to comment.