You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 17, 2022. It is now read-only.
//Note: correct locale was performing language switching functions which should not really be performed on every call to this filter - language now switched more fully on first translation call and better detection now done in translateCommonString
__( '%1$s page in base language %2$s was not found and was created using woocommerce create_pages() as page <a href="%3$s">%4$s</a>', 'woo-poly-integration' ), $page_type, $default_locale, edit_post_link( $pageid, 'link' ), $pageid );
__( '%1$s page in language %2$s was not found and must be created for the shop to work: this will be done automatically if Check WooCommerce Pages option is enabled in %3$s. Translations for this page may also be missing.', 'woo-poly-integration' ), $page_type, $default_locale, static::settingsLinkHTML() );
363
+
$failure = true;
364
+
}
326
365
}
327
366
$pages[ $page_type ] = $pageid;
328
367
}
@@ -334,16 +373,20 @@ public static function wpi_ensure_woocommerce_pages_translated() {
334
373
335
374
//for each page, check all the translations and fill in and link where necessary
__( '%1$s page did not have language - language set to %2$s on page <a href="%3$s">%4$s</a>', 'woo-poly-integration' ), $page_type, $default_locale, edit_post_link( $orig_page_id, 'link' ), $orig_page_id );
344
388
}
345
-
$translations[ $default_lang ] = $orig_page_id;
346
-
$changed = false;
389
+
$translations[ $orig_postlang ] = $orig_page_id;
347
390
foreach ( $langsas$langId => $langLocale ) {
348
391
$translation_id = $orig_page_id;
349
392
$langSlug = $lang_slugs[ $langId ];
@@ -356,67 +399,92 @@ public static function wpi_ensure_woocommerce_pages_translated() {
__( '%1$s page in language %2$s was not found and was created as page <a href="%3$s">%4$s</a>', 'woo-poly-integration' ), $page_type, $langLocale, get_edit_post_link( $translation_id, 'link' ), $translation_id );
__( '%1$s page in language %2$s was not found and must be created for the shop to work in this language: this will be done automatically if Check WooCommerce Pages option is enabled in %3$s.', 'woo-poly-integration' ), $page_type, $langLocale, static::settingsLinkHTML() );
__( '%1$s page in language %2$s has been deleted, please check the <a href="%3$s">trash</a>, and restore page %4$s', 'woo-poly-integration' ), $page_type, $langLocale, $baseURL . 'edit.php?post_status=trash&post_type=page&lang=' . $langSlug, $translation_id );
__( '%1$s page in language %2$s is in status %3$s and needs to be published for the shop to work properly, check page <a href="%4$s">%5$s</a>', 'woo-poly-integration' ), $page_type, $langLocale, $postStatus, get_edit_post_link( $translation_id, 'link' ), $translation_id );
__( '%1$s page in language %2$s is in status %3$s and needs to be published for the shop to work properly, check page id %4$s', 'woo-poly-integration' ), $page_type, $langLocale, $postStatus, $translation_id );
484
+
__( '%1$s page in language %2$s was linked in polylang but cannot be found, link will be removed to missing page %3$s', 'woo-poly-integration' ), $page_type, $langLocale, $translation_id );
485
+
unset( $translations[ $langSlug ] );
486
+
$failure = true;
487
+
$changed = true;
420
488
}
421
489
}
422
490
}
@@ -425,21 +493,33 @@ public static function wpi_ensure_woocommerce_pages_translated() {
0 commit comments