WordPress.org

Ready to get started?Download WordPress

Forums

ReciPress
Loading of translations still not working (v1.8) (10 posts)

  1. daveshine (David Decker)
    Member
    Posted 2 years ago #

    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...:

    (1)
    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... :)

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

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

    or:

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

    Both definitions work as of my testing...

    (3)
    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 :)

    http://wordpress.org/extend/plugins/recipress/

    http://wordpress.org/extend/themes/recipress/

  2. Cerealfreak
    Member
    Posted 2 years ago #

    i definitely agree with daveshine :)

    gabriele - http://www.cookspot.it

  3. Tammy Hart
    Member
    Plugin Author

    Posted 2 years ago #

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

  4. daveshine (David Decker)
    Member
    Posted 2 years ago #

    Thanx a lot, Tammy :-)

    Btw, any launching date for "Pro"?

  5. Tammy Hart
    Member
    Plugin Author

    Posted 2 years ago #

    No hard, fast date. Here's my blog post about it http://recipress.com/general-news/recipress-pro/

  6. daveshine (David Decker)
    Member
    Posted 2 years ago #

    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 :)

  7. LDTech
    Member
    Posted 2 years ago #

    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.

    img1
    img2

  8. Cerealfreak
    Member
    Posted 2 years ago #

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

  9. daveshine (David Decker)
    Member
    Posted 2 years ago #

    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 :)

  10. Tammy Hart
    Member
    Plugin Author

    Posted 2 years ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags