Skip to content

Commit

Permalink
Merge pull request #58 from helsingborg-stad/feature/allow-already-se…
Browse files Browse the repository at this point in the history
…t-lang

feat: allow already set lang
  • Loading branch information
sebastianthulin authored Nov 6, 2023
2 parents d63d1d2 + 858208e commit 01e227d
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions source/php/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,18 @@ public function singleViewData($data)
$data['sourceSystem'] = $this->getSourceSystem();
$data['preparedListData'] = $this->prepareData($data);

$data['lang'] = (object) [
'applyNow' => __('Apply now', 'job-listings'),
'applyHere' => __('Apply here', 'job-listings'),
'contact' => __('Contact', 'job-listings'),
'information' => __('Information', 'job-listings'),
'login' => __('Log in', 'job-listings'),
'daysLeft' => __('Days left', 'job-listings'),
'periodEnded' => __('The application period has ended', 'job-listings'),
$lang = [
'applyNow' => __('Apply now', 'job-listings'),
'applyHere' => __('Apply here', 'job-listings'),
'contact' => __('Contact', 'job-listings'),
'information' => __('Information', 'job-listings'),
'login' => __('Log in', 'job-listings'),
'daysLeft' => __('Days left', 'job-listings'),
'periodEnded' => __('The application period has ended', 'job-listings')
];

$data['lang'] = isset($data['lang']) && is_object($data['lang']) ? (object) array_merge((array) $data['lang'], $lang) : (object) $lang;

return $data;
}

Expand Down

0 comments on commit 01e227d

Please sign in to comment.