Download wp-calypso/client/landing/domains/utils.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 921 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/landing/domains/utils.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/landing/domains/utils.js
-
curl -L -o utils.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/landing/domains/utils.js
921 Bytes
| import { getLocaleSlug } from 'i18n-calypso'; | |
| import { get } from 'lodash'; | |
| import moment from 'moment'; | |
| export function getMaintenanceMessageFromError( error, translate ) { | |
| const maintenanceEndTime = get( error, [ 'data', 'maintenance_end_time' ], null ); | |
| const localeSlug = getLocaleSlug(); | |
| if ( maintenanceEndTime ) { | |
| return translate( | |
| "Our domain management system is currently undergoing maintenance and we can't process your request right now. Please try again %(when)s.", | |
| { | |
| args: { | |
| when: moment.unix( maintenanceEndTime ).locale( localeSlug ).fromNow(), | |
| }, | |
| comment: | |
| 'Where `when` is human readable time interval generated from moment.fromNow - something like "in an hour" or "in 30 minutes" and etc.', | |
| } | |
| ); | |
| } | |
| return translate( | |
| "Our domain management system is currently undergoing maintenance and we can't process your request right now. Please try again later." | |
| ); | |
| } | |