Tagged: plugin, translate, Translation, widget areas
Widget Areas plugin translation
-
CreatorTopic
-
February 20, 2013 at 1:39 pm #5607
royeyal
ParticipantHey 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 -
CreatorTopic
-
AuthorReplies
-
February 20, 2013 at 6:21 pm #5627
Jason Bobich
KeymasterI 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?
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' );
February 24, 2013 at 11:59 pm #5833royeyal
ParticipantThanks 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.
February 25, 2013 at 12:11 am #5835Jason Bobich
KeymasterIt 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. 😉
February 25, 2013 at 12:22 am #5836royeyal
ParticipantJason, 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.
February 25, 2013 at 12:24 am #5837Jason Bobich
KeymasterHold on, let me try to generate one for you…
February 25, 2013 at 12:42 am #5839Jason Bobich
KeymasterIf 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.
February 25, 2013 at 12:52 am #5841royeyal
ParticipantI 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.
-
AuthorReplies
- You must be logged in to reply to this topic.