Make provider display name translatable
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
Родитель
fbbfa4844f
Коммит
0e149a0b46
|
@ -49,7 +49,7 @@ class U2FProvider implements IProvider, IProvidesIcons, IProvidesPersonalSetting
|
|||
* Get the display name for selecting the 2FA provider
|
||||
*/
|
||||
public function getDisplayName(): string {
|
||||
return 'U2F device';
|
||||
return $this->l10n->t('U2F device');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -46,7 +46,14 @@ class U2FProviderTest extends TestCase {
|
|||
}
|
||||
|
||||
public function testGetDisplayName() {
|
||||
$this->assertSame('U2F device', $this->provider->getDisplayName());
|
||||
$this->l10n->expects($this->once())
|
||||
->method('t')
|
||||
->with('U2F device')
|
||||
->willReturn('translated');
|
||||
|
||||
$displayName = $this->provider->getDisplayName();
|
||||
|
||||
$this->assertSame('translated', $displayName);
|
||||
}
|
||||
|
||||
public function testGetDescription() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче