How to use the i18n-calypso.translate function in i18n-calypso

To help you get started, we’ve selected a few i18n-calypso examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Automattic / woocommerce-services / client / lib / save-form / index.js View on Github external
return parseJson( response ).then( ( json ) => {
			if ( json.success ) {
				return setSuccess( true, json );
			}

			if ( 'rest_cookie_invalid_nonce' === json.code ) {
				setError( json.code );
				window.persistState = true;
				alert( __( 'There was a problem saving your settings. Please try again after the page is reloaded.' ) );
				location.reload();
				return;
			}

			if ( 'validation_failure' === _.get( json, 'data.error' ) && _.get( json, 'data.data.fields' ) ) {
				let fieldsStatus = json.data.data.fields;
				// Some services still give the field errors in an array, keep backwards-compatibility
				if ( _.isArray( fieldsStatus ) ) {
					fieldsStatus = {};
					json.data.data.fields.forEach( ( fieldName ) => fieldsStatus[ fieldName ] = EMPTY_ERROR );
				}
				return setFieldsStatus( fieldsStatus );
			}

			if ( json.data.message ) {
				return setError( json.data.message, json );
github Automattic / wp-calypso / client / lib / signup / site-type.js View on Github external
),
			siteTitlePlaceholder: i18n.translate( "E.g., Vail Renovations or Stevie's blog" ),
			// Site topic step
			siteTopicHeader: i18n.translate( 'What is your site about?' ),
			siteTopicLabel: i18n.translate( 'What is your site about?' ),
			siteTopicSubheader: i18n.translate(
				"We'll add relevant content to your site to help you get started."
			),
			siteTopicInputPlaceholder: i18n.translate( 'Enter a topic or choose one from below.' ),
			// Domains step
			domainsStepHeader: i18n.translate( 'Give your site an address' ),
			domainsStepSubheader: i18n.translate(
				'Enter a keyword that describes your site to get started.'
			),
			domainsStepHeaderTestCopy: i18n.translate( "Let's get your site a domain!" ),
			domainsStepSubheaderTestCopy: i18n.translate(
				"Tell us your site's name or a few keywords, and we'll come up with some suggestions."
			),
			// Site styles step
			siteStyleSubheader: i18n.translate(
				'This will help you get started with a theme you might like. You can change it later.'
			),
		},
		propertyKey,
		null
	);
github Automattic / wp-calypso / client / lib / signup / hint-data.js View on Github external
'Life inspiration': i18n.translate( 'Life inspiration' ),
	Lifestyle: i18n.translate( 'Lifestyle' ),
	'Lifestyle blog': i18n.translate( 'Lifestyle blog' ),
	'Literary portfolio': i18n.translate( 'Literary portfolio' ),
	Literature: i18n.translate( 'Literature' ),
	Living: i18n.translate( 'Living' ),
	'Local music': i18n.translate( 'Local music' ),
	'Local news': i18n.translate( 'Local news' ),
	Love: i18n.translate( 'Love' ),
	'Love stories': i18n.translate( 'Love stories' ),
	'Maid services': i18n.translate( 'Maid services' ),
	Makeup: i18n.translate( 'Makeup' ),
	Manga: i18n.translate( 'Manga' ),
	Maps: i18n.translate( 'Maps' ),
	Marketing: i18n.translate( 'Marketing' ),
	'Marketing services': i18n.translate( 'Marketing services' ),
	Massages: i18n.translate( 'Massages' ),
	Mathematics: i18n.translate( 'Mathematics' ),
	Mechanic: i18n.translate( 'Mechanic' ),
	Medical: i18n.translate( 'Medical' ),
	'Medical news': i18n.translate( 'Medical news' ),
	'Medical technology': i18n.translate( 'Medical technology' ),
	Medicine: i18n.translate( 'Medicine' ),
	Meditation: i18n.translate( 'Meditation' ),
	Men: i18n.translate( 'Men' ),
	"Men's heatlh": i18n.translate( "Men's heatlh" ),
	'Mental health': i18n.translate( 'Mental health' ),
	'Mexican restaurant': i18n.translate( 'Mexican restaurant' ),
	Military: i18n.translate( 'Military' ),
	Militia: i18n.translate( 'Militia' ),
	Milk: i18n.translate( 'Milk' ),
	Minecraft: i18n.translate( 'Minecraft' ),
github Automattic / wp-calypso / client / lib / plugins / notices.jsx View on Github external
}
						);
					case 'n sites n plugins':
						return i18n.translate(
							'Successfully installed and activated %(numberOfPlugins)d plugins on %(numberOfSites)d sites.',
							{
								args: translateArg,
							}
						);
				}

				break;
			case 'REMOVE_PLUGIN':
				switch ( combination ) {
					case '1 site 1 plugin':
						return i18n.translate( 'Successfully removed %(plugin)s on %(site)s.', {
							args: translateArg,
						} );
					case '1 site n plugins':
						return i18n.translate(
							'Successfully removed %(numberOfPlugins)d plugins on %(site)s.',
							{
								args: translateArg,
							}
						);
					case 'n sites 1 plugin':
						return i18n.translate( 'Successfully removed %(plugin)s on %(numberOfSites)d sites.', {
							args: translateArg,
						} );
					case 'n sites n plugins':
						return i18n.translate(
							'Successfully removed %(numberOfPlugins)d plugins on %(numberOfSites)d sites.',
github Automattic / wp-calypso / client / lib / plans / features-list.js View on Github external
getDescription: () =>
			i18n.translate( 'Automatically re-promote existing content to social media.' ),
		hideInfoPopover: true,
github Automattic / woocommerce-services / client / apps / shipping-label / components / label-purchase-modal / rates-step / list.js View on Github external
const getTitle = ( pckg, pckgId ) => {
		if ( hasSinglePackage ) {
			return __( 'Choose rate' );
		}
		return __( 'Choose rate: %(pckg)s', { args: { pckg: packageNames[ pckgId ] } } );
	};
github Automattic / delphin / app / components / ui / set-up-domain / connect-new-blog-to-other / index.js View on Github external
} ).then( () => {
			redirect( 'myDomains' );

			addNotice( {
				status: 'success',
				message: i18n.translate( "Your request has been sent. We'll be in touch with you soon." )
			} );
		} ).catch( () => {
			addNotice( {
github Automattic / wp-calypso / client / state / notices / middleware.js View on Github external
const id = `transaction-fetch-${ transactionId }`;
	if ( 'invalid_receipt' === error.error ) {
		return errorNotice(
			translate( "Sorry, we couldn't find receipt #%s.", { args: transactionId } ),
			{
				id,
				displayOnNextPage,
				duration: 5000,
			}
		);
	}

	return errorNotice( translate( "Sorry, we weren't able to load the requested receipt." ), {
		id,
		displayOnNextPage,
		button: translate( 'Try again' ),
		href: billingHistoryReceipt( transactionId ),
	} );
};
github Automattic / wp-calypso / client / my-sites / plugins / disconnect-jetpack / disconnect-jetpack-dialog.jsx View on Github external
renderInfo() {
		const { site } = this.props;

		if ( ! site ) {
			return translate( 'Disconnecting Jetpack will remove access to WordPress.com features.', {
				context: 'Jetpack: Warning message displayed prior to disconnecting multiple Jetpack Sites.'
			} );
		}

		return translate( 'Disconnecting Jetpack will remove access to WordPress.com features for %(siteName)s.', {
			args: {
				siteName: site.name || site.title
			},
			context: 'Jetpack: Warning message displayed prior to disconnecting a Jetpack Site.'
		} );
	}
github Automattic / wp-calypso / client / lib / plans / features-list.js View on Github external
		getTitle: () => i18n.translate( 'VideoPress Support' ),
		getDescription: () =>