Skip to content

Commit 9796ce3

Browse files
authored
fix (#99)
1 parent cea48ff commit 9796ce3

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/Translator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ public function translate(
331331
$translated = $this->trans($message, $params, $domain, $locale);
332332

333333
if ($this->returnOriginalMessage) {
334-
if (!$this->getCatalogue()->has($message, $domain)) {
334+
if (!$this->getCatalogue($locale)->has($message, $domain)) {
335335
return $originalMessage;
336336
}
337337
}

tests/Tests/TranslatorTest.phpt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,10 @@ final class TranslatorTest extends TestAbstract
213213
Assert::same('It\'s a boy!', $translator->translate('baby_gender', ['gender' => 'boy']));
214214
Assert::same('It\'s a girl!', $translator->translate('baby_gender', ['gender' => 'girl']));
215215
Assert::same('It\'s something else!', $translator->translate('baby_gender', ['gender' => 'kibork']));
216+
217+
$translator->setLocale('en_US');
218+
219+
Assert::same('Přelož', $translator->translate('keyOnlyInCsCz', null, [], 'messages', 'cs_CZ'));
216220
}
217221

218222
public function test03(): void

tests/lang/messages.cs_CZ.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
plural: "Kontakt|Kontakty|Hodně kontaktů"
2+
keyOnlyInCsCz: "Přelož"

0 commit comments

Comments
 (0)