Skip to content

Commit

Permalink
Move translations used in multiple apps to global definition
Browse files Browse the repository at this point in the history
  • Loading branch information
Adamik10 committed Dec 16, 2023
1 parent 8b70551 commit dd6efd2
Show file tree
Hide file tree
Showing 25 changed files with 50 additions and 115 deletions.
15 changes: 0 additions & 15 deletions src/apps/advanced-search/AdvancedSearch.dev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,6 @@ export default {
},
defaultValue: "Remove @title from favorites list"
},
alertErrorCloseText: {
name: "Alert error close text",
defaultValue: "close",
control: { type: "text" }
},
alertErrorMessageText: {
name: "Alert error message text",
defaultValue: "An error occurred",
control: { type: "text" }
},
loadingText: {
name: "Loading",
defaultValue: "Loading",
Expand Down Expand Up @@ -359,11 +349,6 @@ export default {
name: "Advanced search filter - non-fiction",
defaultValue: "Non-fiction",
control: { type: "text" }
},
multiselectAllOptionText: {
name: "Multiselect - all option",
defaultValue: "All",
control: { type: "text" }
}
}
} as ComponentMeta<typeof AdvancedSearchEntry>;
Expand Down
3 changes: 0 additions & 3 deletions src/apps/advanced-search/AdvancedSearch.entry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import { GlobalEntryTextProps } from "../../core/storybook/globalTextArgs";

interface AdvancedSearchEntryTextProps {
addToFavoritesAriaLabelText: string;
alertErrorCloseText: string;
alertErrorMessageText: string;
byAuthorText: string;
etAlText: string;
inSeriesText: string;
Expand Down Expand Up @@ -68,7 +66,6 @@ interface AdvancedSearchEntryTextProps {
advancedSearchFilterOnlineText: string;
advancedSearchFilterFictionText: string;
advancedSearchFilterNonFictionText: string;
multiselectAllOptionText: string;
}

interface AdvancedSearchEntryConfigProps {
Expand Down
4 changes: 0 additions & 4 deletions src/apps/create-patron-user-info/CreatePatron.dev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@ export default {
defaultValue: "Phone number",
control: { type: "text" }
},
patronContactInfoBodyText: {
defaultValue: "Please enter contact information below",
control: { type: "text" }
},
patronContactInfoHeaderText: {
defaultValue: "Contact information",
control: { type: "text" }
Expand Down
1 change: 0 additions & 1 deletion src/apps/create-patron-user-info/CreatePatron.entry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ interface CreatePatronTextProps {
createPatronInvalidSSNHeaderText: string;
patronContactEmailCheckboxText: string;
patronContactEmailLabelText: string;
patronContactInfoBodyText: string;
patronContactInfoHeaderText: string;
patronContactNameLabelText: string;
patronContactPhoneCheckboxText: string;
Expand Down
4 changes: 0 additions & 4 deletions src/apps/dashboard/dashboard.dev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ export default {
defaultValue: "To be returned soon",
control: { type: "text" }
},
loansNotOverdueText: {
defaultValue: "Longer return time",
control: { type: "text" }
},
reservationsText: {
defaultValue: "Reservations",
control: { type: "text" }
Expand Down
1 change: 0 additions & 1 deletion src/apps/dashboard/dashboard.entry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export interface DashBoardProps {
etAlText: string;
feesText: string;
loanListMaterialDaysText: string;
loansNotOverdueText: string;
loansOverdueText: string;
loansSoonOverdueText: string;
materialAndAuthorText: string;
Expand Down
5 changes: 0 additions & 5 deletions src/apps/favorites-list/FavoritesList.dev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@ export default {
defaultValue: "Available",
control: { type: "text" }
},
availabilityUnavailableText: {
name: "Availability: unavailable text",
defaultValue: "Unavailable",
control: { type: "text" }
},
favoritesListMaterialsText: {
defaultValue: "@count materials",
control: { type: "text" }
Expand Down
1 change: 0 additions & 1 deletion src/apps/favorites-list/FavoritesList.entry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ interface FavoritesListConfigEntryProps {
}
interface FavoritesListTextEntryProps {
availabilityAvailableText: string;
availabilityUnavailableText: string;
favoritesListMaterialsText: string;
favoritesListHeaderText: string;
byAuthorText: string;
Expand Down
5 changes: 4 additions & 1 deletion src/apps/fee-list/FeeList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ const FeeList: FC = () => {
</span>
{!itemsPrePaymentChange && !itemsPostPaymentChange && (
<>
<ListHeader header={<>{t("unpaidFeesText")}</>} amount={0} />
<ListHeader
header={<>{t("unpaidFeesFirstHeadlineText")}</>}
amount={0}
/>
<EmptyList
classNames="mt-24"
emptyListText={t("emptyFeeListText")}
Expand Down
4 changes: 0 additions & 4 deletions src/apps/loan-list/list/loan-list.dev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,6 @@ export default {
resultPagerStatusText: {
defaultValue: "Showing @itemsShown out of @hitcount loans",
control: { type: "text" }
},
groupModalGoToMaterialAriaLabelText: {
defaultValue: "Go to @label material details",
control: { type: "text" }
}
},
decorators: [withQuery]
Expand Down
1 change: 0 additions & 1 deletion src/apps/loan-list/list/loan-list.entry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export interface LoanListEntryUrlProps {
}

interface LoanListEntryTextProps {
groupModalGoToMaterialAriaLabelText: string;
loanListAriaLabelListButtonText: string;
loanListAriaLabelStackButtonText: string;
loanListDigitalLoansEmptyListText: string;
Expand Down
20 changes: 0 additions & 20 deletions src/apps/material/material.dev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@ export default {
defaultValue: "Available",
control: { type: "text" }
},
availabilityUnavailableText: {
name: "Availability: unavailable text",
defaultValue: "Unavailable",
control: { type: "text" }
},
materialHeaderAllEditionsText: {
name: "Text for the fiction edition text",
defaultValue: "All editions",
Expand Down Expand Up @@ -307,11 +302,6 @@ export default {
defaultValue: "Material is loaned out",
control: { type: "text" }
},
findOnShelfExpandButtonExplanationText: {
name: "Find on shelf expand button explanation text",
defaultValue: "This button opens a modal",
control: { type: "text" }
},
materialIsIncludedText: {
name: "Material is included",
defaultValue: "This material doesn't count towards your loan quota",
Expand Down Expand Up @@ -738,16 +728,6 @@ export default {
defaultValue: "Film adaptations",
control: { type: "text" }
},
alertErrorCloseText: {
name: "Alert error close text",
defaultValue: "close",
control: { type: "text" }
},
alertErrorMessageText: {
name: "Alert error message text",
defaultValue: "An error occurred",
control: { type: "text" }
},
expandMoreText: {
name: "Expand more text",
defaultValue: "Expand more",
Expand Down
4 changes: 0 additions & 4 deletions src/apps/material/material.entry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@ import { GlobalEntryTextProps } from "../../core/storybook/globalTextArgs";

interface MaterialEntryTextProps {
addToFavoritesAriaLabelText: string;
alertErrorCloseText: string;
alertErrorMessageText: string;
alreadyReservedText: string;
approveReservationText: string;
availabilityAvailableText: string;
availabilityUnavailableText: string;
blockedButtonText: string;
cantReserveText: string;
cantViewReviewText: string;
Expand Down Expand Up @@ -55,7 +52,6 @@ interface MaterialEntryTextProps {
fictionNonfictionText: string;
filmAdaptationsText: string;
findOnBookshelfText: string;
findOnShelfExpandButtonExplanationText: string;
findOnShelfModalCloseModalAriaLabelText: string;
findOnShelfModalListFindOnShelfText: string;
findOnShelfModalListItemCountText: string;
Expand Down
8 changes: 0 additions & 8 deletions src/apps/patron-page/PatronPage.dev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,6 @@ export default {
defaultValue: "End date",
control: { type: "text" }
},
pauseReservationModalBelowInputsTextText: {
defaultValue: "",
control: { type: "text" }
},
pauseReservationModalLinkText: {
defaultValue:
"Read more about pausing reservertions and what that means here",
Expand Down Expand Up @@ -111,10 +107,6 @@ export default {
defaultValue: "Contact information",
control: { type: "text" }
},
patronContactInfoBodyText: {
defaultValue: "",
control: { type: "text" }
},
patronContactPhoneLabelText: {
defaultValue: "Phone number",
control: { type: "text" }
Expand Down
2 changes: 0 additions & 2 deletions src/apps/patron-page/PatronPage.entry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,13 @@ interface PatronPageTextProps {
patronPinSavedSuccessText: string;
dateInputsStartDateLabelText: string;
dateInputsEndDateLabelText: string;
pauseReservationModalBelowInputsTextText: string;
pauseReservationModalLinkText: string;
pauseReservationModalSaveButtonLabelText: string;
pauseReservationModalCancelButtonLabelText: string;
patronPageBasicDetailsHeaderText: string;
patronPageBasicDetailsNameLabelText: string;
patronPageBasicDetailsAddressLabelText: string;
patronContactInfoHeaderText: string;
patronContactInfoBodyText: string;
patronContactPhoneLabelText: string;
patronContactPhoneCheckboxText: string;
patronContactEmailLabelText: string;
Expand Down
4 changes: 0 additions & 4 deletions src/apps/reservation-list/list/reservation-list.dev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,6 @@ export default {
defaultValue: "End date",
control: { type: "text" }
},
pauseReservationModalBelowInputsTextText: {
defaultValue: "",
control: { type: "text" }
},
pauseReservationModalLinkText: {
defaultValue:
"Read more about pausing reservertions and what that means here",
Expand Down
1 change: 0 additions & 1 deletion src/apps/reservation-list/list/reservation-list.entry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ export interface ReservationListTextProps {
pauseReservationModalCloseModalText: string;
dateInputsStartDateLabelText: string;
dateInputsEndDateLabelText: string;
pauseReservationModalBelowInputsTextText: string;
pauseReservationModalLinkText: string;
pauseReservationModalSaveButtonLabelText: string;
pauseReservationModalCancelButtonLabelText: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const PauseReservation: FC<PauseReservationProps> = ({ id, user }) => {
</form>
<div className="modal-pause__text-link mt-24 color-secondary-gray">
<p className="text-body-small-regular">
{t("pauseReservationModalBelowInputsTextText")}
{t("pauseReservationModalBelowInputsText")}
<Link
id="pause-reservation-info-link"
href={pauseReservationInfoUrl}
Expand Down
10 changes: 0 additions & 10 deletions src/apps/search-header/search-header.dev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,6 @@ export default {
argTypes: {
...serviceUrlArgs,
...globalTextArgs,
alertErrorCloseText: {
name: "Alert error close text",
defaultValue: "close",
control: { type: "text" }
},
alertErrorMessageText: {
name: "Alert error message text",
defaultValue: "An error occurred",
control: { type: "text" }
},
searchHeaderIconAltText: {
name: "Alt text for search button image",
defaultValue: "search icon",
Expand Down
2 changes: 0 additions & 2 deletions src/apps/search-header/search-header.entry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import GlobalUrlEntryPropsInterface from "../../core/utils/types/global-url-prop
import { GlobalEntryTextProps } from "../../core/storybook/globalTextArgs";

export interface SearchHeaderTextProps {
alertErrorCloseText: string;
alertErrorMessageText: string;
searchHeaderIconAltText?: string;
searchHeaderInputLabelText?: string;
inputPlaceholderText?: string;
Expand Down
10 changes: 0 additions & 10 deletions src/apps/search-result/search-result.dev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,16 +210,6 @@ export default {
},
defaultValue: "Remove @title from favorites list"
},
alertErrorCloseText: {
name: "Alert error close text",
defaultValue: "close",
control: { type: "text" }
},
alertErrorMessageText: {
name: "Alert error message text",
defaultValue: "An error occurred",
control: { type: "text" }
},
loadingText: {
name: "Loading",
defaultValue: "Loading",
Expand Down
2 changes: 0 additions & 2 deletions src/apps/search-result/search-result.entry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import { GlobalEntryTextProps } from "../../core/storybook/globalTextArgs";
interface SearchResultEntryTextProps {
addMoreFiltersText: string;
addToFavoritesAriaLabelText: string;
alertErrorCloseText: string;
alertErrorMessageText: string;
byAuthorText: string;
etAlText: string;
facetAccessTypesText: string;
Expand Down
45 changes: 45 additions & 0 deletions src/core/storybook/globalTextArgs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,55 @@ export default {
name: "Alert error message text",
defaultValue: "An error occurred",
control: { type: "text" }
},
multiselectAllOptionText: {
name: "Multiselect - all option",
defaultValue: "All",
control: { type: "text" }
},
groupModalGoToMaterialAriaLabelText: {
defaultValue: "Go to @label material details",
control: { type: "text" }
},
availabilityUnavailableText: {
name: "Availability: unavailable text",
defaultValue: "Unavailable",
control: { type: "text" }
},
loansNotOverdueText: {
defaultValue: "Longer return time",
control: { type: "text" }
},
patronContactInfoBodyText: {
defaultValue: "",
control: { type: "text" }
},
pauseReservationModalBelowInputsText: {
defaultValue: "",
control: { type: "text" }
},
materialDetailsCloseModalAriaLabelText: {
defaultValue: "Close material details modal",
control: {
type: "text"
}
},
findOnShelfExpandButtonExplanationText: {
name: "Find on shelf expand button explanation text",
defaultValue: "This button opens a modal",
control: { type: "text" }
}
};

export interface GlobalEntryTextProps {
alertErrorCloseText: string;
alertErrorMessageText: string;
multiselectAllOptionText: string;
groupModalGoToMaterialAriaLabelText: string;
availabilityUnavailableText: string;
loansNotOverdueText: string;
patronContactInfoBodyText: string;
pauseReservationModalBelowInputsText: string;
materialDetailsCloseModalAriaLabelText: string;
findOnShelfExpandButtonExplanationText: string;
}
7 changes: 0 additions & 7 deletions src/core/storybook/materialDetailsModalArgs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ export default {
},
defaultValue: "Material Item Number"
},
materialDetailsCloseModalAriaLabelText: {
control: {
type: "text"
},
defaultValue: "Close material details modal"
},
materialDetailsLinkToPageWithFeesText: {
control: {
type: "text"
Expand Down Expand Up @@ -84,7 +78,6 @@ export interface MaterialDetailsModalProps {
materialDetailsPhysicalDueDateLabelText: string;
materialDetailsLoanDateLabelText: string;
materialDetailsMaterialNumberLabelText: string;
materialDetailsCloseModalAriaLabelText: string;
materialDetailsLinkToPageWithFeesText: string;
materialDetailsOverdueText: string;
feesPageUrl: string;
Expand Down
Loading

0 comments on commit dd6efd2

Please sign in to comment.