Skip to content

Commit

Permalink
Profiles: Add activity handler for GlotPress strings.
Browse files Browse the repository at this point in the history
See WordPress/five-for-the-future#196

git-svn-id: https://meta.svn.wordpress.org/sites/trunk@11931 74240141-8908-4e6f-9713-ba540dce6ec7
  • Loading branch information
iandunn committed Jul 1, 2022
1 parent 4c52e62 commit 895796a
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ public function handle_activity() {
case 'learn':
$activity_id = bp_activity_add( $this->sanitize_activity( $_POST ) );
break;
case 'glotpress':
$activity_id = $this->digest_bump( $this->sanitize_activity( $_POST ) );
break;
case 'plugin':
$activity_id = $this->handle_plugin_activity();
break;
Expand Down Expand Up @@ -937,6 +940,15 @@ protected function digest_bump( array $new_activity ) {
*/
protected function get_digest_actions( string $component, string $type, int $count ) : string {
switch ( $component . ':' . $type ) {
case 'glotpress:glotpress_translation_suggested':
$singular = 'Suggested %d string on <a href="https://translate.wordpress.org">translate.wordpress.org</a>.';
$plural = 'Suggested %d strings on <a href="https://translate.wordpress.org">translate.wordpress.org</a>.';
break;

case 'glotpress:glotpress_translation_approved':
$singular = 'Translated %d string on <a href="https://translate.wordpress.org">translate.wordpress.org</a>.';
$plural = 'Translated %d strings on <a href="https://translate.wordpress.org">translate.wordpress.org</a>.';
break;

default:
$action = '';
Expand Down

0 comments on commit 895796a

Please sign in to comment.