WordPress.org

Forums

Subscribe2
[resolved] Compatibility with WPML (20 posts)

  1. MercedesWPML
    Member
    Posted 2 years ago #

    Hi there,
    My name is Mercedes from WPML. We are working on the compatibility with your plugin and found that it works ok, except for one thing: a notifications feature doesn't send emails based on the subscribers language. Can you please drop me a line to fix this?
    Thanks

    http://wordpress.org/plugins/subscribe2/

  2. mattyrob
    Member
    Posted 2 years ago #

    @MercedesWPML,

    I looked at this a few years ago and at that time I needed an API in WPML to get users preferred language, preferably in groups. Does that now exist?

  3. Dominykas
    Member
    Posted 2 years ago #

    Hi Matty,

    WPML API exists. We can help you with the technical issues.

  4. mattyrob
    Member
    Posted 2 years ago #

    @Dominykas,

    I know an API exists but it didn't offer what I needed when I last checked:

    http://wpml.org/forums/topic/wpml-subscribe2/

    Has this now been added?

  5. MercedesWPML
    Member
    Posted 1 year ago #

    hi again,
    excuse the delay. We have checked another issue with Subscribe2 and found the following:
    There's a problem with separating the emails according to the subscribers language.
    Our suggestion:
    1) In the wp_subscribe2 table add one more column e.g 'value' and there store the language code for each subscriber
    2) In publish() function check the post language code and filter out the recipients according the language code
    $language_information = wpml_get_language_information($post_id);
    $locale = $language_information['locale'];
    3) Send an email notification of a new post
    Does this make sense?

    Can you let me know please?
    Thanks!

  6. mattyrob
    Member
    Posted 1 year ago #

    @MercedesWPML,

    Thanks for the suggestion. There are another few issues that I need to know how to handle:

    1. Subscribe2 supports 2 subscribe types. Public and Registered. The wp_subscribe2 table is for Public and the core user and usermeta tables are used for Registered. How can I retrieve the preferred language for Registered users?

    2. The email is created by switching some dynamic content into an email template using keywords. Can WPML translate the database stored variables - like the templates at execution time? My concern is that local changes from default may get lost as translation files may be used in preference.

  7. ochado
    Member
    Posted 1 year ago #

    I just discovered this plugin, and I'm thrilled to see this active discussion on getting it WPML-compatible.

    I'm not sure what all this might involve, but a multilingual version might be more involved. Here are a few other needs I can think of (these are real use cases in my website, not hypothetical ones):

    * The e-mail notification templates would need a version of each template in each language. The WPML String Translation module can handle translations of some plugin strings, but I don't know if it could handle Subscribe2's template keywords. Perhaps Mercedes could shed light on this.

    * Some users want multilingual notifications--that is, they want to receive posts from multiple languages, not just one language. Whereas it might make sense to use the current site language for public subscribers, registered subscribers should be given the choice of languages. Even in the digest setting, registered subscribers should be given choice of languages to receive. Thus, I suggest to revise Mercedes' suggestion above: rather than storing just one language code per subscriber, multiple codes should be stored. However, the subscriber should pick one language as the default (for receiving e-mails).

    I know this is a lot to ask from a free plugin. Regardless of whether you can implement this multilingual functionality, thanks for providing such a great plugin.

  8. MercedesWPML
    Member
    Posted 1 year ago #

    @mattyrob, our developer replied:
    1. I would suggest to use the wp_usermeta table and store the language code there. WPML plugin does not keep any preferred language for registered users, so I think it should be handled by Subscribe2 plugin.
    2. Yes, WPML can translate all texts from the database. You should use icl_translate( context, name, value ) or icl_register_string( context, name, value ) function. More information about these functions is here: http://wpml.org/documentation/support/achieving-wpml-compatibility-for-your-themes-and-plugins/debug…

    Feel free to e-mail me directly if you want to interact with him directly

    Thanks!

  9. MercedesWPML
    Member
    Posted 1 year ago #

    @ochado, checking with the team...

  10. mattyrob
    Member
    Posted 1 year ago #

    @MercedesWPML,

    Is there a way to produce a language selector from WPML that uses HTML input tags?

  11. ochado
    Member
    Posted 1 year ago #

    Hi Matty,

    I don't know if these links answer your question, but here's WPML's documentation on their language selector options and how to customize the selector:

    * http://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/

    * http://wpml.org/documentation/getting-started-guide/language-setup/custom-language-switcher/

  12. mattyrob
    Member
    Posted 1 year ago #

    @ochado,

    I had seen those and tried the do_action() approach. It creates an unordered list. (UL and LI). I need a SELECT and OPTION approach. It looks like I may need to create from scratch if I attempt this.

  13. ochado
    Member
    Posted 1 year ago #

    @mattyrob,

    Of course, I'm just a user, so I don't understand the inner workings of WPML. However, I am curious why the format of the Language Switcher (a front-end, site-specific decision) has anything to do with how Subscribe2 multilingual functionality might work.

    WPML has a pseudo-SELECT/OPTION approach; you can see it in function on this website that I run: http://test.churchinmontreal.ca (top-right corner). Actually, it is a UL/LI list, apparently formatted as a dropdown box in CSS: http://test.churchinmontreal.ca/content/plugins/sitepress-multilingual-cms/res/css/language-selector.css. I don't know if that helps you in mapping WPML's UL/LI format to what you would expect in a SELECT/OPTION output.

  14. mattyrob
    Member
    Posted 1 year ago #

    @ochado,

    The issues is that the current UL/LI apporach does not pass any selected data through the browser to the server so I cannot capture it in Subscribe2 and process it. I suspect WPML is using some client side javascript or even coding direct links to translated content into that dropdown menu. Although it works fine for WPML I need something different to start making Subscribe2 work well with WPML.

  15. ochado
    Member
    Posted 1 year ago #

    @mattyrob, what kind of data are you looking for? Language codes? WPML stores all that in cookies: http://wpml.org/forums/topic/what-type-of-cookies-do-you-use/

    Anyway, hopefully @MercedesWPML can provide authoritative answers.

  16. MercedesWPML
    Member
    Posted 1 year ago #

    Hi!
    I am getting all the messages. I am checking with the tech team and will let you know sson
    Thanks!

  17. MercedesWPML
    Member
    Posted 1 year ago #

    Hi,
    My colleague Dominykas would like to help. Can you please write to him directly at dominykas@wpml.org and add this thread as reference?
    Thanks!

  18. schwarzpunkt
    Member
    Posted 1 year ago #

    Hi there

    Is subscribe 2 actually compatible with WPML?
    Or is there an Expection when it is?

    Thanks for Respond.

  19. mattyrob
    Member
    Posted 1 year ago #

    @schwarzpunkt,

    Broadly speaks I'd say the 2 are not compatible. WPML does not provide the functions needed to identify users by preferred language in bulk and Subscribe2 is not easily modified to provide some strings in a translatable way that WPML can handle.

    If Subscribe2 is the priority then you may want to consider Polylang, this and Subscribe2 work pretty well together.

  20. schwarzpunkt
    Member
    Posted 1 year ago #

    Sounds great, thanks a lot for the advise to Polylang.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Subscribe2
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.