Merge pull request #8433 from annando/issue-8432-translations

Issue 8432: Make notifications translatable
This commit is contained in:
Hypolite Petovan 2020-03-21 07:54:05 -04:00 committed by GitHub
commit efb90f5a9c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -174,39 +174,39 @@ function notification($params)
// "George Bull's post"
if ($params['activity']['origin_comment']) {
$message = '%1$s replied to you on %2$s\'s %3$s %4$s';
$message = $l10n->t('%1$s replied to you on %2$s\'s %3$s %4$s');
} elseif ($params['activity']['explicit_tagged']) {
$message = '%1$s tagged you on %2$s\'s %3$s %4$s';
$message = $l10n->t('$l10n->t(%1$s tagged you on %2$s\'s %3$s %4$s');
} else {
$message = '%1$s commented on %2$s\'s %3$s %4$s';
$message = $l10n->t('%1$s commented on %2$s\'s %3$s %4$s');
}
$dest_str = $l10n->t($message, $params['source_name'], $item['author-name'], $item_post_type, $title);
$dest_str = sprintf($message, $params['source_name'], $item['author-name'], $item_post_type, $title);
// Then look for the special cases
// "your post"
if ($params['activity']['origin_thread']) {
if ($params['activity']['origin_comment']) {
$message = '%1$s replied to you on your %2$s %3$s';
$message = $l10n->t('%1$s replied to you on your %2$s %3$s');
} elseif ($params['activity']['explicit_tagged']) {
$message = '%1$s tagged you on your %2$s %3$s';
$message = $l10n->t('%1$s tagged you on your %2$s %3$s');
} else {
$message = '%1$s commented on your %2$s %3$s';
$message = $l10n->t('%1$s commented on your %2$s %3$s');
}
$dest_str = $l10n->t($message, $params['source_name'], $item_post_type, $title);
$dest_str = sprintf($message, $params['source_name'], $item_post_type, $title);
// "their post"
} elseif ($item['author-link'] == $params['source_link']) {
if ($params['activity']['origin_comment']) {
$message = '%1$s replied to you on their %2$s %3$s';
$message = $l10n->t('%1$s replied to you on their %2$s %3$s');
} elseif ($params['activity']['explicit_tagged']) {
$message = '%1$s tagged you on their %2$s %3$s';
$message = $l10n->t('%1$s tagged you on their %2$s %3$s');
} else {
$message = '%1$s commented on their %2$s %3$s';
$message = $l10n->t('%1$s commented on their %2$s %3$s');
}
$dest_str = $l10n->t($message, $params['source_name'], $item_post_type, $title);
$dest_str = sprintf($message, $params['source_name'], $item_post_type, $title);
}
// Some mail software relies on subject field for threading.