Skip to content

Commit 3fff877

Browse files
committed
Fix bug
1 parent dac82d0 commit 3fff877

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/Sign.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,12 @@ public function localize(?string $locale = null): SignInterface
154154

155155
$translatedName = $this->translator()->get($key, locale: $locale);
156156

157-
if (is_string($translatedName)) {
158-
$this->name = $translatedName;
157+
if (!is_string($translatedName)) {
158+
throw new LocalizationException('No translation for "' . $key . '" in locale "' . $locale . '"');
159159
}
160160

161+
$this->name = $translatedName;
162+
161163
return $this;
162164
}
163165

0 commit comments

Comments
 (0)