Sort collection by translated value from category map

This is the code snippet:

In my snippet:

<?php $categories = $groups->groupBy('category');
    foreach($categories as $category => $items): ?>

<h1><?php echo $categoryName[trim($category)]; ?></h1>
// Rest of the loop...

In my template:

<?php $categoryName = c::get('job_category_name'); ?>

In the config.php

c::set('job_category_name', [
  'option1' => 'Some title 1',
  'option2' => 'Some title 2',
  'option3' => 'Some title 3'
]);