Skip to content

Commit

Permalink
fix: fix unmarked translations (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
NawfalAhmed committed Jun 16, 2023
1 parent 23fcf91 commit baa036e
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 18 deletions.
15 changes: 8 additions & 7 deletions src/orders-and-subscriptions/OrdersAndSubscriptionsPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@ import { FormattedMessage, useIntl } from '@edx/frontend-platform/i18n';

import { BasicAlert, PageLoading } from '../components';

import Subscriptions, { fetchSubscriptions } from '../subscriptions';
import OrderHistory, { fetchOrders } from '../order-history';
import Subscriptions, { fetchSubscriptions } from '../subscriptions';

import { errorSelector, loadingSelector, showSubscriptionSelector } from './selectors';
import {
errorSelector,
loadingSelector,
showSubscriptionSelector,
} from './selectors';
import messages from './OrdersAndSubscriptionsPage.messages';

const OrdersAndSubscriptionsPage = () => {
const { formatMessage } = useIntl();
Expand Down Expand Up @@ -38,11 +43,7 @@ const OrdersAndSubscriptionsPage = () => {

const renderLoading = () => (
<PageLoading
srMessage={formatMessage({
id: 'ecommerce.order.history.loading',
defaultMessage: 'Loading orders and subscriptions...',
description: 'Message when orders and subscriptions page is loading.',
})}
srMessage={formatMessage(messages['ecommerce.order.history.loading'])}
/>
);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineMessages } from '@edx/frontend-platform/i18n';

const messages = defineMessages({
'ecommerce.order.history.loading': {
id: 'ecommerce.order.history.loading',
defaultMessage: 'Loading orders and subscriptions...',
description: 'Message when orders and subscriptions page is loading.',
},
});

export default messages;
18 changes: 7 additions & 11 deletions src/subscriptions/ManageSubscriptionsPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { PageLoading, SupportLink } from '../components';

import { fetchStripeCustomerPortalURL } from './actions';
import { subscriptionsSelector } from './selectors';
import messages from './ManageSubscriptionsPage.messages';

const ManageSubscriptionsPage = () => {
const { formatMessage } = useIntl();
Expand All @@ -15,12 +16,9 @@ const ManageSubscriptionsPage = () => {
subscriptionsSelector,
);

const buttonLabel = formatMessage({
id: 'ecommerce.order.history.manage.subscriptions.button',
defaultMessage: 'Orders and subscriptions',
description:
'Button label to navigate to the orders and subscriptions page.',
});
const buttonLabel = formatMessage(
messages['ecommerce.order.history.manage.subscriptions.button'],
);

useEffect(() => {
dispatch(fetchStripeCustomerPortalURL());
Expand All @@ -35,11 +33,9 @@ const ManageSubscriptionsPage = () => {

const renderLoading = () => (
<PageLoading
srMessage={formatMessage({
id: 'ecommerce.order.history.loading.manage.subscriptions',
defaultMessage: 'Loading manage subscriptions...',
description: 'Message when loading the manage subscriptions page.',
})}
srMessage={formatMessage(
messages['ecommerce.order.history.manage.subscriptions.loading'],
)}
/>
);

Expand Down
17 changes: 17 additions & 0 deletions src/subscriptions/ManageSubscriptionsPage.messages.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { defineMessages } from '@edx/frontend-platform/i18n';

const messages = defineMessages({
'ecommerce.order.history.manage.subscriptions.button': {
id: 'ecommerce.order.history.manage.subscriptions.button',
defaultMessage: 'Orders and subscriptions',
description:
'Button label to navigate to the orders and subscriptions page.',
},
'ecommerce.order.history.manage.subscriptions.loading': {
id: 'ecommerce.order.history.manage.subscriptions.loading',
defaultMessage: 'Loading manage subscriptions...',
description: 'Message when loading the manage subscriptions page.',
},
});

export default messages;

0 comments on commit baa036e

Please sign in to comment.