WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: WP-Members] How to translate to other languages (40 posts)

  1. stickFinger
    Member
    Posted 3 years ago #

    Hi

    Is there any pot, po or mo file in orther to make easy the process of translating the plugin to other languages?

    Thanks

  2. stickFinger
    Member
    Posted 3 years ago #

    BTW> I´m asking mainly thinking about future plugin´s updates.
    Thanks again

  3. Chad Butler
    Member
    Posted 3 years ago #

    Right now there is not, but localization is going to be included in the next feature upgrade. I do not have a date for that yet, but it has received a number of requests.

    A couple other users have offered translation support (Israel and Ukraine).

  4. stickFinger
    Member
    Posted 3 years ago #

    Thank You cbutlerjr for your answers.

    I´d like to contribute with the pt_BR translation.
    Let me know when you gotget text implemented, ok?

    Thanks for developping such nice plugin :-)

  5. Chad Butler
    Member
    Posted 3 years ago #

    will do... thanks!

  6. Tibor Paulsch
    Member
    Posted 3 years ago #

    Great plugin!

    Translation files would indeed be very much appreciated: I can help with the Dutch (nl) translation if you like.

  7. stickFinger
    Member
    Posted 3 years ago #

    Hi cbutlerjr

    As i´m at the begining of a new project heavily based on WP-Members I´d love to hear from you if there is a ETA for the localization version of that GREAT plugin :-)

    Thank You very much

  8. Chad Butler
    Member
    Posted 3 years ago #

    I am making progress on some very significant upgrades to the plugin. I have most of that ready for localization with the exception of the email notification process and the inline contextual help on the admin side.

    I should be able to wrap these up in the next week or so. At that point, I think it's ready for localization.

    If you want a peek at the stable beta so far, you can check out download page and select version 2.4. It is currently beta release 3 which is stable for public use.

    I have a new release candidate 4 which is not fully tested yet and that will add some additional features beyond the one that's up there. That should wrap up by next week.

    Hope that helps!

  9. stickFinger
    Member
    Posted 3 years ago #

    Thanks for your quick reply cbutlerjr :-)

    I(´ve downloaded the new version however I could not find the .po :-(

    Regarding the translation I think that the first and most important files to be done are the ones used in the front end including the warning messages (validations ) The backend at least for me are not so important. What the hell if you´re in the web you must understanda at least an english admin interface :-)

    Let me know when you got any .pot, .po and i´ll e glad to translate it even in advance.

    Once more...MANY thanks

  10. Chad Butler
    Member
    Posted 3 years ago #

    That makes sense about the admin side... ;-)

    I am focusing on the front end and getting that ready for translation. I need to finish up the emails that go out and also make some changes to the form validation/error messages to make them better for translation. My plan is to have a workable beta with this and the new features done and ready for testing and translation (or at least the beginning of translation) before the end of the year. If all goes well, probably in the next couple days. It's really close, just need to wrap up a few loose ends.

  11. Chad Butler
    Member
    Posted 3 years ago #

    The 2.4 beta release 4 is up and an updated .pot is included. This is my first attempt at localization so hopefully this will work ;-)

  12. Brazz
    Member
    Posted 3 years ago #

    Hi there! Thnx for making available a POT-file!

    I've translated some stuff (Dutch language) using Poedit and I copied the adapted POT and new MO-file to the same Lang-map... but no result. I renamed the files > nl.mo and nl.pot (since these are the settings in wp-config.php)... but still no result.

    Could you please help me to explain what I do wrong? Or what steps I should follow?

    Thnx!

  13. Chad Butler
    Member
    Posted 3 years ago #

    Hi Brazz - I must admit, I am not very savvy at this point with Poedit. Like I mentioned, this is my first attempt with localization. I started off with Poedit, but ended up generating the POT from wordpress.org's plugin management process.

    It is possible that I haven't got things quite right in the plugin itself. The primary plugin file (wp-members.php) calls load_plugin_textdomain() right away at the beginning of the file. I have considered moving this into the init() action call. Also, the load_plugin_textdomain defines the location of the localization files as /wp-members/lang. I'm not positive I have this set correctly.

    Hopefully, this will give you some ideas to look at and/or someone familiar with localization to suggest where I could improve the process (or fix something that I might have configured incorrectly?).

  14. lazysand
    Member
    Posted 3 years ago #

    Hi, cbutlerjr, thanks for your work,
    I´d like to take part in the zh_CN translation:-)

  15. Chad Butler
    Member
    Posted 3 years ago #

    Thanks - that would be great!

    Just to let you know, I am putting the final touches on the new release and it will become the production release this week. The current 2.4 public beta 4 has some changes so you might want to wait until it's finalized.

  16. cogu
    Member
    Posted 3 years ago #

    Hi cbutlerjr, hi guys,

    I finished the brazilian translation (for 2.4 public beta 4). But the form labels (First Name, last name, Day phone, etc) didn't work fine. Its still in in English. I try to resolve looking into the code, but I haven't found any solution. Any help?

    tks

  17. Chad Butler
    Member
    Posted 3 years ago #

    The field names are stored in a db array at install. So... none of these will be translated "on-the-fly." Also, simply deactivating/reactivating does not overwrite the settings. So, to have a properly translated installation, the translation needs to be there at install.

    In the past, for simply customizing what the fields were, this involved uninstalling/deleting the plugin, then doing a clean install. Starting with 2.4, I added a toggle to force update these settings to make the process easier.

    In wp-members-install.php, the first function is wpmem_do_install. At the top is a toggle $chk_force. (Note: a simple change like this can be done through the WP admin panel's plugin editor.) Change that value to true, then deactivate/reactivate the plugin to force update all of the settings.

    Caveat emptor: This will revert all installed settings back to the default settings, so double check your settings before and after. It will have no effect on user registrations, or any settings made to posts/pages, etc; just the options, fields, and dialogs done at install.

    Hope that helps!

  18. cogu
    Member
    Posted 3 years ago #

    Wow! Thanks for reply so fast!
    The solution worked very well.

    When you release the final version, tell me to send you the translation into Portuguese.

    Hugs
    Diego

  19. jhvass
    Member
    Posted 3 years ago #

    I have made a Swedish translation. However, I think there is a small bug in the wp-members.php file when loading the translations.

    The textdomain should just be the plugin-name and the relative path need to be passed in the third argument.

    I changed this:
    $wpmem_textdomain = 'wp-members/lang';
    load_plugin_textdomain($wpmem_textdomain);

    into this (according to the documentation)
    $wpmem_textdomain = 'wp-members';
    load_plugin_textdomain($wpmem_textdomain, false, dirname( plugin_basename( __FILE__ ) ) . '/lang/');

    now everything including the field names got translated properly into Swedish :-)

    / Jan

  20. kactusficus
    Member
    Posted 3 years ago #

    Hello everyone!

    I'm sorry if I seem quite dummy to not understand exactly how to make this translation function working... but I really can't make it work, even if I tried 100 things for 2 hours!

    Here's the website I'm working on:
    http://www.aquario-passion.com/members-area/

    I have the latest WP-Members version (2.5)
    I added a .mo and a .po files in the LANG file of the WP_members plugin file (I've copied the fr_FR.mo and .po file from the LANG section of the wpress version installed, is it ok?)
    I even doubled the fr_FR.po and fr_FR.mo file renaming the copies fr.mo and fr.po, just in case it was the title who wasn't good.

    I copied and replace in the wp-members.php the code line that jhvass gave above.

    Then... I don't know what to do more, and it's still not working...

    I'm just a photographer helping my association making a little website, not a professionnal of computoring, so I'm sure I don't understand the coding and computer language like you... But could you help me on this (with easily understandable advices, lol)?

    Thanks a lot!
    Sabine

  21. Chad Butler
    Member
    Posted 3 years ago #

    kactusficus - as far as I am aware, there is not a French translation of WP-Members. You can't copy the .po/.mo language files for WordPress to the plugin - it needs translation files that are specifically for the plugin itself.

    Are you up for doing a French translation?

  22. kactusficus
    Member
    Posted 3 years ago #

    Hi Cbutelrjr,

    Yes, I'll be happy to do my own trnaslation (and sharing with the community, is I can find out how to share files here)!

    Can you tell me how to proceed?

    cheers!
    sabine

  23. cindelaras
    Member
    Posted 3 years ago #

    Salam,

    Excuse me, thank for the great plugin.
    I've made translation in Indonesian from the copy .pot. Saving the file as wp-members-id_ID.po and wp-members-id_ID.mo files. Then put them on folder "wp-content/plugins/wp-members/lang/"

    But, to make change on data fields, like "address, zip, city, etc", need some modification in wp-members-install.php. Each field label manually translated. (Sorry, is that right?)

    I've made some relayouting the form. From table format to tableless format. Here's the form I've made :

    http://blogdesa.org/formulir-pendaftaran/

  24. Chad Butler
    Member
    Posted 3 years ago #

    kactusficus - contact me via the contact page on my blog and we can dialog via email. I will get you the version 2.5 POT file you'll need. If you then want to share the French translation, that would great - you can then send it to me and I'll include it with the plugin.

    cindelaras - if you have loaded the plugin at anytime before you added the translation, the field names are already loaded into the database. These need to be deleted in order for the translated field names to be loaded in. There are two ways to do this. (1) you can deactivate the plugin, then use the delete feature in the WP plugin admin. This runs the plugin's delete feature which clears out the database settings. Or (2) there is a toggle in the wp-members-install.php file called $chk_force. There are instructions on using this commented into the file, but essentially, setting this to true will force the plugin deactivation/reactivation to reload all of the plugin's db options (thereby providing you with translated field names). Just be sure to set this back to false when you are done, in case you deactivate the plugin later and don't want to unintentionally override any custom settings.

  25. cindelaras
    Member
    Posted 3 years ago #

    thank u cbutlerjr,
    I have did the 1st one. And now, the plugin is working very well. Can I share the plugins with a bit modification for Indonesian?

  26. Chad Butler
    Member
    Posted 3 years ago #

    @cindelaras - I'm not sure I understand your question... are you talking about a modified version of the plugin? If so, you can as long as attribution is given. But it's not recommended to do so, as this creates a branch that will not necessarily be compatible with future upgrades. If you are talking about the .po/.mo files - no problem.

  27. Doomsan
    Member
    Posted 3 years ago #

    I´m sorry but i´m totally lost here. How do i translate the plugin, do i put both .mo and .po files in the lang directory and that´s it? i´ve put es_ES.po and es_ES.mo but nothing happens.

    Please help, i´m totally lost here!. Thanks.

  28. Chad Butler
    Member
    Posted 3 years ago #

    Can you clarify...

    Is the site also set up in spanish? I would assume so otherwise why would you be asking about translating the plugin, but I have to ask to make sure.

    Are these translation file for the plugin? Again, it sounds like you know what you are doing with translation, but a user did ask me once before and it turned out he was putting WP translation files in the folder, not translation of the plugin, so again, sorry, but I have to ask.

    Are they named wp-members-es_ES? I'm guessing this might be the issue. The translation files need to have the plugin name as the prefix, so if not, they should be wp-members-es_ES.mo and wp-members-es_ES.po

    Hope that helps. Let me know.

  29. Doomsan
    Member
    Posted 3 years ago #

    Yeah, in spanish. Yes, they are for the plugin, i put them in the lang folder inside the plugin.

    Ok i´ll name it that way, maybe that works. If i name it that way it should work right away? or do i have to change some code in the php?.

    Thanks a lot!!!.

  30. Chad Butler
    Member
    Posted 3 years ago #

    The plugin uses the WP function load_plugin_textdomain to load the localized files so you shouldn't need to make any other changes. As long as the .mo file has the plugin name prefix and matches the language being used by WP, you should be good to go.

    If you've already installed the plugin, though, you will need to follow the instructions I outlined above:

    if you have loaded the plugin at anytime before you added the translation, the field names are already loaded into the database. These need to be deleted in order for the translated field names to be loaded in. There are two ways to do this. (1) you can deactivate the plugin, then use the delete feature in the WP plugin admin. This runs the plugin's delete feature which clears out the database settings. Or (2) there is a toggle in the wp-members-install.php file called $chk_force. There are instructions on using this commented into the file, but essentially, setting this to true will force the plugin deactivation/reactivation to reload all of the plugin's db options (thereby providing you with translated field names). Just be sure to set this back to false when you are done, in case you deactivate the plugin later and don't want to unintentionally override any custom settings.

Topic Closed

This topic has been closed to new replies.

About this Topic