WordPress.org

Ready to get started?Download WordPress

Forums

EM Beer Manager
[resolved] Translation (27 posts)

  1. rodonmanes
    Member
    Posted 11 months ago #

    Hi Erin,

    I´ve been translating this plugin into Icelandic, but when i put the em-beer-manager.pot into the language folder, no translation appears when i view the beer post. I know that the host doesn´t catch and i´m not using any catch plugin so i should see the results right away. Do you have any ideas what might be causing this?

    http://wordpress.org/plugins/em-beer-manager/

  2. Erin Morelli
    Member
    Plugin Author

    Posted 11 months ago #

    Hi rodonmanes,

    Thanks for catching this - I've never worked with the translation pots before so I'm not immediately sure what the issue may be. I'll take a look at some of the documentation and try testing it out this week and let you know what I find.

    Thanks!

  3. Erin Morelli
    Member
    Plugin Author

    Posted 10 months ago #

    Hi rodonmanes,

    I read up on the translation documentation, it looks you'll need to put your translation into .po file format (based on the .pot) and the convert it to a .mo file, then save that file into the "languages" folder of the plugin. There is some documentation on how to do that here:

    https://codex.wordpress.org/I18n_for_WordPress_Developers#PO_files

    and here:

    http://codex.wordpress.org/Translating_WordPress

    I checked out my language implementation within the plugin and it is set up to read the .mo files in the current version. Hopefully this is helpful?

  4. rodonmanes
    Member
    Posted 10 months ago #

    Thank you :)

    I did this and imported the new language files .po and .mo into the language folder, but nothing happened, i tried to delete the .pot file to see if the .po and .mo file would take over, but still noting.

  5. Erin Morelli
    Member
    Plugin Author

    Posted 10 months ago #

    Okay - I'll take a look at this. Thanks for letting me know.

  6. Erin Morelli
    Member
    Plugin Author

    Posted 10 months ago #

    I just made v1.9.0 live and I believe I've fixed this language issue. I did update the POT file, so you may need to tweak your .mo file slightly, but the file should load now. Let me know if it works.

  7. rodonmanes
    Member
    Posted 10 months ago #

    I´ve tried to translate the plugin, using the .POT, i´ve made .PO and .Mo, named it embm-is_IS.po and is_IS.mo, but the translation doesn´t appear. I´ve also tried to leave it as embm.po and embm.mo but that didn´t do anything. Do i have to locate the .po and .mo in another folder other than languages or?

  8. Erin Morelli
    Member
    Plugin Author

    Posted 10 months ago #

    Do you mind emailing me the two files (.po and .mo)? I don't have any language files to test with since I don't really speak any other languages well enough to be able to do translations. My email is erin at erinmorelli dot com. Then I can hopefully get this resolved.

  9. rodonmanes
    Member
    Posted 10 months ago #

    Hi Erin,

    Have you been able to figure out what the problem is with the translation?

  10. Erin Morelli
    Member
    Plugin Author

    Posted 10 months ago #

    Not yet, unfortunately. I'll let you know as soon as I do.

  11. ppehrson
    Member
    Posted 9 months ago #

    Maybe I can help.

    Your text domain loader needs to be like below to make it work.

    Change this (line 39 and 40 in em-beer-manager.php):

    $plugin_dir = EMBM_PLUGIN_DIR . 'languages';
    load_plugin_textdomain( 'embm', WP_PLUGIN_DIR.'/'.$plugin_dir, $plugin_dir );

    to:

    if ( !defined('PLUGINDIR') )
    	define( 'PLUGINDIR', 'wp-content/plugins' );
    
    load_plugin_textdomain( 'embm', PLUGINDIR.'/em-beer-manager/languages', 'em-beer-manager/languages' );

    That will work.

    I use Codestyling Localization for editing translation and generating .po files. Much easier than poedit, as this is done from within WordPress.
    http://wordpress.org/plugins/codestyling-localization/

    Regards, Peter

  12. rodonmanes
    Member
    Posted 9 months ago #

    Hi Erin, sorry for my inpatients. Any news on how the translation part is coming along?

  13. alekrozmiarek
    Member
    Posted 9 months ago #

    Hi, I have the same problem - Please heplp me with translating.

  14. alekrozmiarek
    Member
    Posted 9 months ago #

    ppehrson - I change this line and still not have a translate

  15. alekrozmiarek
    Member
    Posted 9 months ago #

    The issue is resolved. Put code ppehrson and change the names of .po and .mo files. http://codex.wordpress.org/Function_Reference/load_plugin_textdomain

  16. Erin Morelli
    Member
    Plugin Author

    Posted 9 months ago #

    Hi alekrozmiarek,

    Which language are you looking to translate into? And do you have the properly .po and .mo files for that language in the EM Beer Manager "languages" directory? That would be step one. I do have .pot file included in the plugin.

    I'm going to play around with what ppehrson shared this weekend - I'll push out an update if/when I get it working.

    Thanks!

  17. Erin Morelli
    Member
    Plugin Author

    Posted 9 months ago #

    Oh excellent! I'll push out an update to the plugin later today - thanks, alekrozmiarek!

  18. ppehrson
    Member
    Posted 9 months ago #

    Oh, yeah, remember to name your translations according to the WP standard, fx "embm-da_DK.*" for Danish. And put it as Erin mentioned in the plugins/em-beer-manager/languages directory. It will work. Just tested on a fresh WP with only embm installed.

  19. alekrozmiarek
    Member
    Posted 9 months ago #

    Yes, this realy excelent. I translate this to polish language, and now it is excelent and beautyful plugin. Thank You everyone :-)

  20. rodonmanes
    Member
    Posted 9 months ago #

    Nope, doesn´t work for me. I´ve renamed the file to "embm-is_IS" for Icelandic and of course translated most of the plugin into Icelandic but nothing happens, just stays the same.

  21. alekrozmiarek
    Member
    Posted 9 months ago #

    Do you have wordpress in your language? In wp-config.php is line "define ('WPLANG', 'us');" ----- 'us' is a your language, i standard mode is 'us', you should have a intitials od you own language

    Do you change the code in em-beer-manager.php file?

  22. rodonmanes
    Member
    Posted 9 months ago #

    No, i didn´t change the code in the em-beer-manager.php file as i´m no programmer and i wouldn´t know where to start, would probably just make more harm than good. That´s why i´m here, to ask Erin if she could upgrade the plugin, plus, if i would edit the em-beer-manager.php file, and Erin would upgrade the plugin, wouldn´t it just be for nothing?

    I did though try codestyling-localization, tried to translate through that, but didn´t work.

  23. Erin Morelli
    Member
    Plugin Author

    Posted 9 months ago #

    Thanks for your help, ppehrson!

    rodonmanes - I just pushed out version 1.9.4 which has all of the updates in place. Please update and try again - everything should be working now.

  24. rodonmanes
    Member
    Posted 9 months ago #

    My Wp-config.php is set to is_IS btw.

  25. alekrozmiarek
    Member
    Posted 9 months ago #

    OK. Erin make a update, install new version and then try to do make it. :-)

  26. rodonmanes
    Member
    Posted 9 months ago #

    Works like a charm, thank you :)

  27. ppehrson
    Member
    Posted 9 months ago #

    Erin, you're very welcome. It seemed that there was no error in your code actually. But WP must have made some changes in how to load a text domain recently, which caused the old suggested method to not work.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.