Skip to content

Commit

Permalink
added more localization
Browse files Browse the repository at this point in the history
  • Loading branch information
Advitya17 committed Nov 17, 2023
1 parent 04096fb commit 5e099a7
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 24 deletions.
2 changes: 1 addition & 1 deletion libs/counterfactuals/src/lib/CounterfactualChartLegend.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class CounterfactualChartLegend extends React.PureComponent<ICounterfactu
? localization.Counterfactuals.createWhatIfCounterfactual
: localization.Counterfactuals.createCounterfactual
}
ariaLabel="Counterfactual creation button"
ariaLabel={localization.Counterfactuals.counterfactualAriaLabel}
/>
{this.displayRevertButton() && (
<DefaultButton
Expand Down
2 changes: 1 addition & 1 deletion libs/counterfactuals/src/lib/CounterfactualPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export class CounterfactualPanel extends React.Component<
className={classes.button}
text={localization.Counterfactuals.saveAsNew}
onClick={this.handleSavePoint}
ariaLabel="Save as new datapoint button"
ariaLabel={localization.Counterfactuals.saveAsNewAriaLabel}
/>
</Stack.Item>
<Stack.Item align="end" grow={3}>
Expand Down
4 changes: 2 additions & 2 deletions libs/fairness/src/lib/Controls/BinDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ export class BinDialog extends React.PureComponent<
className={styles.saveButton}
text={localization.Fairness.BinDialog.save}
onClick={this.onSave}
ariaLabel="Save binning button"
ariaLabel={localization.Fairness.BinDialog.saveAriaLabel}
/>
<DefaultButton
className={styles.cancelButton}
text={localization.Fairness.BinDialog.cancel}
onClick={this.props.onCancel}
ariaLabel="Cancel binning button"
ariaLabel={localization.Fairness.BinDialog.cancelAriaLabel}
/>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion libs/fairness/src/lib/Controls/IntroTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export class IntroTab extends React.PureComponent<IIntroTabProps> {
id="nextButton"
className={styles.getStarted}
onClick={this.onNext}
ariaLabel="Get started button"
ariaLabel={localization.Fairness.Intro.getStartedAriaLabel}
>
{localization.Fairness.Intro.getStarted}
</PrimaryButton>
Expand Down
4 changes: 2 additions & 2 deletions libs/fairness/src/lib/Controls/WizardFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ export class WizardFooter extends React.PureComponent<IWizardFooterProps> {
className={styles.next}
text={localization.Fairness.Footer.next}
onClick={this.onNext}
ariaLabel="Next button"
ariaLabel={localization.Fairness.Footer.nextAriaLabel}
/>
{!!this.props.previousTabKey && (
<DefaultButton
className={styles.back}
text={localization.Fairness.Footer.back}
onClick={this.onPrevious}
ariaLabel="Back button"
ariaLabel={localization.Fairness.Footer.backAriaLabel}
/>
)}
</div>
Expand Down
16 changes: 14 additions & 2 deletions libs/localization/src/lib/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
"counterfactualName": "What-if counterfactual name",
"createWhatIfCounterfactual": "Create what-if counterfactual",
"createCounterfactual": "Counterfactual",
"counterfactualAriaLabel": "Counterfactual creation button",
"revertToBubbleChart": "View bubble chart",
"createOwn": "Create your own counterfactual:",
"currentClass": "Current class",
Expand All @@ -180,6 +181,7 @@
"recommendedPolicy": "Recommended policy gain",
"referenceDatapoint": "Reference datapoint: Row {0}",
"saveAsNew": "Save as new datapoint",
"saveAsNewAriaLabel": "Save as new datapoint button",
"saveDescription": "These counterfactuals are based on the model's prediction, and therefore may be capturing the same correlations that were picked up by the model. We do not advise users to make real-life decisions based on this tool. Use our toolkit for causal analysis for real-life decision-making scenarios.",
"seePrediction": "See prediction deltas",
"selectedDatapoint": "Selected datapoint",
Expand Down Expand Up @@ -484,11 +486,13 @@
},
"BinDialog": {
"cancel": "Cancel",
"cancelAriaLabel": "Cancel binning button",
"categoryHeader": "Bin values:",
"header": "Configure bins",
"makeCategorical": "Treat as categorical",
"numberOfBins": "Number of bins:",
"save": "Save"
"save": "Save",
"saveAriaLabel": "Save binning button"
},
"DropdownHeaders": {
"errorMetric": "Enable error bars",
Expand Down Expand Up @@ -527,7 +531,9 @@
},
"Footer": {
"back": "Back",
"next": "Next"
"backAriaLabel": "Back button",
"next": "Next",
"nextAriaLabel": "Next button"
},
"Header": {
"documentation": "Documentation",
Expand All @@ -541,6 +547,7 @@
"features": "Sensitive features",
"featuresInfo": "Sensitive features are used to split your data into groups. Fairness of your model across these groups is measured by fairness metrics. Fairness metrics quantify how much your model's behavior varies across these groups.",
"getStarted": "Get started",
"getStartedAriaLabel": "Get started button",
"introBody": "The fairness dashboard enables you to assess tradeoffs between performance and fairness of your models",
"performance": "Performance metric",
"performanceInfo": "Performance metrics are used to evaluate the overall quality of your model as well as the quality of your model in each group. The difference between the extreme values of the performance metric across the groups is reported as the disparity in performance.",
Expand Down Expand Up @@ -1489,6 +1496,7 @@
"ModelAssessment": {
"AddingTab": {
"AddButtonText": "Add",
"AddButtonTextAriaLabel": "Add tab button",
"CalloutContent": "Adding some components (error tree view, error heat map) will allow you to filter down the data from the global cohort that you see in the components below.",
"CalloutTitle": "Add component",
"TabAddedMessage": {
Expand Down Expand Up @@ -1517,7 +1525,9 @@
"Cohort": {
"apply": "Apply",
"delete": "Delete",
"deleteAriaLabel": "Delete cohort button",
"cancel": "Cancel",
"cancelAriaLabel": "Cancel cohort button",
"cohortInfo": "Cohort info",
"cohortList": "Cohort list",
"deleteCohort": "Deleting {0}?",
Expand Down Expand Up @@ -1894,7 +1904,9 @@
"upperQuartile": "Upper quartile"
},
"chartConfigApply": "Apply",
"chartConfigApplyAriaLabel": "Apply button",
"chartConfigCancel": "Cancel",
"chartConfigCancelAriaLabel": "Cancel button",
"chartConfigDatasetCohortSelectionPlaceholder": "Select dataset cohorts",
"chartConfigFeatureBasedCohortSelectionPlaceholder": "Select feature-based cohorts",
"confusionMatrix": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class AddTabButton extends React.Component<
<PrimaryButton
onClick={this.addTab}
text={localization.ModelAssessment.AddingTab.AddButtonText}
ariaLabel="Add tab button"
ariaLabel={localization.ModelAssessment.AddingTab.AddButtonTextAriaLabel}
/>
</Stack>
</Callout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ export class CohortDeleteDialog extends React.Component<ICohortDeleteDialogProps
<PrimaryButton
onClick={this.props.onDeleteClick}
text={localization.ModelAssessment.Cohort.delete}
ariaLabel="Delete cohort button"
ariaLabel={localization.ModelAssessment.Cohort.deleteAriaLabel}
/>
<DefaultButton
onClick={this.props.onDismiss}
text={localization.ModelAssessment.Cohort.cancel}
ariaLabel="Cancel button"
ariaLabel={localization.ModelAssessment.Cohort.cancelAriaLabel}
/>
</DialogFooter>
</Dialog>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,12 +282,12 @@ export class ChartConfigurationFlyout extends React.Component<
this.state.newlySelectedDatasetCohorts,
this.state.newlySelectedFeatureBasedCohorts
)}
ariaLabel="Apply button"
ariaLabel={localization.ModelAssessment.ModelOverview.chartConfigApplyAriaLabel}
/>
<DefaultButton
onClick={this.onDismiss}
text={localization.ModelAssessment.ModelOverview.chartConfigCancel}
ariaLabel="Cancel button"
ariaLabel={localization.ModelAssessment.ModelOverview.chartConfigCancelAriaLabel}
/>
</Stack>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,12 @@ export class FeatureConfigurationFlyout extends React.Component<
tooManyFeaturesSelected ||
(!featureSelectionChanged && !continuousFeatureBinningChanged)
}
ariaLabel="Apply button"
ariaLabel={localization.ModelAssessment.ModelOverview.chartConfigApplyAriaLabel}
/>
<DefaultButton
onClick={this.props.onDismissFlyout}
text={localization.ModelAssessment.ModelOverview.chartConfigCancel}
ariaLabel="Cancel button"
ariaLabel={localization.ModelAssessment.ModelOverview.chartConfigCancelAriaLabel}
/>
</Stack>
</Stack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,12 @@ export class MetricConfigurationFlyout extends React.Component<
onClick={this.onConfirm}
text={localization.ModelAssessment.ModelOverview.chartConfigApply}
disabled={noMetricsSelected}
ariaLabel="Apply button"
ariaLabel={localization.ModelAssessment.ModelOverview.chartConfigApplyAriaLabel}
/>
<DefaultButton
onClick={this.props.onDismissFlyout}
text={localization.ModelAssessment.ModelOverview.chartConfigCancel}
ariaLabel="Cancel button"
ariaLabel={localization.ModelAssessment.ModelOverview.chartConfigCancelAriaLabel}
/>
</Stack>
</Stack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,14 @@ export class ModelOverviewMetricChart extends React.Component<
this.props.onApplyMetric(this.state.newlySelectedMetric);
}}
text={localization.ModelAssessment.ModelOverview.chartConfigApply}
ariaLabel="Apply button"
ariaLabel={localization.ModelAssessment.ModelOverview.chartConfigApplyAriaLabel}
/>
<DefaultButton
onClick={(): void => {
this.setState({ metricSelectionFlyoutIsVisible: false });
}}
text={localization.ModelAssessment.ModelOverview.chartConfigCancel}
ariaLabel="Cancel button"
ariaLabel={localization.ModelAssessment.ModelOverview.chartConfigCancelAriaLabel}
/>
</Stack>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,14 @@ export class ProbabilityDistributionChart extends React.Component<
}
}}
text={localization.ModelAssessment.ModelOverview.chartConfigApply}
ariaLabel="Apply button"
ariaLabel={localization.ModelAssessment.ModelOverview.chartConfigApplyAriaLabel}
/>
<DefaultButton
onClick={(): void => {
this.setState({ probabilityFlyoutIsVisible: false });
}}
text={localization.ModelAssessment.ModelOverview.chartConfigCancel}
ariaLabel="Cancel button"
ariaLabel={localization.ModelAssessment.ModelOverview.chartConfigCancelAriaLabel}
/>
</Stack>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,14 +274,14 @@ export class RegressionDistributionChart extends React.Component<
}
}}
text={localization.ModelAssessment.ModelOverview.chartConfigApply}
ariaLabel="Apply button"
ariaLabel={localization.ModelAssessment.ModelOverview.chartConfigApplyAriaLabel}
/>
<DefaultButton
onClick={(): void => {
this.setState({ targetFlyoutIsVisible: false });
}}
text={localization.ModelAssessment.ModelOverview.chartConfigCancel}
ariaLabel="Cancel button"
ariaLabel={localization.ModelAssessment.ModelOverview.chartConfigCancelAriaLabel}
/>
</Stack>
);
Expand Down

0 comments on commit 5e099a7

Please sign in to comment.