Skip to content
This repository has been archived by the owner on May 9, 2021. It is now read-only.

Multilang support for email #197

Closed
wants to merge 3 commits into from
Closed
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
31 changes: 31 additions & 0 deletions app/application/language/de/email.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

return array(

/** new user **/
'subject_newuser' => 'Dein neues Tiny Issue Konto',
'new_user' => 'Ein neues Konto wurde für dich unter eingerichtet: ',
'creds' => 'Du kannst dich mit der Email-Adresse %s und dem Passwort %s bei Tiny Issue anmelden.',

/** issue updates **/
'new_issue' => 'Neues Ticket "%s" wurde im Projekt "%s" erstellt',
'new_comment' => 'Neues Kommentar in Ticket "%s" in Projekt "%s"',
'assignment' => 'Ticket "%s" in Projekt "%s" wurde dir zuzgeordnet',
'reassignment' => 'Ticket "%s" in Projekt "%s" wurde an dich übergeben',
'update' => 'Ticket "%s" in Projekt "%s" wurde aktualisiert',

'submitted_by' => 'Erstellt von: %s',
'created_by' => 'Erstellt von: %s',
'reassigned_by' => 'Übergeben von: %s',
'updated_by' => 'Aktualisiert von: %s',

'issue_changed' => 'Ticket "%s" in Projekt "%s" wurde %s',
'closed' => 'geschlossen',
'reopened' => 'wieder geöffnet',
//changed, reopened, etc. by
'by' => 'von',

/** general **/
'more_url' => 'Weitere Details: ',

);
31 changes: 31 additions & 0 deletions app/application/language/en/email.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

return array(

/** new user **/
'subject_newuser' => 'Your Tiny Issue Account',
'new_user' => 'You have been set up with Tiny Issue at',
'creds' => 'You may log in with email %s and password %s.',

/** issue updates **/
'new_issue' => 'New issue "%s" was submitted to "%s" project',
'new_comment' => 'Issue "%s" in "%s" project has a new comment',
'assignment' => 'New issue "%s" was submitted to "%s" project and assigned to you',
'reassignment' => 'Issue "%s" in "%s" project was reassigned to you',
'update' => 'Issue "%s" in "%s" project was updated',

'submitted_by' => 'Submitted by: %s',
'created_by' => 'Created by: %s',
'reassigned_by' => 'Reassigned by: %s',
'updated_by' => 'Updated by: %s',

'issue_changed' => 'Issue "%s" in "%s" project was %s',
'closed' => 'closed',
'reopened' => 'reopened',
//changed, reopened, etc. by
'by' => 'by',

/** general **/
'more_url' => 'Find more information at: ',

);
35 changes: 35 additions & 0 deletions app/application/language/fr/email.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

return array(

/*******************************
* TRANSLATION NEEDED
*******************************/

/** new user **/
'subject_newuser' => 'Your Tiny Issue Account',
'new_user' => 'You have been set up with Tiny Issue at',
'creds' => 'You may log in with email %s and password %s.',

/** issue updates **/
'new_issue' => 'New issue "%s" was submitted to "%s" project',
'new_comment' => 'Issue "%s" in "%s" project has a new comment',
'assignment' => 'New issue "%s" was submitted to "%s" project and assigned to you',
'reassignment' => 'Issue "%s" in "%s" project was reassigned to you',
'update' => 'Issue "%s" in "%s" project was updated',

'submitted_by' => 'Submitted by: %s',
'created_by' => 'Created by: %s',
'reassigned_by' => 'Reassigned by: %s',
'updated_by' => 'Updated by: %s',

'issue_changed' => 'Issue "%s" in "%s" project was %s',
'closed' => 'closed',
'reopened' => 'reopened',
//changed, reopened, etc. by
'by' => 'by',

/** general **/
'more_url' => 'Find more information at: ',

);
35 changes: 35 additions & 0 deletions app/application/language/it/email.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

return array(

/*******************************
* TRANSLATION NEEDED
*******************************/

/** new user **/
'subject_newuser' => 'Your Tiny Issue Account',
'new_user' => 'You have been set up with Tiny Issue at',
'creds' => 'You may log in with email %s and password %s.',

/** issue updates **/
'new_issue' => 'New issue "%s" was submitted to "%s" project',
'new_comment' => 'Issue "%s" in "%s" project has a new comment',
'assignment' => 'New issue "%s" was submitted to "%s" project and assigned to you',
'reassignment' => 'Issue "%s" in "%s" project was reassigned to you',
'update' => 'Issue "%s" in "%s" project was updated',

'submitted_by' => 'Submitted by: %s',
'created_by' => 'Created by: %s',
'reassigned_by' => 'Reassigned by: %s',
'updated_by' => 'Updated by: %s',

'issue_changed' => 'Issue "%s" in "%s" project was %s',
'closed' => 'closed',
'reopened' => 'reopened',
//changed, reopened, etc. by
'by' => 'by',

/** general **/
'more_url' => 'Find more information at: ',

);
35 changes: 35 additions & 0 deletions app/application/language/ru/email.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

return array(

/*******************************
* TRANSLATION NEEDED
*******************************/

/** new user **/
'subject_newuser' => 'Your Tiny Issue Account',
'new_user' => 'You have been set up with Tiny Issue at',
'creds' => 'You may log in with email %s and password %s.',

/** issue updates **/
'new_issue' => 'New issue "%s" was submitted to "%s" project',
'new_comment' => 'Issue "%s" in "%s" project has a new comment',
'assignment' => 'New issue "%s" was submitted to "%s" project and assigned to you',
'reassignment' => 'Issue "%s" in "%s" project was reassigned to you',
'update' => 'Issue "%s" in "%s" project was updated',

'submitted_by' => 'Submitted by: %s',
'created_by' => 'Created by: %s',
'reassigned_by' => 'Reassigned by: %s',
'updated_by' => 'Updated by: %s',

'issue_changed' => 'Issue "%s" in "%s" project was %s',
'closed' => 'closed',
'reopened' => 'reopened',
//changed, reopened, etc. by
'by' => 'by',

/** general **/
'more_url' => 'Find more information at: ',

);
35 changes: 35 additions & 0 deletions app/application/language/zh_CN/email.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

return array(

/*******************************
* TRANSLATION NEEDED
*******************************/

/** new user **/
'subject_newuser' => 'Your Tiny Issue Account',
'new_user' => 'You have been set up with Tiny Issue at',
'creds' => 'You may log in with email %s and password %s.',

/** issue updates **/
'new_issue' => 'New issue "%s" was submitted to "%s" project',
'new_comment' => 'Issue "%s" in "%s" project has a new comment',
'assignment' => 'New issue "%s" was submitted to "%s" project and assigned to you',
'reassignment' => 'Issue "%s" in "%s" project was reassigned to you',
'update' => 'Issue "%s" in "%s" project was updated',

'submitted_by' => 'Submitted by: %s',
'created_by' => 'Created by: %s',
'reassigned_by' => 'Reassigned by: %s',
'updated_by' => 'Updated by: %s',

'issue_changed' => 'Issue "%s" in "%s" project was %s',
'closed' => 'closed',
'reopened' => 'reopened',
//changed, reopened, etc. by
'by' => 'by',

/** general **/
'more_url' => 'Find more information at: ',

);
35 changes: 35 additions & 0 deletions app/application/language/zh_TW/email.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

return array(

/*******************************
* TRANSLATION NEEDED
*******************************/

/** new user **/
'subject_newuser' => 'Your Tiny Issue Account',
'new_user' => 'You have been set up with Tiny Issue at',
'creds' => 'You may log in with email %s and password %s.',

/** issue updates **/
'new_issue' => 'New issue "%s" was submitted to "%s" project',
'new_comment' => 'Issue "%s" in "%s" project has a new comment',
'assignment' => 'New issue "%s" was submitted to "%s" project and assigned to you',
'reassignment' => 'Issue "%s" in "%s" project was reassigned to you',
'update' => 'Issue "%s" in "%s" project was updated',

'submitted_by' => 'Submitted by: %s',
'created_by' => 'Created by: %s',
'reassigned_by' => 'Reassigned by: %s',
'updated_by' => 'Updated by: %s',

'issue_changed' => 'Issue "%s" in "%s" project was %s',
'closed' => 'closed',
'reopened' => 'reopened',
//changed, reopened, etc. by
'by' => 'by',

/** general **/
'more_url' => 'Find more information at: ',

);
14 changes: 7 additions & 7 deletions app/application/models/project/issue.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,11 @@ public function reassign($user_id)
$project_id = $this->project_id;
$project = \Project::find($project_id);

$subject = 'Issue "' . $this->title . '" in "' . $project->name . '" project was reassigned to you';
$subject = sprintf(__('email.reassignment'),$this->title,$project->name);
$text = \View::make('email.reassigned_issue', array(
'actor' => \Auth::user()->firstname . ' ' . \Auth::user()->lastname,
'project' => $project,
'issue' => $this,
'issue' => $this
));

\Mail::send_email($text, $this->assigned->email, $subject);
Expand Down Expand Up @@ -258,9 +258,9 @@ public function change_status($status)
if($this->assigned_to && $this->assigned_to != \Auth::user()->id)
{
$project = \Project::current();
$verb = ($this->status == 0 ? 'closed' : 'reopened');
$verb = ($this->status == 0 ? __('email.closed') : __('email.reopened'));

$subject = 'Issue "' . $this->title . '" in "' . $project->name . '" project was ' . $verb;
$subject = sprintf(__('email.issue_changed'),$this->title,$project->name,$verb);
$text = \View::make('email.change_status_issue', array(
'actor' => \Auth::user()->firstname . ' ' . \Auth::user()->lastname,
'project' => $project,
Expand Down Expand Up @@ -315,7 +315,7 @@ public function update_issue($input)
{
$project = \Project::current();

$subject = 'Issue "' . $this->title . '" in "' . $project->name . '" project was updated';
$subject = sprintf(__('email.update'),$this->title,$project->name);
$text = \View::make('email.update_issue', array(
'actor' => \Auth::user()->firstname . ' ' . \Auth::user()->lastname,
'project' => $project,
Expand Down Expand Up @@ -419,7 +419,7 @@ public static function create_issue($input, $project)
{
$project = \Project::current();

$subject = 'New issue "' . $issue->title . '" was submitted to "' . $project->name . '" project and assigned to you';
$subject = sprintf(__('email.assignment'),$issue->title,$project->name);
$text = \View::make('email.new_assigned_issue', array(
'project' => $project,
'issue' => $issue,
Expand All @@ -435,7 +435,7 @@ public static function create_issue($input, $project)
{
if($row->id != \Auth::user()->id && $row->permission('project-modify'))
{
$subject = 'New issue "' . $issue->title . '" was submitted to "' . $project->name . '" project';
$subject = sprintf(__('email.new_issue'),$issue->title,$project->name);
$text = \View::make('email.new_issue', array(
'project' => $project,
'issue' => $issue,
Expand Down
3 changes: 2 additions & 1 deletion app/application/models/project/issue/comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,12 @@ public static function create_comment($input, $project, $issue)
{
$project = \Project::current();

$subject = 'Issue "' . $issue->title . '" in "' . $project->name . '" project has a new comment';
$subject = sprintf(__('email.new_comment'),$issue->title,$project->name);
$text = \View::make('email.commented_issue', array(
'actor' => \Auth::user()->firstname . ' ' . \Auth::user()->lastname,
'project' => $project,
'issue' => $issue,
'comment' => $comment->comment
));

\Mail::send_email($text, $issue->assigned->email, $subject);
Expand Down
2 changes: 1 addition & 1 deletion app/application/models/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ public static function add_user($info)
'password' => $password
));

Mail::send_email($view, $info['email'], 'Your Tiny Issue Account');
Mail::send_email($view, $info['email'], __('email.subject_newuser'));

return array(
'success' => true,
Expand Down
6 changes: 3 additions & 3 deletions app/application/views/email/change_status_issue.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<p>Issue "<?php echo $issue->title; ?>" in "<?php echo $project->name; ?>" project was <?php echo $verb; ?>.</p>
<p><?php echo sprintf(__('email.issue_changed'),$issue->title,$project->name,$verb); ?>.</p>

<p><?php echo ucfirst($verb); ?> by: <?php echo $actor; ?><br />
URL: <a href="<?php echo $issue->to(); ?>"><?php echo $issue->to(); ?></a></p>
<p><?php echo ucfirst($verb); ?> <?php echo __('email.by'); ?>: <?php echo $actor; ?><br />
<?php echo __('email.more_url'); ?><a href="<?php echo $issue->to(); ?>"><?php echo $issue->to(); ?></a></p>
8 changes: 5 additions & 3 deletions app/application/views/email/commented_issue.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<p>Issue "<?php echo $issue->title; ?>" in "<?php echo $project->name; ?>" project has a new comment.</p>
<p><?php echo sprintf(__('email.new_comment'),$issue->title,$project->name); ?>:</p>

<p>Submitted by: <?php echo $actor; ?><br />
URL: <a href="<?php echo $issue->to(); ?>"><?php echo $issue->to(); ?></a></p>
<p><?php echo nl2br($comment); ?></p>

<p><?php echo sprintf(__('email.submitted_by'),$actor); ?><br />
<?php echo __('email.more_url'); ?><a href="<?php echo $issue->to(); ?>"><?php echo $issue->to(); ?></a></p>
8 changes: 5 additions & 3 deletions app/application/views/email/new_assigned_issue.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<p>New issue "<?php echo $issue->title; ?>" was submitted to "<?php echo $project->name; ?>" project and assigned to you.</p>
<p><?php echo sprintf(__('email.assignment'),$issue->title,$project->name); ?>.</p>

<p>Created by: <?php echo $issue->user->firstname . ' ' . $issue->user->lastname; ?><br />
URL: <a href="<?php echo $issue->to(); ?>"><?php echo $issue->to(); ?></a></p>
<p><?php echo nl2br($issue->body); ?></p>

<p><?php echo sprintf(__('email.created_by'),$issue->user->firstname . ' ' . $issue->user->lastname); ?><br />
<?php echo __('email.more_url'); ?><a href="<?php echo $issue->to(); ?>"><?php echo $issue->to(); ?></a></p>
8 changes: 5 additions & 3 deletions app/application/views/email/new_issue.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<p>New issue "<?php echo $issue->title; ?>" was submitted to "<?php echo $project->name; ?>" project.</p>
<p><?php echo sprintf(__('email.new_issue'),$issue->title,$project->name); ?>.</p>

<p>Submitted by: <?php echo $issue->user->firstname . ' ' . $issue->user->lastname; ?><br />
URL: <a href="<?php echo $issue->to(); ?>"><?php echo $issue->to(); ?></a></p>
<p><?php echo nl2br($issue->body); ?></p>

<p><?php echo sprintf(__('email.submitted_by'),$issue->user->firstname . ' ' . $issue->user->lastname); ?><br />
<?php echo __('email.more_url'); ?><a href="<?php echo $issue->to(); ?>"><?php echo $issue->to(); ?></a></p>
4 changes: 2 additions & 2 deletions app/application/views/email/new_user.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<p>You have been set up with Tiny Issue at <?php echo URL::to(); ?></p>
<p><?php echo __('email.new_user'); ?> <a href="<?php echo URL::to(); ?>"><?php echo URL::to(); ?></a></p>
<p>
You may log in with email <?php echo $email; ?> and password <?php echo $password; ?>
<?php echo sprintf(__('email.creds'),'<strong>'.$email.'</strong>','<strong>'.$password.'</strong>'); ?>
</p>
8 changes: 5 additions & 3 deletions app/application/views/email/reassigned_issue.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<p>Issue "<?php echo $issue->title; ?>" in "<?php echo $project->name; ?>" project was reassigned to you.</p>
<p><?php echo sprintf(__('email.reassignment'),$issue->title,$project->name); ?>.</p>

<p>Reassigned by: <?php echo $actor; ?><br />
URL: <a href="<?php echo $issue->to(); ?>"><?php echo $issue->to(); ?></a></p>
<p><?php echo nl2br($issue->body); ?></p>

<p><?php echo sprintf(__('email.reassigned_by'),$actor); ?><br />
<?php echo __('email.more_url'); ?><a href="<?php echo $issue->to(); ?>"><?php echo $issue->to(); ?></a></p>
Loading