• Resolved rinart73

    (@rinart73)


    “Page Not Found %sep% %sitename%” is successfully added to the String translation in Polylang. But changes don’t affect actual page 404 title: https://i.ibb.co/LgNNsTn/image.png
    My main website language is Italian however all 404 pages have the default English title.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support Rank Math Support

    (@rankmathteam)

    Hello @rinart73,

    Thank you for contacting Rank Math support and bringing your concern to our attention.

    Can you please confirm if other pages or post types’ meta title is translated just fine by Polylang? We need to check if the issue is only happening on your 404 page and not the rest of the pages.

    Looking forward to helping you.

    Thread Starter rinart73

    (@rinart73)

    Post title translation works fine.

    “tax_post_tag_title” and “tax_itinerary_tag_title”, which I assume works as a title structure for post and my custom post types (I created Itinerary Tag via CPTUI) taxonomy pages, don’t get translated either. I just didn’t notice that because all my varians are set to “%term% %sep% %sitename%”. So basically the name itself is translated. But not the structure that is set in the Strings translation.

    And it seems that “search_title” doesn’t get translated either.

    • This reply was modified 1 year, 9 months ago by rinart73.
    • This reply was modified 1 year, 9 months ago by rinart73.
    Thread Starter rinart73

    (@rinart73)

    I tried on clean WordPress install. Theme: Kadence. Plugins: Polylang and Rank Math SEO. 404 title still doesn’t get translated.

    Plugin Support Rank Math Support

    (@rankmathteam)

    Hello @rinart73

    You would need to bring this up with the support of that plugin.

    We have an open code request for adding the compatibility, but that is still pending for years:
    https://github.com/polylang/polylang/pull/373

    Sorry to disappoint but thus is not in our hands.

    You can check all the compatible translation plugins on this page:
    https://rankmath.com/compatibility/

    If there’s anything else we can help you with, please let us know.

    Thread Starter rinart73

    (@rinart73)

    I don’t really understand how page 404 title is related to Sitemap.

    Plugin Support Rank Math Support

    (@rankmathteam)

    Hello @rinart73

    It is about the overall compatibility with their plugin.

    A sitemap is one of the biggest incompatibilities along with others, as pointed out by you (404 pages).

    Sorry to disappoint, but there is not much we can do here.

    Please let us know if you need assistance with anything else. We are here to help.

    Thread Starter rinart73

    (@rinart73)

    UPDATE: In case anyone needs it, the following code will make certain Rank Math SEO options properly translateable via the Strings tab in Polylang.

    /*
     * Translate Rank Math SEO settings
     */
    $my_theme_translateable_rank_math_options = [
      'img_alt_format',
      'img_title_format',
      'breadcrumbs_separator',
      'breadcrumbs_prefix',
      'breadcrumbs_home_link',
      'breadcrumbs_home_label',
      'breadcrumbs_archive_format',
      'breadcrumbs_search_format',
      'breadcrumbs_404_label',
      'rss_before_content',
      'rss_after_content',
      'title_separator',
      'homepage_title',
      'homepage_description',
      'homepage_facebook_title',
      'homepage_facebook_description',
      'author_archive_title',
      'author_archive_description',
      'date_archive_title',
      'date_archive_description',
      'search_title',
      '404_title',
    ];
    
    add_filter('option_rank-math-options-titles', 'my_theme_translate_rank_math_seo_options', 10, 2);
    add_filter('option_rank-math-options-general', 'my_theme_translate_rank_math_seo_options', 10, 2);
    
    function my_theme_translate_rank_math_seo_options($arr, $name) {
      global $my_theme_translateable_rank_math_options;
      
      if(is_admin() or !function_exists('pll__')) {
        return $arr;
      }
    
      foreach($my_theme_translateable_rank_math_options as $option) {
        if(isset($arr[$option])) {
          $arr[$option] = pll__($arr[$option]);
        }
      }
    
      return $arr;
    }
    
    /*
     * Reinitialize Rank Math SEO settings in order to translate them
     */
    add_action('init', function() {
      if(!is_admin() and function_exists('pll__')) {
        rank_math()->settings->reset();
      }
    });
    Plugin Support Rank Math Support

    (@rankmathteam)

    Hello @rinart73,

    Thank you so much for sharing this here. We really appreciate your support.

    Please don’t hesitate to get in touch in case you need our assistance with anything else.

    Thank you.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Page 404 title is not translateable via Polylang’ is closed to new replies.