-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTranslator.php
More file actions
47 lines (40 loc) · 1.11 KB
/
Translator.php
File metadata and controls
47 lines (40 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
declare(strict_types=1);
namespace ArrayAccess\TrayDigita\App\Modules\Core\SubModules\Translator;
use ArrayAccess\TrayDigita\App\Modules\Core\Abstracts\CoreSubmoduleAbstract;
use function trim;
class Translator extends CoreSubmoduleAbstract
{
protected string $name = 'Extended Translator';
public function getName(): string
{
return $this->translateContext(
'Extended Translator',
'module-info',
'core-module'
);
}
public function getDescription(): string
{
return $this->translateContext(
'Core module to support translation',
'module-info',
'core-module'
);
}
/**
* Register translation directory
*
* @param string $textDomain
* @param string ...$directory
* @return bool
*/
public function registerDomain(string $textDomain, string ...$directory): bool
{
// filter
if (trim($textDomain) === '') {
return false;
}
return $this->getTranslator()?->registerDirectory($textDomain, ...$directory);
}
}