File size: 1,279 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import {
	PLUGIN_INSTALLATION_COMPLETED as COMPLETED,
	PLUGIN_INSTALLATION_ERROR as ERROR,
	PLUGIN_INSTALLATION_IN_PROGRESS as IN_PROGRESS,
} from 'calypso/state/plugins/installed/status/constants';
import type { PluginActionMessagesByStatus } from './types';

const ActivateMessages: PluginActionMessagesByStatus = {
	[ IN_PROGRESS ]: ( { hasSelectedSite, siteCount } ) =>
		hasSelectedSite
			? ( translate ) => translate( 'Activating' )
			: ( translate ) =>
					translate( 'Activating on %(count)s site', 'Activating on %(count)s sites', {
						args: { count: siteCount },
						count: siteCount,
					} ),
	[ COMPLETED ]: ( { hasSelectedSite, siteCount } ) =>
		hasSelectedSite
			? ( translate ) => translate( 'Activated' )
			: ( translate ) =>
					translate( 'Activated on %(count)s site', 'Activated on %(count)s sites', {
						args: { count: siteCount },
						count: siteCount,
					} ),
	[ ERROR ]: ( { hasSelectedSite, siteCount } ) =>
		hasSelectedSite
			? ( translate ) => translate( 'Failed to activate' )
			: ( translate ) =>
					translate(
						'Failed to activate on %(count)s site',
						'Failed to activate on %(count)s sites',
						{
							args: { count: siteCount },
							count: siteCount,
						}
					),
};

export default ActivateMessages;