Skip to content

Commit

Permalink
Fix hardcoded content warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
BPScott committed May 3, 2019
1 parent 76f9bb7 commit ac429bc
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/components/ProgressBar/ProgressBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ function ProgressBar({
<div className={className}>
<progress className={styles.Progress} value={parsedProgress} max="100" />
<div className={styles.Indicator} style={{width: `${parsedProgress}%`}}>
{/* eslint-disable-next-line shopify/jsx-no-hardcoded-content */}
<span className={styles.Label}>{parsedProgress}%</span>
</div>
</div>
Expand Down
7 changes: 6 additions & 1 deletion src/components/SkeletonPage/SkeletonPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export class SkeletonPage extends React.PureComponent<CombinedProps, never> {
secondaryActions,
title = '',
breadcrumbs,
polaris: {intl},
} = this.props;

const className = classNames(
Expand Down Expand Up @@ -80,7 +81,11 @@ export class SkeletonPage extends React.PureComponent<CombinedProps, never> {
) : null;

return (
<div className={className} role="status" aria-label="Page loading">
<div
className={className}
role="status"
aria-label={intl.translate('Polaris.SkeletonPage.loadingLabel')}
>
{headerMarkup}
<div className={styles.Content}>{children}</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/components/TopBar/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export class TopBar extends React.PureComponent<ComposedProps, State> {
onSearchResultsDismiss,
contextControl,
polaris: {
intl,
theme: {logo},
},
} = this.props;
Expand All @@ -77,7 +78,7 @@ export class TopBar extends React.PureComponent<ComposedProps, State> {
onClick={onNavigationToggle}
onFocus={this.handleFocus}
onBlur={this.handleBlur}
aria-label="Toggle menu"
aria-label={intl.translate('Polaris.TopBar.toggleMenuLabel')}
>
<Icon source={MobileHamburgerMajorMonotone} color="white" />
</button>
Expand Down
12 changes: 12 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@
}
},

"SkeletonPage": {
"loadingLabel": "Page loading"
},

"Spinner": {
"warningMessage": "The color {color} is not meant to be used on {size} spinners. The colors available on large spinners are: {colors}"
},
Expand All @@ -222,6 +226,14 @@
"TextField": {
"characterCount": "{count} characters",
"characterCountWithMaxLength": "{count} of {limit} characters used"
},

"TopBar": {
"toggleMenuLabel": "Toggle menu",

"SearchField": {
"clearButtonLabel": "Clear"
}
}
}
}

0 comments on commit ac429bc

Please sign in to comment.