Support » Plugin: ReciPress » [Plugin: ReciPress] Loading of translations still not working (v1.8)

  • Hi Tammy!

    I am sorry but the loading of translations does still not work out of the box with v1.8. I found out the following issues after testing around with two different installs over 2 hours…:

    The general loading of the function and hook does NOT work! I’ve tried every possible combination of the function with the init hook and all priorities (loading order), also placement of the function/hook at the beginning of the code, in between and so on. The result is always the same: no displayed translations or only a few but NOT ALL!
    The only thing that works is to place the following at the beginning of the plugin code – in recipress.php around line 33 or so:

    load_plugin_textdomain( 'recipress', false, basename( dirname( __FILE__ ) ) . '/lang' );

    –> This works very well and displays ALL available translations no matter if I am in frontend or backend – all options pages, inline post metaboxes and the actual posts… 🙂

    defined constant for path to lang folder does not work, you have to use something like in the loading call:

    basename( dirname( __FILE__ ) ) . '/lang'


    dirname( plugin_basename( __FILE__ ) ) . '/lang'

    Both definitions work as of my testing…

    in /php/meta_box.php, line 65 cannot be translated because of wrong gettext syntax, you have to wrap it in “sprintf”, and then use placeholders for the html code and link code, like this:

    'desc'	=> sprintf( __( 'Click the plus icon to add another ingredient. %1$sManage Ingedients%2$s', 'recipress' ), '<a href="' . get_bloginfo( 'home' ) . '/wp-admin/edit-tags.php?taxonomy=ingredient">', '</a>' ),

    –> this code works very well and was tested live by me 🙂

    I really don’t know why the init hook for the translations does not work here, it’s really beyond me. I’ve searched the web high and low for this issue but couldn’t find any hint on that. Since the placing of “loading_plugin_textdomain” without function/hook does work very well and will do NO harm I suggest to use that and all may be happy 🙂

    Thank you!
    -Dave 🙂

Viewing 9 replies - 1 through 9 (of 9 total)
  • i definitely agree with daveshine 🙂

    gabriele –

    Plugin Author Tammy Hart


    Thanks’ Dave! I’m including this in my 1.9 commit now.

    Thanx a lot, Tammy 🙂

    Btw, any launching date for “Pro”?

    Plugin Author Tammy Hart


    No hard, fast date. Here’s my blog post about it

    Thanx, for the info! You can count me as pro supporter once it launches – for sure! You did an awesome work with this plugin, keep it up 🙂

    The translations loads as it should in v1.9. However only part of the translation is actually visible in the backend (concerns both the settings page and recipe input in posts). Most of it is still shown untranslated. I have tested this on two totally different WP installations with the same results.

    See screenshots where i marked the untranslated parts yellow.


    I confirm what LDTech said. Perhaps the .pot file is still to be consolidate?

    Yes, I can confirm also.

    The loading call is correct, but it fires too late – the line has to be moved to the beginning.

    In current state translations get loaded only when most other stuff is already loaded so missing lots of strings to display – loading should be moved from line 84 to very first position and then will display all things correctly 🙂

    Thanx, Dave 🙂

    Plugin Author Tammy Hart


    That is so weird. It should have worked fine with the init hook. Sorry this has been such a pain. I’m including the proper position in my next commit here in a few minutes.

    Dave, you’ve been a life saver. Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: ReciPress] Loading of translations still not working (v1.8)’ is closed to new replies.