This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Widget Areas plugin translation

  • Creator
    Topic
  • #5607
    royeyal
    Participant

    Hey there
    I would like to translate the Widget Areas plugin.
    It would have been great if the plugin’s text domain (themeblvd_sidebars) was the same as the Jump Start framework (themeblvd).
    I could create manually a “lang” folder and put a .po file under the plugin’s main folder, but every upgrade I would lose the translation files.
    Is there a way to upgrade the plugin, and still keep the translation?
    Thank

Viewing 7 replies - 1 through 7 (of 7 total)
  • Author
    Replies
  • #5627
    Jason Bobich
    Keymaster

    I don’t do much localization, so I could be overlooking something, but wouldn’t the same thing happen when you update Jump Start? I think you could just copy all of the mo/po files to your Child theme and register them there, right?

    http://pastie.org/6251664

    function my_textdomains() {
    	load_theme_textdomain( 'themeblvd', get_stylesheet_directory() . '/lang' );
    	load_theme_textdomain( 'themeblvd_sidebars', get_stylesheet_directory() . '/lang' );
    	load_theme_textdomain( 'themeblvd_sliders', get_stylesheet_directory() . '/lang' );
    	load_theme_textdomain( 'themeblvd_builder', get_stylesheet_directory() . '/lang' );
    }
    add_action( 'after_setup_theme', 'my_textdomains' );
    #5833
    royeyal
    Participant

    Thanks for the code.
    It would be great if all the text strings of the plugins would be on the main “themeblvd” text domain, as many of them are.

    I hope future versions of your plugins will have a .pot file, or a .po file (such as theme-blvd-sliders-en_US.po).

    Thanks again.

    #5835
    Jason Bobich
    Keymaster

    It would be great if all the text strings of the plugins would be on the main “themeblvd” text domain, as many of them are.

    I honestly don’t think I’d do this. I think every plugin should have its unique localization text domain. I understand the logic of why you might want to do this with the theme framework and the plugin being so closely related, but I think as a just a general best practice, this isn’t a something I’d do — that being a theme and a plugin registering the same text domain.

    I hope future versions of your plugins will have a .pot file, or a .po file (such as theme-blvd-sliders-en_US.po).

    Sure, it’s just a matter of clicking the little button in poEdit. I can do it or you can do it, I suppose. 😉

    #5836
    royeyal
    Participant

    Jason, honest to god, I clicked the Update button on poEdit, and had the right source paths (“.” and even tried “..”) under Catalog Properties, and it wouldn’t find any flippin’ string.

    I don’t have any issues with custom translation files I have on custom theme options that I do with my child themes, but on (your) plugins I can’t fill the .po file with strings. I’ve searched the web, and I have no idea what I’m doing wrong.

    If you, or someone from the community, knows how to handle poEdit and plugins, hit me up.

    #5837
    Jason Bobich
    Keymaster

    Hold on, let me try to generate one for you…

    #5839
    Jason Bobich
    Keymaster

    If you’re generating one to be saved in the lang folder of the plugin, the file path you use in poEdit would be ../

    See here for result: https://github.com/themeblvd/Theme-Blvd-Widget-Areas/blob/master/lang/tb-sidebars.po

    And if you want to generate one to save in your Child theme’s directory in a lang folder, this would be your file path:

    ../../../plugins/theme-blvd-widget-areas/

    Note: You can take the file I linked to above and simply do a find/replace of the path if you’re putting into a lang folder of your Child theme.

    #5841
    royeyal
    Participant

    I forgot all about the Sources Keywords! I didn’t add a “__” keyword, so that’s why it didn’t find any string even when on the same folder…
    Why the doesn’t the program include such a keyword be default is beyond me.

    “../../../plugins/theme-blvd-widget-areas/”
    That is one long path, and I had that missing as well.

    Thank you, thank you for the lengthy tutor, the screenshots and the instant response.

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.