• Resolved techsmurfy

    (@techsmurfy)


    Without Yoast plugin, all I needed was to translate the wordpress core .po files to my language, which also includes the variables. Page is translated to Σελ?δα in greek, so for Page 2 in any archive page, it’d display Σελ?δα 2 as a title in my browser, which was perfectly fine.

    Now with Yoast, there is either the option to have a %%page%% variable with context (“page [no] of [total]”) or %%pagenumber%% which just prints the number (i.e. “2”, NOT “page 2”), which is somewhat confusing. ANYWAY, the thing is that Yoast doesn’t make use of the wordpress translation file now (at least for %%page%%), so it’s in english. I located the phrase in line 903 of class-wpseo-replace-vars.php file

    $replacement = sprintf( $sep . ' ' . __( 'Page %1$d of %2$d', 'wordpress-seo' ), $nr, $max );

    which I replaced with

    $replacement = sprintf( $sep . ' ' . __( 'Σελ?δα %1$d απ? %2$d', 'wordpress-seo' ), $nr, $max );

    Strangely now, instead of displaying ‘Σελ?δα 2 απ? 150’, it just displays ‘2/150’. Not to mention other things broken, like the blog page title using the homepage title template (?!?). WTF, all I did was replace two words.

    So my question would be, how can we properly translate the %%page%% variable, and/or is there a way to just use the original wordpress variable for page which just displayed ‘page [no]’ when the current page was >1.

    • This topic was modified 8 years ago by techsmurfy.
    • This topic was modified 8 years ago by techsmurfy.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support amboutwe

    (@amboutwe)

    This string is translatable but likely doesn’t have an approved translation in our plugin.

    If you’d like to help translate Yoast SEO into your language, please visit https://translate.www.ads-software.com/projects/wp-plugins/wordpress-seo

    The original string is Page %1$d of %2$d which will help you filter to the correct term quickly. For Greek in our current version, the term for translating can be found here.

    Thread Starter techsmurfy

    (@techsmurfy)

    Wow, one would think that for such a popular plugin there would be enough greek volunteers. Of course I’ll consider contributing to the translation, as soon as I set up my website!

    Thanks for the link. I exported the .po and translated the string in Poedit and uploaded it to the languages folder. It works! Actually the languages folder is the first place I had looked in, but all the .json files confused me, I thought that you couldn’t just drop a .po file and expect to work. Guess I was wrong.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Problem translating %%page%% variable’ is closed to new replies.