Support » Plugin: AsynCRONous bbPress Subscriptions » Email are sent only in English (change language)

  • Resolved Mauricio

    (@mauriciogarofalo)


    This plugin is is my solution to default email notification system of bbpress, but the emails are sent in English and my whole site is in Spanish.

    How can I translate the emails? Please help

Viewing 15 replies - 1 through 15 (of 18 total)
  • Plugin Author Markus Echterhoff

    (@mechter)

    To change the email texts, please use the available message filters and snippets as explained in the plugin’s description. You can change them to any language, and even make them multilingual, if you so choose. Here is an example for translation ready strings (you can just copy all of that to your theme’s functions.php and make it Spanish to solve your specific problem):

    add_filter( 'abbps_topic_subject', 'my_abbps_topic_subject', 10, 3 );
    add_filter( 'abbps_topic_message', 'my_abbps_topic_message', 10, 3 );
    add_filter( 'abbps_reply_subject', 'my_abbps_reply_subject', 10, 4 );
    add_filter( 'abbps_reply_message', 'my_abbps_reply_message', 10, 4 );
    
    function my_abbps_topic_subject( $subject, $forum_id, $topic_id ) {
    	$topic_title = strip_tags( bbp_get_topic_title( $topic_id ) );
    	return sprintf( __( "[My Forums] New Topic: \"%s\"", 'my-textdomain' ), $topic_title );
    }
    
    function my_abbps_topic_message( $subject, $forum_id, $topic_id ) {
    	$topic_title = strip_tags( bbp_get_topic_title( $topic_id ) );
    	$topic_author_display_name = bbp_get_topic_author_display_name( $topic_id );
    	$topic_url = get_permalink( $topic_id );
    	$topic_content = strip_tags( bbp_get_topic_content( $topic_id ) );
    	return sprintf( __( "%s wrote:
    
    %s
    
    -----------------------------------------
    Read this post online: %s
    
    If you don't want to receive any more email notifications for this forum, please visit the above link and click \"Unsubscribe\" at the top of the page.", 'my-textdomain' ), $topic_author_display_name, $topic_content, $topic_url );
    }
    
    function my_abbps_reply_subject( $subject, $forum_id, $topic_id, $reply_id ) {
    	$topic_title = strip_tags( bbp_get_topic_title( $topic_id ) );
    	return sprintf( __( "[My Forums] New Reply to: \"%s\"", 'my-textdomain' ), $topic_title );
    }
    
    function my_abbps_reply_message( $subject, $forum_id, $topic_id, $reply_id ) {
    	$reply_author_display_name = bbp_get_topic_author_display_name( $reply_id );
    	$reply_content = strip_tags( bbp_get_reply_content( $reply_id ) );
    	$reply_url = bbp_get_reply_url( $reply_id ); // note that it's not get_permalink()
    	return sprintf( __( "%s replied:
    
    %s
    
    -----------------------------------------
    Read this post online: %s
    
    If you don't want to receive any more email notifications for this topic, please visit the above link and click \"Unsubscribe\" at the top of the page.", 'my-textdomain' ), $reply_author_display_name, $reply_content, $reply_url );
    }
    
    Plugin Author Markus Echterhoff

    (@mechter)

    I realize some users of this plugin aren’t very tech-savvy and just looking for an easy fix for some issue they are experiencing with their bbPress emails, so I’m inclined to make the plugin translation ready. Tell you what, if you translate the following strings to Spanish, I’ll release a new translation ready version, with Spanish included.

    "[%s Forums] New Topic: \"%s\""

    "%s wrote:
    
    %s
    
    -----------------------------------------
    Read this post online: %s
    
    If you don't want to receive any more email notifications for this forum, please visit the above link and click \"Unsubscribe\" at the top of the page."
    

    "[%s Forums] New reply to: \"%s\""

    "%s replied:
    
    %s
    
    -----------------------------------------
    Read this post online: %s
    
    If you don't want to receive any more email notifications for this topic, please visit the above link and click \"Unsubscribe\" at the top of the page."
    
    Moderator Stephen Edgar

    (@netweb)

    @mechter if you update the plugin per below translations can be automatically handled by wordpress.org, translators can translate your plugin from the link below**

    ** It looks like your plugin needs an update to make it available for translation, there are links included in the same link below that should help you resolve this:

    https://translate.wordpress.org/projects/wp-plugins/asyncronous-bbpress-subscriptions

    Plugin Author Markus Echterhoff

    (@mechter)

    @netweb, I haven’t received an Email about any of my plugins being imported (as per https://make.wordpress.org/plugins/2015/09/01/plugin-translations-on-wordpress-org/ ) and translate.wordpress.org had me kind of confused. That’s why went old-school. I’ll make the changes and give it a try.

    Plugin Author Markus Echterhoff

    (@mechter)

    @netweb, alright, I’ve looked into it, committed the necessary changes, the project got imported (as per #meta-language-packs on wordpress.slack.com). The import has not yet propagated to translate.wordpress.org, but I tested the translation process with another of my plugins.

    I find it cumbersome, to be honest. I had to read a few different documentation pages, join Slack just to get an error log, and I had some navigation trouble, i.e. I couldn’t find a link from one locale of my plugin back to the locale overview, because the breadcrumbs use the locale as their root (which makes sense for translators, I guess).

    I’m currently waiting for a translation editor to accept my translation (apparently, the existing .mo file for that plugin didn’t get imported for some reason – couldn’t find anything logged on Slack). I’m curious how long it will take.

    Another thing that bugs me is that plugin header data, such as author, author URL and plugin URL can be changed by translators and the documentation reads:

    Any and all warnings generated by translate.wordpress.org are logged and displayed in a channel on Slack (#polyglots-warnings). It is strongly recommended that you keep an eye on your plugin in this channel.

    I’d rather just get an email. And what about changes that do not necessarily generate a warning, e.g. a string being translated that I would consider a name and rather keep English?

    It would seem that plugin authors are not supposed to get final say over translations of their plugins. To become a translation editor for my own plugins, it would seem I have to file a request with the translation team and even then, according to the documentation, it’s strongly recommended that I not be made an editor for all locales of my plugin.

    That doesn’t seem right.

    Plugin Author Markus Echterhoff

    (@mechter)

    @mauriciogarofalo, I’ve just uploaded version 3.0, which has proper support for translations. So now you have three options. You can either use the filters as explained in my initial reply, translate the strings as I’ve mentioned in my second reply, or go to https://translate.wordpress.org/locale/es/default/wp-plugins/asyncronous-bbpress-subscriptions and translate the plugin to Spanish over there (as soon as that page is updated to reflect the recent changes).

    Plugin Author Markus Echterhoff

    (@mechter)

    @mauriciogarofalo, the page is now updated. If I understand correctly, you would only have to translate “Stable (latest release)”. Eventually a translation editor would be reviewing these changes and a Spanish language pack be generated for the plugin, and automatically downloaded by your WordPress installation upon updating.

    @netweb, all done. Although I’m still going to include some language files for the time being, I thank you for the heads-up regarding translate.wordpress.org. I’ve been meaning to look into it for some time now. 🙂

    Thread Starter Mauricio

    (@mauriciogarofalo)

    @mechter I translated in language project Spanish (Spain), also I paste here the translation:
    "[%s Forums] New Topic: \"%s\""

    Spanish:
    "[Foros %s] Nuevo Tema: \"%s\""

    "%s wrote:
    
    %s
    
    -----------------------------------------
    Read this post online: %s
    
    If you don't want to receive any more email notifications for this forum, please visit the above link and click \"Unsubscribe\" at the top of the page."
    "%s escribió:
    
    %s
    
    -----------------------------------------
    Lee este mensaje en linea: %s
    
    Si no quieres recibir más notificaciones por email sobre este tema, por favor visita el enlace mencionado y has clic en "Desuscribir" en la parte superior de la página."

    "[%s Forums] New reply to: \"%s\""

    "[Foros %s] Nueva respuesta a: "%s""

    "%s replied:
    
    %s
    
    -----------------------------------------
    Read this post online: %s
    
    If you don't want to receive any more email notifications for this topic, please visit the above link and click \"Unsubscribe\" at the top of the page."
    "%s respondió:
    
    %s
    
    -----------------------------------------
    Lee este mensaje en linea: %s
    
    Si no quieres recibir más notificaciones por email sobre este tema, por favor visita el enlace mencionado y has clic en "Desuscribir" en la parte superior de la página."
    Plugin Author Markus Echterhoff

    (@mechter)

    Thanks, @mauriciogarofalo. One question, the English reads “receive any more email notifications for this forum” and “receive any more email notifications for this topic“, for topic and reply notifications, respectively. In the translation it’s “este tema” in both cases, shouldn’t one of them be “este foro” (or something like that)?

    Thread Starter Mauricio

    (@mauriciogarofalo)

    Sorry! Yes you are right.

    Plugin Author Markus Echterhoff

    (@mechter)

    No problem. I’ve added the Spanish translation directly to the plugin, as I don’t know how long it will take for the translation.wordpress.org language packs to be made available. If you update to 3.2, your emails should be in Spanish. Let me know if anything doesn’t work as expected.

    Thread Starter Mauricio

    (@mauriciogarofalo)

    Thanks for the support!

    Moderator Stephen Edgar

    (@netweb)

    Awesome @mechter

    The time taken to approve strings varies between teams, there’s lots to translate, there’s ~110 translators on the Spanish team and ~750 translation contributors https://make.wordpress.org/polyglots/teams/?locale=es_ES so hopefully it won’t take too long for those strings to be approved, there might be a bit of a delay as many people of travelling having just attendended WordCamp Europe this past weekend.

    Email notifications I believe are planned but no ETA on that feature.

    The translation teams have a pretty good grasp on what should and should not be translated, the vast majority of locales don’t translate plugin names for instance, whereas a handful try to do as this is inline with the locale and language.

    On having final say on translations of your plugins, this question is raised quite often, the typical reply is “Do you speak 169 languages?”. There’s ~10,000 translators as of August last year, it’s an incredible amount of people, they are also incredibly dedicated to what they do and the translations are highly professional. Having being involved with bbPress being one of the plugins that helped trial this method of translating I was sceptical myself initially, a couple of years have passed since then and I wouldn’t have it any other way, the #polyglots team is amazing and I dread the thought of what going back to the old ways would be.

    I’d suggest you periodically check the translations of your plugin from time to time, follow the changes on Slack, I think and hope in time you’ll also agree that the #polyglots team are amazing and we should just let them do there thing 🙂

    Plugin Author Markus Echterhoff

    (@mechter)

    @netweb, thanks for the additional information. I’ll check on the translation status of my plugins from time to time and see how it’s working for me.

    Thread Starter Mauricio

    (@mauriciogarofalo)

    @mechter I updated the plugin but today I received an email still in English. Language is ES_es

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘Email are sent only in English (change language)’ is closed to new replies.