Skip to content

Commit

Permalink
Moved some i18n strings into contexts
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuluru committed Dec 11, 2018
1 parent 10dafc2 commit 036e25e
Show file tree
Hide file tree
Showing 14 changed files with 52 additions and 52 deletions.
6 changes: 3 additions & 3 deletions src/Model/Results/RoundRobinRecord.php
Expand Up @@ -45,15 +45,15 @@ public function addResult($opp_id, $score_for, $score_against, $cf_for, $spirit_
// What type of result was this?
if ($score_for > $score_against) {
++ $this->wins;
$streak_type = __('W');
$streak_type = __x('standings', 'W');
$points = $sport_obj->winValue();
} else if ($score_for < $score_against) {
++ $this->losses;
$streak_type = __('L');
$streak_type = __x('standings', 'L');
$points = $sport_obj->lossValue();
} else {
++ $this->ties;
$streak_type = __('T');
$streak_type = __x('standings', 'T');
$points = $sport_obj->tieValue();
}

Expand Down
2 changes: 1 addition & 1 deletion src/Template/Divisions/allstars.ctp
Expand Up @@ -20,7 +20,7 @@ foreach ($allstars as $allstar) {
// TODO: Eliminate gender breakdown for non-admin users, if we open up permissions
if ($allstar->person->$column != $gender) {
$gender = $allstar->person->$column;
$rows[] = [[$this->Html->tag('h3', __($gender)), ['colspan' => 3]]];
$rows[] = [[$this->Html->tag('h3', __x('gender', $gender)), ['colspan' => 3]]];
}
$rows[] = [
$this->element('People/block', ['person' => $allstar->person]),
Expand Down
22 changes: 11 additions & 11 deletions src/Template/Element/Leagues/standings/ladder/heading.ctp
Expand Up @@ -19,20 +19,20 @@ endif;
?>
</tr>
<tr>
<th title="<?= __('Wins') ?>"><?= __('W') ?></th>
<th title="<?= __('Losses') ?>"><?= __('L') ?></th>
<th title="<?= __('Ties') ?>"><?= __('T') ?></th>
<th title="<?= __('Defaults') ?>"><?= __('D') ?></th>
<th title="<?= __('Goals For') ?>"><?= __('GF') ?></th>
<th title="<?= __('Goals Against') ?>"><?= __('GA') ?></th>
<th title="<?= __('Plus/Minus') ?>"><?= __('+/-') ?></th>
<th title="<?= __('Wins') ?>"><?= __x('standings', 'W') ?></th>
<th title="<?= __('Losses') ?>"><?= __x('standings', 'L') ?></th>
<th title="<?= __('Ties') ?>"><?= __x('standings', 'T') ?></th>
<th title="<?= __('Defaults') ?>"><?= __x('standings', 'D') ?></th>
<th title="<?= __('Goals For') ?>"><?= __x('standings', 'GF') ?></th>
<th title="<?= __('Goals Against') ?>"><?= __x('standings', 'GA') ?></th>
<th title="<?= __('Plus/Minus') ?>"><?= __x('standings', '+/-') ?></th>
<?php
if ($league->hasCarbonFlip()):
?>
<th title="<?= __('Wins') ?>"><?= __('W') ?></th>
<th title="<?= __('Losses') ?>"><?= __('L') ?></th>
<th title="<?= __('Ties') ?>"><?= __('T') ?></th>
<th title="<?= __('Average') ?>"><?= __('A') ?></th>
<th title="<?= __('Wins') ?>"><?= __x('standings', 'W') ?></th>
<th title="<?= __('Losses') ?>"><?= __x('standings', 'L') ?></th>
<th title="<?= __('Ties') ?>"><?= __x('standings', 'T') ?></th>
<th title="<?= __('Average') ?>"><?= __x('standings', 'A') ?></th>
<?php
endif;
?>
Expand Down
40 changes: 20 additions & 20 deletions src/Template/Element/Leagues/standings/rounds/heading.ctp
Expand Up @@ -28,32 +28,32 @@ endif;
<?php
if ($division->current_round != 1):
?>
<th title="<?= __('Wins') ?>"><?= __('W') ?></th>
<th title="<?= __('Losses') ?>"><?= __('L') ?></th>
<th title="<?= __('Ties') ?>"><?= __('T') ?></th>
<th title="<?= __('Defaults') ?>"><?= __('D') ?></th>
<th title="<?= __('Points') ?>"><?= __('P') ?></th>
<th title="<?= __('Goals For') ?>"><?= __('GF') ?></th>
<th title="<?= __('Goals Against') ?>"><?= __('GA') ?></th>
<th title="<?= __('Plus/Minus') ?>"><?= __('+/-') ?></th>
<th title="<?= __('Wins') ?>"><?= __x('standings', 'W') ?></th>
<th title="<?= __('Losses') ?>"><?= __x('standings', 'L') ?></th>
<th title="<?= __('Ties') ?>"><?= __x('standings', 'T') ?></th>
<th title="<?= __('Defaults') ?>"><?= __x('standings', 'D') ?></th>
<th title="<?= __('Points') ?>"><?= __x('standings', 'P') ?></th>
<th title="<?= __('Goals For') ?>"><?= __x('standings', 'GF') ?></th>
<th title="<?= __('Goals Against') ?>"><?= __x('standings', 'GA') ?></th>
<th title="<?= __('Plus/Minus') ?>"><?= __x('standings', '+/-') ?></th>
<?php
endif;
?>
<th title="<?= __('Wins') ?>"><?= __('W') ?></th>
<th title="<?= __('Losses') ?>"><?= __('L') ?></th>
<th title="<?= __('Ties') ?>"><?= __('T') ?></th>
<th title="<?= __('Defaults') ?>"><?= __('D') ?></th>
<th title="<?= __('Points') ?>"><?= __('P') ?></th>
<th title="<?= __('Goals For') ?>"><?= __('GF') ?></th>
<th title="<?= __('Goals Against') ?>"><?= __('GA') ?></th>
<th title="<?= __('Plus/Minus') ?>"><?= __('+/-') ?></th>
<th title="<?= __('Wins') ?>"><?= __x('standings', 'W') ?></th>
<th title="<?= __('Losses') ?>"><?= __x('standings', 'L') ?></th>
<th title="<?= __('Ties') ?>"><?= __x('standings', 'T') ?></th>
<th title="<?= __('Defaults') ?>"><?= __x('standings', 'D') ?></th>
<th title="<?= __('Points') ?>"><?= __x('standings', 'P') ?></th>
<th title="<?= __('Goals For') ?>"><?= __x('standings', 'GF') ?></th>
<th title="<?= __('Goals Against') ?>"><?= __x('standings', 'GA') ?></th>
<th title="<?= __('Plus/Minus') ?>"><?= __x('standings', '+/-') ?></th>
<?php
if ($league->hasCarbonFlip()):
?>
<th title="<?= __('Wins') ?>"><?= __('W') ?></th>
<th title="<?= __('Losses') ?>"><?= __('L') ?></th>
<th title="<?= __('Ties') ?>"><?= __('T') ?></th>
<th title="<?= __('Average') ?>"><?= __('A') ?></th>
<th title="<?= __('Wins') ?>"><?= __x('standings', 'W') ?></th>
<th title="<?= __('Losses') ?>"><?= __x('standings', 'L') ?></th>
<th title="<?= __('Ties') ?>"><?= __x('standings', 'T') ?></th>
<th title="<?= __('Average') ?>"><?= __x('standings', 'A') ?></th>
<?php
endif;
?>
Expand Down
14 changes: 7 additions & 7 deletions src/Template/Element/Leagues/standings/tournament/heading.ctp
@@ -1,13 +1,13 @@
<tr>
<th><?= __('Seed') ?></th>
<th><?= __('Team Name') ?></th>
<th title="<?= __('Wins') ?>"><?= __('W') ?></th>
<th title="<?= __('Losses') ?>"><?= __('L') ?></th>
<th title="<?= __('Ties') ?>"><?= __('T') ?></th>
<th title="<?= __('Defaults') ?>"><?= __('D') ?></th>
<th title="<?= __('Goals For') ?>"><?= __('GF') ?></th>
<th title="<?= __('Goals Against') ?>"><?= __('GA') ?></th>
<th title="<?= __('Plus/Minus') ?>"><?= __('+/-') ?></th>
<th title="<?= __('Wins') ?>"><?= __x('standings', 'W') ?></th>
<th title="<?= __('Losses') ?>"><?= __x('standings', 'L') ?></th>
<th title="<?= __('Ties') ?>"><?= __x('standings', 'T') ?></th>
<th title="<?= __('Defaults') ?>"><?= __x('standings', 'D') ?></th>
<th title="<?= __('Goals For') ?>"><?= __x('standings', 'GF') ?></th>
<th title="<?= __('Goals Against') ?>"><?= __x('standings', 'GA') ?></th>
<th title="<?= __('Plus/Minus') ?>"><?= __x('standings', '+/-') ?></th>
<th><?= __('Streak') ?></th>
<?php
if ($league->hasSpirit()):
Expand Down
4 changes: 2 additions & 2 deletions src/Template/Element/Leagues/standings/tournament/pools.ctp
Expand Up @@ -191,10 +191,10 @@ foreach ($games as $stage_id => $stage):
$class = ' class="unpublished"';
}
?>
<td<?= $class ?>><?= $this->Html->link($game->home_pool_team->alias . __('v') . $game->away_pool_team->alias, ['controller' => 'Games', 'action' => 'view', 'game' => $game->id]) ?></td>
<td<?= $class ?>><?= $this->Html->link($game->home_pool_team->alias . __x('standings', 'v') . $game->away_pool_team->alias, ['controller' => 'Games', 'action' => 'view', 'game' => $game->id]) ?></td>
<td<?= $class ?>><?php
if ($game->isFinalized()) {
echo $game->home_score . '-' . $game->away_score . ' ' . __('(F)');
echo $game->home_score . '-' . $game->away_score . ' ' . __x('standings', '(F)');
} else {
$entry = $game->getBestScoreEntry();
if ($entry) {
Expand Down
2 changes: 1 addition & 1 deletion src/Template/Email/html/attendance_summary.ctp
Expand Up @@ -35,7 +35,7 @@ foreach ($summary as $status => $genders) {
$text = '';
foreach ($genders as $gender => $players) {
if (!empty($players)) {
$text .= '<br />' . count($players) . ' ' . __($gender) . ': ' . implode(', ', $players);
$text .= '<br />' . count($players) . ' ' . __x('gender', $gender) . ': ' . implode(', ', $players);
}
}
if (!empty($text)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Template/Email/html/event_attendance_summary.ctp
Expand Up @@ -21,7 +21,7 @@ foreach ($summary as $status => $genders) {
$text = '';
foreach ($genders as $gender => $players) {
if (!empty($players)) {
$text .= '<br />' . count($players) . ' ' . __($gender) . ': ' . implode(', ', $players);
$text .= '<br />' . count($players) . ' ' . __x('gender', $gender) . ': ' . implode(', ', $players);
}
}
if (!empty($text)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Template/Email/text/attendance_summary.ctp
Expand Up @@ -39,7 +39,7 @@ foreach ($summary as $status => $genders) {
$text = '';
foreach ($genders as $gender => $players) {
if (!empty($players)) {
$text .= "\n" . count($players) . ' ' . __($gender) . ': ' . implode(', ', $players);
$text .= "\n" . count($players) . ' ' . __x('gender', $gender) . ': ' . implode(', ', $players);
}
}
if (!empty($text)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Template/Email/text/event_attendance_summary.ctp
Expand Up @@ -23,7 +23,7 @@ foreach ($summary as $status => $genders) {
$text = '';
foreach ($genders as $gender => $players) {
if (!empty($players)) {
$text .= "\n" . count($players) . ' ' . __($gender) . ': ' . implode(', ', $players);
$text .= "\n" . count($players) . ' ' . __x('gender', $gender) . ': ' . implode(', ', $players);
}
}
if (!empty($text)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Template/Games/attendance.ctp
Expand Up @@ -47,7 +47,7 @@ if ($display_gender):
foreach ([Configure::read('gender.woman'), Configure::read('gender.man')] as $gender) {
if ($count[$status][$gender]) {
// TODOFUO: Better option than the substr method, that's going to break
$counts[] = $count[$status][$gender] . substr(__($gender), 0, 1);
$counts[] = $count[$status][$gender] . substr(__x('gender', $gender), 0, 1);
}
}
if (!empty($counts)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Template/TeamEvents/view.ctp
Expand Up @@ -69,7 +69,7 @@ if ($display_gender):
$counts = [];
foreach ([Configure::read('gender.woman'), Configure::read('gender.man')] as $gender) {
if ($count[$status][$gender]) {
$counts[] = $count[$status][$gender] . substr(__($gender), 0, 1);
$counts[] = $count[$status][$gender] . substr(__x('gender', $gender), 0, 1);
}
}
if (!empty($counts)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Template/Teams/attendance.ctp
Expand Up @@ -151,7 +151,7 @@ if ($team->display_gender):
foreach (array_keys($all_items) as $key) {
foreach ([Configure::read('gender.woman'), Configure::read('gender.man')] as $gender) {
if ($count[$status][$key][$gender]) {
$counts[$key][] = $count[$status][$key][$gender] . substr(__($gender), 0, 1);
$counts[$key][] = $count[$status][$key][$gender] . substr(__x('gender', $gender), 0, 1);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Template/Teams/schedule.ctp
Expand Up @@ -160,7 +160,7 @@ if (!empty($team['games'])):
}
krsort($counts);
$counts = collection($counts)->map(function ($count, $gender) {
return $count . substr(__($gender), 0, 1);
return $count . substr(__x('gender', $gender), 0, 1);
})->toArray();
echo implode(' / ', $counts);
}
Expand Down

0 comments on commit 036e25e

Please sign in to comment.