| @@ -4,9 +4,9 @@ | ||
| 4 | 4 | if ( 'undefined' === typeof ajaxurl || 'undefined' === typeof wp || 'undefined' === typeof frmDom ) { |
| 5 | 5 | return; |
| 6 | 6 | } |
| 7 | 7 | |
| 8 | - const __ = wp.i18n.__; | |
| 8 | + const { __, sprintf } = wp.i18n; | |
| 9 | 9 | const { div, tag, svg } = frmDom; |
| 10 | 10 | const { maybeCreateModal, footerButton } = frmDom.modal; |
| 11 | 11 | |
| 12 | 12 | let autoId = 0; |
| @@ -73,9 +73,9 @@ | ||
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | function openEmbedModal() { |
| 76 | 76 | /* translators: %s type: ie form, view. */ |
| 77 | - const title = __( 'Embed %s', 'formidable' ).replace( '%s', getTypeDescription() ); | |
| 77 | + const title = sprintf( __( 'Embed %s', 'formidable' ), getTypeDescription() ); | |
| 78 | 78 | |
| 79 | 79 | modal = maybeCreateModal( |
| 80 | 80 | 'frm_embed_modal', |
| 81 | 81 | { |
| @@ -128,15 +128,15 @@ | ||
| 128 | 128 | const content = div({ className: 'frm-embed-modal-content frm_wrap' }); |
| 129 | 129 | const typeDescription = getTypeDescription(); |
| 130 | 130 | |
| 131 | 131 | /* translators: %s type: ie form, view. */ |
| 132 | - const existingPageDescription = __( 'Embed your %s into an existing page.', 'formidable' ).replace( '%s', typeDescription ); | |
| 132 | + const existingPageDescription = sprintf( __( 'Embed your %s into an existing page.', 'formidable' ), typeDescription ); | |
| 133 | 133 | |
| 134 | 134 | /* translators: %s type: ie form, view. */ |
| 135 | - const newPageDescription = __( 'Put your %s on a newly created page.', 'formidable' ).replace( '%s', typeDescription ); | |
| 135 | + const newPageDescription = sprintf( __( 'Put your %s on a newly created page.', 'formidable' ), typeDescription ); | |
| 136 | 136 | |
| 137 | 137 | /* translators: %s type: ie form, view. */ |
| 138 | - const insertManuallyDescription = __( 'Use shortcodes or PHP code to put the %s anywhere.', 'formidable' ).replace( '%s', typeDescription ); | |
| 138 | + const insertManuallyDescription = sprintf( __( 'Use shortcodes or PHP code to put the %s anywhere.', 'formidable' ), typeDescription ); | |
| 139 | 139 | |
| 140 | 140 | const options = [ |
| 141 | 141 | { |
| 142 | 142 | icon: '#frm_file_icon', |
| @@ -177,9 +177,9 @@ | ||
| 177 | 177 | |
| 178 | 178 | const typeDescription = getTypeDescription(); |
| 179 | 179 | |
| 180 | 180 | /* translators: %s: type (ie. view, form). */ |
| 181 | - const titleText = __( 'Select the page you want to embed your %s into.', 'formidable' ).replace( '%s', typeDescription ); | |
| 181 | + const titleText = sprintf( __( 'Select the page you want to embed your %s into.', 'formidable' ), typeDescription ); | |
| 182 | 182 | |
| 183 | 183 | const title = getLabel( titleText ); |
| 184 | 184 | title.setAttribute( 'for', 'frm_page_dropdown' ); |
| 185 | 185 | content.appendChild( title ); |
| @@ -188,9 +188,9 @@ | ||
| 188 | 188 | |
| 189 | 189 | doneButton = modal.querySelector( '.frm_modal_footer .button-primary' ); |
| 190 | 190 | doneButton.classList.remove( 'dismiss' ); |
| 191 | 191 | /* translators: %s: type (ie. view, form). */ |
| 192 | - doneButton.textContent = __( 'Insert %s', 'formidable' ).replace( '%s', typeDescription ); | |
| 192 | + doneButton.textContent = sprintf( __( 'Insert %s', 'formidable' ), typeDescription ); | |
| 193 | 193 | doneButton.addEventListener( 'click', redirectToExistingPageWithInjectedShortcode ); |
| 194 | 194 | |
| 195 | 195 | const dropdownWrapper = div(); |
| 196 | 196 | dropdownWrapper.innerHTML = response.html; |
| @@ -447,9 +447,9 @@ | ||
| 447 | 447 | icon.id = 'frm_copy_embed_' + getAutoId(); |
| 448 | 448 | icon.setAttribute( 'tabindex', 0 ); |
| 449 | 449 | icon.setAttribute( 'role', 'button' ); |
| 450 | 450 | /* translators: %s: Example type (ie. WordPress shortcode, API Form script) */ |
| 451 | - icon.setAttribute( 'aria-label', __( 'Copy %s', 'formidable' ).replace( '%s', label ) ); | |
| 451 | + icon.setAttribute( 'aria-label', sprintf( __( 'Copy %s', 'formidable' ), label ) ); | |
| 452 | 452 | icon.addEventListener( |
| 453 | 453 | 'click', |
| 454 | 454 | () => copyExampleToClipboard( icon.parentNode.querySelector( '.frm_embed_example' ) ) |
| 455 | 455 | ); |