| @@ -29,11 +29,11 @@ | ||
| 29 | 29 | <div class="aibui-form-group"> |
| 30 | 30 | <label for="aibui-target-lang">Target Language:</label> |
| 31 | 31 | <select id="aibui-target-lang" class="aibui-select"> |
| 32 | 32 | <option value="">-- Select Language --</option> |
| 33 | - ${Object.entries(aibuiTranslation.languages).map(([code, name]) => | |
| 34 | - `<option value="${code}">${name}</option>` | |
| 35 | - ).join('')} | |
| 33 | + ${Object.entries(aibuiTranslation.languages).map(([code, name]) => | |
| 34 | + `<option value="${code}">${name}</option>` | |
| 35 | + ).join('')} | |
| 36 | 36 | </select> |
| 37 | 37 | </div> |
| 38 | 38 | <div class="aibui-modal-message" id="aibui-modal-message" style="display: none;"></div> |
| 39 | 39 | </div> |
| @@ -138,8 +138,9 @@ | ||
| 138 | 138 | // Make AJAX request |
| 139 | 139 | $.ajax({ |
| 140 | 140 | url: aibuiTranslation.ajaxurl, |
| 141 | 141 | type: 'POST', |
| 142 | + timeout: 180000, // 5 minutes - AI translation can take longer for large pages | |
| 142 | 143 | data: { |
| 143 | 144 | action: 'aibui_translate_post', |
| 144 | 145 | nonce: aibuiTranslation.nonce, |
| 145 | 146 | post_id: postId, |
| @@ -147,9 +148,9 @@ | ||
| 147 | 148 | }, |
| 148 | 149 | success: function (response) { |
| 149 | 150 | if (response.success) { |
| 150 | 151 | showMessage('Translation created successfully! Redirecting...', 'success'); |
| 151 | - | |
| 152 | + | |
| 152 | 153 | // Redirect to edit page after short delay |
| 153 | 154 | setTimeout(() => { |
| 154 | 155 | if (response.data && response.data.edit_url) { |
| 155 | 156 | window.location.href = response.data.edit_url; |