Email are sent only in English (change language)
-
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
-
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 ); }
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."
@mechter if you update the plugin per below translations can be automatically handled by www.ads-software.com, 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.www.ads-software.com/projects/wp-plugins/asyncronous-bbpress-subscriptions
@netweb, I haven’t received an Email about any of my plugins being imported (as per https://make.www.ads-software.com/plugins/2015/09/01/plugin-translations-on-wordpress-org/ ) and translate.www.ads-software.com had me kind of confused. That’s why went old-school. I’ll make the changes and give it a try.
@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.www.ads-software.com, 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.www.ads-software.com 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.
@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.www.ads-software.com/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).
@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.www.ads-software.com. I’ve been meaning to look into it for some time now. ??
@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."
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)?
Sorry! Yes you are right.
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.www.ads-software.com 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.
Thanks for the support!
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.www.ads-software.com/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 ??
@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.
@mechter I updated the plugin but today I received an email still in English. Language is ES_es
- The topic ‘Email are sent only in English (change language)’ is closed to new replies.