Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct Matecat name in system email #3723

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion inc/INIT.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class INIT {
public static $SMTP_HOSTNAME;

public static $MAILER_FROM = '[email protected]';
public static $MAILER_FROM_NAME = 'MateCat';
public static $MAILER_FROM_NAME = 'Matecat';
public static $MAILER_RETURN_PATH = '[email protected]';

public static $LOG_REPOSITORY;
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/API/V2/DownloadFileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ private function processDownload() {

if ( $fileType[ 'proprietary_short_name' ] === 'matecat_converter' ) {
// Set the XLIFF extension to .xlf
// Internally, MateCat continues using .sdlxliff as default
// Internally, Matecat continues using .sdlxliff as default
// extension for the XLIFF behind the projects.
// Changing this behavior requires a huge refactoring that
// it's scheduled for future versions.
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/downloadFileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public function doAction() {

if ( $fileType[ 'proprietary_short_name' ] === 'matecat_converter' ) {
// Set the XLIFF extension to .xlf
// Internally, MateCat continues using .sdlxliff as default
// Internally, Matecat continues using .sdlxliff as default
// extension for the XLIFF behind the projects.
// Changing this behavior requires a huge refactoring that
// it's scheduled for future versions.
Expand Down
2 changes: 1 addition & 1 deletion lib/Decorator/ActivityLogDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function prepareForView( $jobLanguageDefinition, $rawContent ) {
foreach( $rawContent as $k => $value ){

// This filter allows our support team at matecat.com to have their email addresses
// replaced by a "MateCat Support Team" tag.
// replaced by a "Matecat Support Team" tag.
$value = $this->featureSet->filter('filterActivityLogEntry', $value);

if( empty( $value->email ) ) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Model/ConversionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public function processConversion(): ?array {

if ( !$res_insert ) {
//custom error message passed directly to JavaScript client and displayed as is
$convertResult[ 'errorMessage' ] = "Error: File upload failed because you have MateCat running in multiple tabs. Please close all other MateCat tabs in your browser.";
$convertResult[ 'errorMessage' ] = "Error: File upload failed because you have Matecat running in multiple tabs. Please close all other Matecat tabs in your browser.";

$this->result->changeCode( ConversionHandlerStatus::FILESYSTEM_ERROR );
$this->result->addError( $convertResult[ 'errorMessage' ], AbstractFilesStorage::basename_fix( $this->file_name ) );
Expand Down
6 changes: 3 additions & 3 deletions lib/Model/Features.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/**
* Class Features
*
* This class is an autoloader for MateCat Features, load external plugins classes
* This class is an autoloader for Matecat Features, load external plugins classes
* defined in the
* <matecat_root>/plugins/<plugin>/manifest.php
*
Expand Down Expand Up @@ -177,9 +177,9 @@ public static function loadRoutes( Klein $klein ) {
* Try to load external plugins classes and fallback to internal plugin code in case of failure
*
* If external plugin class is not defined ( no manifest or no plugin installed )
* Try to load MateCat core plugins, so they can install it's own routes
* Try to load Matecat core plugins, so they can install it's own routes
*
* @deprecated because all MateCat internal route should not have a "plugins" namespace in the route, but they should have it's own controllers defined
* @deprecated because all Matecat internal route should not have a "plugins" namespace in the route, but they should have it's own controllers defined
* Ex: http://xxxx/plugins/review_extended/quality_report/xxx/xxxxxxx
* should be something like
* http://xxxx/review_extended/quality_report/xxx/xxxxxxx
Expand Down
10 changes: 6 additions & 4 deletions lib/Plugins/Features/ReviewExtended/ReviewedWordCountModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,12 @@ function _sendNotificationEmail( $finalRevisions, $chunkReviewsWithFinalRevision
}

$segmentInfo = [
'segment_source' => Utils::htmlentitiesToUft8WithoutDoubleEncoding( $this->_event->getSegmentStruct()->segment ),
'old_translation' => Utils::htmlentitiesToUft8WithoutDoubleEncoding( $this->_event->getOldTranslation()->translation ),
'new_translation' => Utils::htmlentitiesToUft8WithoutDoubleEncoding( $this->_event->getWantedTranslation()->translation ),
'issues' => $serialized_issues
'segment_source' => Utils::htmlentitiesToUft8WithoutDoubleEncoding( $this->_event->getSegmentStruct()->segment ),
'old_translation' => Utils::htmlentitiesToUft8WithoutDoubleEncoding( $this->_event->getOldTranslation()->translation ),
'new_translation' => Utils::htmlentitiesToUft8WithoutDoubleEncoding( $this->_event->getWantedTranslation()->translation ),
'old_status' => $this->_event->getOldTranslation()->status,
'new_status' => $this->_event->getWantedTranslation()->status,
'issues' => $serialized_issues
];

foreach ( $finalRevisions as $finalRevision ) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Utils/AsyncTasks/Workers/ErrMailWorker.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ protected function _sendErrMailReport( Params $mailConf ): bool {

}

$mail->XMailer = 'MateCat Mailer';
$mail->XMailer = 'Matecat Mailer';
$mail->CharSet = 'UTF-8';
$mail->isHTML();

Expand Down
2 changes: 1 addition & 1 deletion lib/Utils/AsyncTasks/Workers/MailWorker.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function process( AbstractElement $queueElement ) {

$mail->AltBody = $queueElement->params[ 'altBody' ];

$mail->XMailer = 'MateCat Mailer';
$mail->XMailer = 'Matecat Mailer';
$mail->CharSet = 'UTF-8';
$mail->isHTML();

Expand Down
2 changes: 1 addition & 1 deletion lib/Utils/Email/AbstractEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ protected function _getLayoutVariables( $messageBody = null ): array {
if ( isset( $this->title ) ) {
$title = $this->title;
} else {
$title = 'MateCat';
$title = 'Matecat';
}

return [
Expand Down
64 changes: 56 additions & 8 deletions lib/Utils/Email/BaseCommentEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,39 @@

namespace Email;

use Comments_CommentStruct;
use Users_UserStruct;

class BaseCommentEmail extends AbstractEmail {

/**
* @var Users_UserStruct
*/
protected $user;
protected $comment;

/**
* @var Comments_CommentStruct
*/
protected Comments_CommentStruct $comment;

/**
* @var string
*/
protected $url;

protected $project;

public function __construct( $user, $comment, $url, $project, $job ) {
protected $job;

/**
* BaseCommentEmail constructor.
* @param Users_UserStruct $user
* @param Comments_CommentStruct $comment
* @param $url
* @param $project
* @param $job
*/
public function __construct( Users_UserStruct $user, Comments_CommentStruct $comment, $url, $project, $job ) {

$this->project = $project;
$this->user = $user;
Expand All @@ -40,13 +65,36 @@ protected function _getTemplateVariables(): array {
$content = \Comments_CommentDao::placeholdContent( $this->comment->message );

return [
'user' => $this->user->toArray(),
'project' => $this->project,
'job' => $this->job,
'comment' => $this->comment->toArray(),
'url' => $this->url . ",comment",
'content' => $content
'user' => $this->user->toArray(),
'project' => $this->project,
'job' => $this->job,
'commenter' => $this->getCommentFullName(),
'url' => $this->url . ",comment",
'content' => $content
];
}

/**
* @return string
*/
private function getCommentFullName()
{
if($this->comment->is_anonymous == true){

$revision_number = (int)$this->comment->revision_number;

switch ($revision_number){
case 1:
return "translator";

case 2:
return "the revisor";

case 3:
return "the 2nd pass revisor";
}
}

return $this->comment->full_name;
}
}
2 changes: 1 addition & 1 deletion lib/Utils/Email/InvitedToTeamEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct( \Users_UserStruct $user, $invited_email, TeamStruct
$this->user = $user;
$this->invited_email = $invited_email;
$this->team = $team;
$this->title = "You've been invited to MateCat";
$this->title = "You've been invited to Matecat";

$this->_setLayout( 'skeleton.html' );
$this->_setTemplate( 'Team/email_invited_to_team.html' );
Expand Down
2 changes: 1 addition & 1 deletion lib/Utils/Email/SendToTranslatorAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __construct( Users_UserStruct $user, JobsTranslatorsStruct $tran

$this->user = $user;
$this->translator = $translator;
$this->title = "MateCat - Translation Job";
$this->title = "Matecat - Translation Job";
$this->projectName = $projectName;

$translator->delivery_date =
Expand Down
2 changes: 1 addition & 1 deletion lib/Utils/Email/SendToTranslatorForDeliveryChangeEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class SendToTranslatorForDeliveryChangeEmail extends SendToTranslatorAbstract {

public function __construct( Users_UserStruct $user, JobsTranslatorsStruct $translator, $projectName ) {
parent::__construct( $user, $translator, $projectName );
$this->title = "MateCat - Job delivery updated.";
$this->title = "Matecat - Job delivery updated.";
$this->_setTemplate( 'Translator/job_change_delivery_send_to_translator_content.html' );
$this->_RoutesMethod = '\Routes::translate';
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Utils/Email/SendToTranslatorForJobSplitEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class SendToTranslatorForJobSplitEmail extends SendToTranslatorAbstract {

public function __construct( Users_UserStruct $user, JobsTranslatorsStruct $translator, $projectName ) {
parent::__construct( $user, $translator, $projectName );
$this->title = "MateCat - Job delivery updated.";
$this->title = "Matecat - Job delivery updated.";
$this->_setTemplate( 'Translator/job_split_send_to_translator_content.html' );
$this->_RoutesMethod = '\Routes::translate';
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Utils/Email/SendToTranslatorForNewJobEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class SendToTranslatorForNewJobEmail extends SendToTranslatorAbstract {

public function __construct( Users_UserStruct $user, JobsTranslatorsStruct $translator, $projectName ) {
parent::__construct( $user, $translator, $projectName );
$this->title = "MateCat - Translation Job.";
$this->title = "Matecat - Translation Job.";
$this->_setTemplate( 'Translator/job_new_send_to_translator_content.html' );
$this->_RoutesMethod = '\Routes::translate';
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Utils/Email/SignupEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class SignupEmail extends AbstractEmail {
*/
private $user;

protected $title = 'Confirm your registration with MateCat';
protected $title = 'Confirm your registration with Matecat';

public function __construct( \Users_UserStruct $user ) {

Expand Down
2 changes: 1 addition & 1 deletion lib/Utils/Filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ private static function logConversion( array $response, bool $toXliff, string $s
if ( $response[ 'successful' ] !== true ) {

if ( INIT::$FILTERS_EMAIL_FAILURES ) {
Utils::sendErrMailReport( "MateCat: conversion failed.\n\n" . print_r( $info, true ) );
Utils::sendErrMailReport( "Matecat: conversion failed.\n\n" . print_r( $info, true ) );
}

self::backupFailedConversion( $sentFile );
Expand Down
2 changes: 1 addition & 1 deletion lib/Utils/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ protected static function initMonolog() {
$fileHandler = new StreamHandler( self::getFileNamePath() );
$fileFormatter = new LineFormatter( "%message%\n", "", true, true );
$fileHandler->setFormatter( $fileFormatter );
self::$logger = new Logger( 'MateCat', [ $fileHandler ] );
self::$logger = new Logger( 'Matecat', [ $fileHandler ] );
}

protected static function getFileNamePath() {
Expand Down
2 changes: 1 addition & 1 deletion lib/Utils/OutsourceTo/AbstractProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ abstract class OutsourceTo_AbstractProvider {
protected $_outsource_login_url_ko = "";

/**
* These are the url that the vendor system must call in order to confirm the outsource to MateCat
* These are the url that the vendor system must call in order to confirm the outsource to Matecat
*
* Set them appropriately in the constructor.
*
Expand Down
4 changes: 2 additions & 2 deletions lib/Utils/ProjectManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ public function createProject() {

//Allow projects with less than 250.000 words or characters ( for cjk languages )
if ( $this->files_word_count > INIT::$MAX_SOURCE_WORDS ) {
throw new Exception( "MateCat is unable to create your project. Please contact us at " . INIT::$SUPPORT_MAIL . ", we will be happy to help you!", 128 );
throw new Exception( "Matecat is unable to create your project. Please contact us at " . INIT::$SUPPORT_MAIL . ", we will be happy to help you!", 128 );
}

$featureSet->run( "beforeInsertSegments", $this->projectStructure,
Expand Down Expand Up @@ -2896,7 +2896,7 @@ private function __addNotesToProjectStructure( $trans_unit, $fid ) {
* setSegmentIdForNotes
*
* Adds notes to segment, taking into account that a same note may be assigned to
* more than one MateCat segment, due to the <mrk> tags.
* more than one Matecat segment, due to the <mrk> tags.
*
* Example:
* ['notes'][ $internal_id] => array( 'aaa' );
Expand Down
2 changes: 1 addition & 1 deletion lib/Utils/TmKeyManagement/ShareKeyEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ protected function _getTemplateVariables(): array {
protected function _getLayoutVariables($messageBody = null): array {
$vars = parent::_getLayoutVariables();
$vars['showTitle'] = TRUE ;
$vars['title'] = "MateCat - Resource shared" ;
$vars['title'] = "Matecat - Resource shared" ;

return $vars ;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Utils/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ public static function sendErrMailReport( string $htmlContent, string $subject =
$mailConf = @parse_ini_file( INIT::$ROOT . '/inc/Error_Mail_List.ini', true );

if ( empty( $subject ) ) {
$subject = 'Alert from MateCat: ' . php_uname( 'n' );
$subject = 'Alert from Matecat: ' . php_uname( 'n' );
} else {
$subject .= ' ' . php_uname( 'n' );
}
Expand Down
2 changes: 1 addition & 1 deletion lib/View/Emails/Comment/action_on_a_comment.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<p> Hi <?= $user['first_name']?>, <br/><strong><?= $comment['full_name'] ?></strong> <?= $action ?> <br/> <strong><?= $project['name'] ?></strong> <span> (<?= $project['id'] ?>)</span> |
<p> Hi <?= $user['first_name']?>, <br/><strong><?= $commenter ?></strong> <?= $action ?> <br/> <strong><?= $project['name'] ?></strong> <span> (<?= $project['id'] ?>)</span> |
<strong><?= $job['source'] ?></strong> &gt; <strong><?= $job['target'] ?></strong>
</p>
<br/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@
<strong>New target</strong>: <?= $segmentInfo['new_translation'] ?>
</p>

<p>
<strong>Old status</strong>: <?= $segmentInfo['old_status'] ?>
</p>

<p>
<strong>New status</strong>: <?= $segmentInfo['new_status'] ?>
</p>

<p>
<?php if ( count( $segmentInfo['issues']) > 0 ) { ?>
<p><strong>Issues</strong><p>
Expand Down
2 changes: 1 addition & 1 deletion lib/View/templates/_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
<div class="page-content"></div>
<tal:block metal:use-macro="templates/common.html/footer_includes" />
<tal:block metal:use-macro="${php: INIT::$TRACKING_CODES_VIEW_PATH}/external_sources.html/track_codes_translate"/>
<!--Container for MateCat Notifications-->
<!--Container for Matecat Notifications-->
<div class="notifications-wrapper"></div>
</body>

Expand Down
2 changes: 1 addition & 1 deletion lib/View/templates/_manage.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

</footer>

<!--Container for MateCat Notifications-->
<!--Container for Matecat Notifications-->
<div class="notifications-wrapper"></div>

<div metal:use-macro="${php: INIT::$TRACKING_CODES_VIEW_PATH}/external_sources.html/track_codes_analyze"/>
Expand Down