<commit_before><?php

namespace ForkCMS\Core\Domain\Application;

use ForkCMS\Modules\Internationalisation\Domain\Translation\TranslationKey;
use Symfony\Contracts\Translation\TranslatableInterface;
use Symfony\Contracts\Translation\TranslatorInterface;

enum Application: string implements TranslatableInterface
{
    case BACKEND = 'backend';
    case FRONTEND = 'frontend';
    case CONSOLE = 'console';
    case API = 'api';

    public function trans(TranslatorInterface $translator, string $locale = null): string
    {
        return $translator->trans('lbl.Application' . ucfirst($this->value), locale: $locale);
    }

    public function canHaveTranslations(): bool
    {
        return match ($this) {
            self::BACKEND, self::FRONTEND => true,
            default => false,
        };
    }
}<commit_msg>Allow adding translations for console commands<commit_after><?php

namespace ForkCMS\Core\Domain\Application;

use ForkCMS\Modules\Internationalisation\Domain\Translation\TranslationKey;
use Symfony\Contracts\Translation\TranslatableInterface;
use Symfony\Contracts\Translation\TranslatorInterface;

enum Application: string implements TranslatableInterface
{
    case BACKEND = 'backend';
    case FRONTEND = 'frontend';
    case CONSOLE = 'console';
    case API = 'api';

    public function trans(TranslatorInterface $translator, string $locale = null): string
    {
        return $translator->trans('lbl.Application' . ucfirst($this->value), locale: $locale);
    }

    public function canHaveTranslations(): bool
    {
        return match ($this) {
            self::BACKEND, self::FRONTEND, self::CONSOLE => true,
            default => false,
        };
    }
}
{'fraction_non_alphanumeric': 0.10908018867924528, 'fraction_numerical': 0.0, 'mean_word_length': 3.700831024930748, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1204652', 'n_tokens_mistral': 479, 'n_tokens_neox': 468, 'n_words': 108}