Rankmath pagination translation issue

#947350
  • Resolved Kiraly Zoltan
    Rank Math free

    Greetings!

    I am having issues with translating my pagination to Romanian. How can I fix it? No matter what I do it uses english, tried editing .po files with Poedit, tried using Loco translate. Nothing works

    And I can confirm that if I deactivate Rank Math the “Page” strings get translated correctly.

    What could be the issue?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Hello,

    We apologize for the issue you are facing with translating pagination in Rank Math. It seems that the plugin is not picking up the translations for the pagination strings as expected.

    To address this issue, you can try the following steps:

    1. Check WPML String Translation: If you are using WPML, ensure that the pagination strings are translated in the WPML String Translation settings. You can do this by navigating to WordPress Dashboard → WPML → String Translation and searching for the pagination strings to add your Romanian translations.

    2. Use WPML’s Custom Fields Translation: Make sure that the custom fields translation settings in WPML are set correctly. Go to WPML → Settings and under the Custom fields translation section, ensure that it is set to Translate instead of Copy once. This will allow WPML to manage translations for those fields properly.

    3. Check Rank Math Settings: Ensure that there are no settings in Rank Math that might be overriding your translations. Sometimes, specific settings can affect how strings are displayed.

    4. Clear Cache: If you have any caching plugins active, clear your cache after making changes to ensure that the latest translations are being loaded.

    5. Re-save Permalinks: Sometimes, simply re-saving your permalinks can help resolve translation issues. Go to Settings → Permalinks and click on Save Changes without making any changes.

    If these steps do not resolve the issue, we recommend replying to this ticket so a human agent from the Rank Math Support team can assist you further with this specific problem.

    Thank you for raising this concern! We appreciate your patience as we work to resolve it.

    Sources:
    Multilingual SEO with Rank Math SEO & WPML » Rank Math

    1. I am not using WPML, and my site is not multilanguage, it is just a site that is not in english.
    3. Searched far and wide before posting here, nothing worked.
    4. Cache was cleared.
    5. Permalinks were updated

    Hello,

    Thank you for your query and we are so sorry about the trouble this must have caused.

    Rank Math only depends on translation plugins to translate the page label in the title and since you’re not using one, Rank Math will only add Page in the title after you enable the plugin.

    If you prefer the WordPress-generated title with the correctly translated page label, you can add the following filter code:

    add_filter( 'rank_math/frontend/title', function( $title ) {
    	if(is_paged()){
    		return false;
    	}
    	
    	return $title;
    });

    You may refer to this guide on how to add filters to your website: https://rankmath.com/kb/wordpress-hooks-actions-filters/

    This will disable Rank Math overriding the archives or paginated pages.

    Hope that helps.

    I can confirm that this works, and changes the pagination within the <title> to romanian, but the problem still remains in other places like the rankmath breadcrumb, and also disables the SEO structure of the title. Is there a way to enforce rankmath to use the romanian language sitewide? Without doing hacks with filters?

    I am a developer, so if you have any suggestions that I could start on that would be perfect.

    Hello,

    The breadcrumb pagination is also ready to be translated from the default translations of the plugin:
    Breadcrumb translation

    This is translated from the language file with the following identifier:

    
    #. translators: %s expands to the current page number
    #: includes/frontend/class-breadcrumbs.php:578
    msgid "Page %s"
    

    Usually, the language files are saved under wp-content\languages\plugins.

    Can you double-check the translation files on your website?

    Looking forward to helping you.

    I’ve found the problem, it is within wp-content/plugins/seo-by-rank-math/rank-math.php . I commented out unload_textdomain( 'rank-math' ); within the plugin file and now the translations work as expected.

    Can you apply this fix to the plugin so I can still receive further updates?

    Hello,

    The issue arises because Rank Math prioritizes loading translations from specific directories to maintain consistent localization. The unload_textdomain('rank-math') function is crucial as it clears any previously loaded translations for the rank-math text domain, preventing conflicts.

    Please ensure your .mo and .po files are in the correct language directory as you’ve mentioned. Once these files are in the right location and formatted correctly, Rank Math should detect and apply the translations without needing to modify the plugin files.

    Looking forward to helping you.

    My rankmath translation file locations:
    wp-content/languages/plugins/rank-math-ro_RO.l10n.php
    wp-content/languages/plugins/rank-math-ro_RO.mo
    wp-content/languages/plugins/rank-math-ro_RO.po

    Are you saying this is not correct? Where should I place my translation files if not there? If I uncomment unload_textdomain('rank-math') , then the issue arises again.

    Looks like I’ve fixed the issue by renaming my translation files from:
    wp-content/languages/plugins/rank-math-ro_RO.l10n.php
    wp-content/languages/plugins/rank-math-ro_RO.mo
    wp-content/languages/plugins/rank-math-ro_RO.po

    To:
    wp-content/languages/plugins/seo-by-rank-math-ro_RO.l10n.php
    wp-content/languages/plugins/seo-by-rank-math-ro_RO.mo
    wp-content/languages/plugins/seo-by-rank-math-ro_RO.po

    But why do the files get created with the wrong file name?

    Hello,

    The files are saved with the seo-by-rank-math name. Something or a plugin must have modified the file names and that’s why the translations were not working correctly. We are glad that you were able to figure this out and fix the issue.

    Please do not hesitate to let us know if you need our assistance with anything else.

Viewing 10 replies - 1 through 10 (of 10 total)

You must be logged in to reply to this ticket.