<?php

namespace App\Support;

class I18n
{
    /**
     * Translate the string values of an options array (key stays as DB enum).
     * Usage: ->options(I18n::opts(Model::STATUSES))
     */
    public static function opts(array $options): array
    {
        return array_map(fn ($v) => is_string($v) ? __($v) : $v, $options);
    }
}
