19 lines
453 B
PHP
19 lines
453 B
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace App\Services\ProjectTranslationService;
|
|
|
|
use Illuminate\Support\Str;
|
|
|
|
final readonly class NoTranslateAttributeHandler
|
|
{
|
|
public function handleAddAttribute(string $text): string
|
|
{
|
|
return Str::replace('<code', '<code translate="no"', $text);
|
|
}
|
|
|
|
public function handleRemoveAttribute(string $text): string
|
|
{
|
|
return Str::replace('<code translate="no"', '<code', $text);
|
|
}
|
|
}
|