diff --git a/composer.json b/composer.json index d218b86..36882ce 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,8 @@ }, "extra": { "expose": [ - "client/dist" + "client/dist", + "client/lang" ] }, "minimum-stability": "dev", diff --git a/src/Method.php b/src/Method.php index 2989b56..af78f7c 100644 --- a/src/Method.php +++ b/src/Method.php @@ -74,6 +74,7 @@ public function getThumbnail(): string */ public function applyRequirements(): void { + Requirements::add_i18n_javascript('silverstripe/webauthn-authenticator: client/lang'); Requirements::javascript('silverstripe/webauthn-authenticator: client/dist/js/bundle.js'); Requirements::css('silverstripe/webauthn-authenticator: client/dist/styles/bundle.css'); } diff --git a/tests/MethodTest.php b/tests/MethodTest.php index 4c6a871..962bc60 100644 --- a/tests/MethodTest.php +++ b/tests/MethodTest.php @@ -42,7 +42,7 @@ public function testApplyRequirements() $method = new Method(); $method->applyRequirements(); - $this->assertCount(1, Requirements::backend()->getJavascript()); + $this->assertcount(2, Requirements::backend()->getJavascript()); $this->assertCount(1, Requirements::backend()->getCSS()); }