Skip to content

Commit 6755420

Browse files
committed
Translate error messages
1 parent 65d0679 commit 6755420

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

projects/packages/forms/src/store/integrations/reducer.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { __ } from '@wordpress/i18n';
12
import {
23
RECEIVE_INTEGRATIONS,
34
INVALIDATE_INTEGRATIONS,
@@ -34,7 +35,7 @@ export default function reducer(
3435
return {
3536
...state,
3637
isLoading: false,
37-
error: action.error ?? 'Unknown error',
38+
error: action.error ?? __( 'Unknown error', 'jetpack-forms' ),
3839
};
3940
case RECEIVE_INTEGRATIONS:
4041
return {

projects/packages/forms/src/store/integrations/resolvers.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import apiFetch from '@wordpress/api-fetch';
2+
import { __ } from '@wordpress/i18n';
23
import { addQueryArgs } from '@wordpress/url';
34
import { INVALIDATE_INTEGRATIONS } from './action-types';
45
import { receiveIntegrations, setIntegrationsError, setIntegrationsLoading } from './actions';
@@ -14,7 +15,7 @@ export const getIntegrations =
1415
const result = await apiFetch< Integration[] >( { path } );
1516
dispatch( receiveIntegrations( result ) );
1617
} catch ( e ) {
17-
const message = e instanceof Error ? e.message : 'Unknown error';
18+
const message = e instanceof Error ? e.message : __( 'Unknown error', 'jetpack-forms' );
1819
dispatch( setIntegrationsError( message ) );
1920
} finally {
2021
dispatch( setIntegrationsLoading( false ) );

0 commit comments

Comments
 (0)