Skip to content

Commit

Permalink
added localizations
Browse files Browse the repository at this point in the history
  • Loading branch information
Advitya17 committed Nov 17, 2023
1 parent 84f2ba5 commit 5b6ce1b
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 26 deletions.
11 changes: 6 additions & 5 deletions libs/core-ui/src/lib/Cohort/EditCohort/EditCohort.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,22 @@ export class EditCohort extends React.Component<
<Stack.Item align="start">
<DefaultButton
onClick={this.deleteCohort}
text="Delete"
text={localization.Interpret.CohortEditor.delete}
ariaLabel={localization.Interpret.CohortEditor.deleteAriaLabel}
disabled={disableDelete}
/>
</Stack.Item>
<Stack.Item align="end">
<Stack horizontal tokens={stackTokens}>
<PrimaryButton
onClick={this.editCohort}
text="Save"
ariaLabel="Save cohort button"
text={localization.Interpret.CohortEditor.save}
ariaLabel={localization.Interpret.CohortEditor.saveAriaLabel}
/>
<DefaultButton
onClick={this.props.onDismiss}
text="Cancel"
ariaLabel="Cancel cohort button"
text={localization.Interpret.CohortEditor.cancel}
ariaLabel={localization.Interpret.CohortEditor.cancelAriaLabel}
/>
</Stack>
</Stack.Item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,20 +123,20 @@ export class CohortEditor extends React.PureComponent<
<PrimaryButton
onClick={(): void => this.saveCohort()}
disabled={this.isSaveDisabled()}
ariaLabel="Save cohort button"
ariaLabel={localization.Interpret.CohortEditor.saveAriaLabel}
>
{localization.Interpret.CohortEditor.save}
</PrimaryButton>
<DefaultButton
onClick={(): void => this.saveCohort(true)}
disabled={this.isSaveDisabled()}
ariaLabel="Save cohort and switch button"
ariaLabel={localization.Interpret.CohortEditor.saveAndSwitchAriaLabel}
>
{localization.Interpret.CohortEditor.saveAndSwitch}
</DefaultButton>
<DefaultButton
onClick={this.onCancelClick}
ariaLabel="Cancel cohort button"
ariaLabel={localization.Interpret.CohortEditor.cancelAriaLabel}
>
{localization.Interpret.CohortEditor.cancel}
</DefaultButton>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,14 @@ export class CohortEditorFilter extends React.Component<ICohortEditorFilterProps
onClick={(): void =>
this.props.saveState(this.props.filterIndex)
}
ariaLabel="Save cohort button"
ariaLabel={localization.Interpret.CohortEditor.saveAriaLabel}
/>
</Stack.Item>
<Stack.Item>
<DefaultButton
text={localization.Interpret.CohortEditor.cancel}
onClick={(): void => this.props.cancelFilter()}
ariaLabel="Cancel cohort button"
ariaLabel={localization.Interpret.CohortEditor.cancelAriaLabel}
/>
</Stack.Item>
</>
Expand All @@ -170,7 +170,7 @@ export class CohortEditorFilter extends React.Component<ICohortEditorFilterProps
<PrimaryButton
text={localization.Interpret.CohortEditor.addFilter}
onClick={this.onAddFilterClick}
ariaLabel="Add cohort filter button"
ariaLabel={localization.Interpret.CohortEditor.addFilterAriaLabel}
/>
</Stack.Item>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class CohortList extends React.PureComponent<ICohortListProps> {
text={localization.Interpret.CohortBanner.editCohort}
iconProps={{ iconName: "Edit" }}
styles={{ label: { whiteSpace: "nowrap" } }}
ariaLabel="Edit cohort button"
ariaLabel={localization.Interpret.CohortBanner.editCohortAriaLabel}
/>
</Stack>
</Stack.Item>
Expand Down
6 changes: 3 additions & 3 deletions libs/core-ui/src/lib/Cohort/SaveCohort/SaveCohort.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,21 +101,21 @@ export class SaveCohort extends React.Component<
this.saveCohort();
}}
text={localization.ErrorAnalysis.SaveCohort.save}
ariaLabel="Save cohort button"
ariaLabel={localization.Interpret.CohortEditor.saveAriaLabel}
/>
<DefaultButton
onClick={(): void => {
this.props.onDismiss();
this.saveCohort(true);
}}
ariaLabel="Save cohort and switch button"
ariaLabel={localization.Interpret.CohortEditor.saveAndSwitchAriaLabel}
>
{localization.Interpret.CohortEditor.saveAndSwitch}
</DefaultButton>
<DefaultButton
onClick={this.props.onDismiss}
text={localization.ErrorAnalysis.SaveCohort.cancel}
ariaLabel="Cancel save cohort button"
ariaLabel={localization.Interpret.CohortEditor.cancelAriaLabel}
/>
</DialogFooter>
</Dialog>
Expand Down
4 changes: 2 additions & 2 deletions libs/core-ui/src/lib/Cohort/ShiftCohort/ShiftCohort.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ export class ShiftCohort extends React.Component<
<PrimaryButton
onClick={this.onApplyClick}
text={localization.Core.ShiftCohort.apply}
ariaLabel="Apply cohort button"
ariaLabel={localization.Core.ShiftCohort.applyAriaLabel}
/>
<DefaultButton
onClick={this.props.onDismiss}
text={localization.Core.ShiftCohort.cancel}
ariaLabel="Cancel cohort button"
ariaLabel={localization.Interpret.CohortEditor.cancelAriaLabel}
/>
</DialogFooter>
</Dialog>
Expand Down
4 changes: 2 additions & 2 deletions libs/core-ui/src/lib/components/AxisConfigDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,13 @@ export class AxisConfigDialog extends React.PureComponent<
<Stack horizontal tokens={{ childrenGap: "l1", padding: "l1" }}>
<PrimaryButton
onClick={this.saveState}
ariaLabel="Apply cohort button"
ariaLabel={localization.Core.ShiftCohort.applyAriaLabel}
>
{localization.Interpret.AxisConfigDialog.apply}
</PrimaryButton>
<DefaultButton
onClick={this.props.onCancel}
ariaLabel="Cancel cohort button"
ariaLabel={localization.Interpret.CohortEditor.cancelAriaLabel}
>
{localization.Interpret.CohortEditor.cancel}
</DefaultButton>
Expand Down
5 changes: 3 additions & 2 deletions libs/core-ui/src/lib/components/ConfirmationDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
DialogType,
PrimaryButton
} from "@fluentui/react";
import { localization } from "@responsible-ai/localization";
import React from "react";

export interface IConfirmationDialogProps {
Expand Down Expand Up @@ -40,12 +41,12 @@ export class ConfirmationDialog extends React.Component<IConfirmationDialogProps
<PrimaryButton
onClick={this.props.onConfirm}
text={this.props.confirmButtonText}
ariaLabel="Confirm button"
ariaLabel={localization.Interpret.CohortEditor.confirmButtonAriaLabel}
/>
<DefaultButton
onClick={this.props.onClose}
text={this.props.cancelButtonText}
ariaLabel="Cancel button"
ariaLabel={localization.Interpret.CohortEditor.cancelButtonAriaLabel}
/>
</DialogFooter>
</Dialog>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export class CohortToolBar extends React.Component<
<PrimaryButton
text={localization.InterpretVision.Cohort.save}
onClick={this.openDialogue}
ariaLabel="Save cohort button"
ariaLabel={localization.Interpret.CohortEditor.saveAriaLabel}
/>
</Stack.Item>
</Stack>
Expand Down Expand Up @@ -131,12 +131,12 @@ export class CohortToolBar extends React.Component<
<PrimaryButton
onClick={this.addCohortWrapper(true)}
text={localization.InterpretVision.Cohort.saveAndSwitch}
ariaLabel="Save and switch cohort button"
ariaLabel={localization.Interpret.CohortEditor.saveAndSwitchAriaLabel}
/>
<DefaultButton
onClick={this.addCohortWrapper(false)}
text={localization.InterpretVision.Cohort.saveAndClose}
ariaLabel="Save and close cohort button"
ariaLabel={localization.InterpretVision.Cohort.saveAndCloseAriaLabel}
/>
</DialogFooter>
</Stack.Item>
Expand Down
12 changes: 12 additions & 0 deletions libs/localization/src/lib/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
},
"ShiftCohort": {
"apply": "Apply",
"applyAriaLabel": "Apply cohort button",
"cancel": "Cancel",
"title": "Switch Cohort",
"subText": "Select a cohort from the cohort list. Apply the cohort to the dashboard.",
Expand Down Expand Up @@ -893,6 +894,7 @@
"duplicateCohort": "Duplicate",
"edit": "Edit",
"editCohort": "Edit cohort",
"editCohortAriaLabel": "Edit cohort button",
"features": "{0} features",
"filters": "{0} filters",
"multiclassClassifier": "Multiclass classifier",
Expand Down Expand Up @@ -920,26 +922,33 @@
"_placeholderName.comment": "starting name for a new cohort",
"_selectFilter.comment": "prompt to select an attribute to filter on",
"addFilter": "Add filter",
"addFilterAriaLabel": "Add cohort filter button",
"addedFilters": "Filters",
"cancel": "Cancel",
"cancelAriaLabel": "Cancel cohort button",
"cancelExistingCohort": "Are you sure you want to cancel editing cohort and go back?",
"cancelNewCohort": "Are you sure you want to cancel creating a new cohort and go back?",
"cancelNo": "No",
"cancelButtonAriaLabel": "Cancel button",
"cancelTitle": "Cancel cohort",
"cancelYes": "Yes",
"confirmButtonAriaLabel": "Confirm button",
"cohortNameError": "Missing cohort name",
"cohortNameDupError": "Cohort with same name already exists",
"cohortNameLabel": "Dataset cohort name",
"cohortNamePlaceholder": "Name your cohort",
"clearAllFilters": "Clear all filters",
"defaultFilterState": "Select a filter to add parameters to your dataset cohort. Filters from your current viewing cohort are pre-populated.",
"delete": "Delete",
"deleteAriaLabel": "Delete cohort button",
"invalidValueError": "Value should be between {0} and {1}",
"minimumGreaterThanMaximum": "Minimum value inputs must be less than maximum value inputs.",
"noAddedFilters": "No filters",
"placeholderName": "Cohort {0}",
"save": "Save",
"saveAriaLabel": "Save cohort button",
"saveAndSwitch": "Save and switch",
"saveAndSwitchAriaLabel": "Save and switch cohort button",
"selectFilter": "Select filter",
"noFiltersApplied": "No filters applied",
"filterAdded": "Filter added"
Expand Down Expand Up @@ -1428,6 +1437,7 @@
"itemsSelectedPlural": "items selected",
"save": "Save cohort",
"saveAndClose": "Save and close",
"saveAndCloseAriaLabel": "Save and close cohort button",
"saveAndSwitch": "Save and switch",
"textField": "New cohort name",
"title": "Save new cohort"
Expand Down Expand Up @@ -1514,6 +1524,7 @@
"deleteConfirm": "Are you sure you want to delete this cohort?",
"selectCohort": "Select a cohort",
"shiftCohort": "Switch cohort",
"shiftCohortAriaLabel": "Switch cohort button",
"shiftCohortDescription": "Select a cohort from the cohort list. Apply the cohort to the dashboard."
},
"CohortInformation": {
Expand Down Expand Up @@ -1993,6 +2004,7 @@
"cohortList": "Time series list",
"selectCohort": "Select a time series",
"shiftCohort": "Switch time series",
"shiftCohortAriaLabel": "Switch time series button",
"shiftCohortDescription": "Select a time series from the time series list. Apply the time series to the dashboard."
},
"TimeSeriesSettings": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,12 @@ export class ShiftCohort extends React.Component<
<PrimaryButton
onClick={this.shiftCohort}
text={localizationBase.apply}
ariaLabel="Shift cohort button"
ariaLabel={localizationBase.shiftCohortAriaLabel}
/>
<DefaultButton
onClick={this.props.onDismiss}
text={localizationBase.cancel}
ariaLabel="Cancel cohort button"
ariaLabel={localization.Interpret.CohortEditor.cancelAriaLabel}
/>
</DialogFooter>
</Dialog>
Expand Down

0 comments on commit 5b6ce1b

Please sign in to comment.