Skip to content

Commit 6486839

Browse files
Alexwijnandywer
authored andcommitted
Added support for JSON translations (#66)
1 parent 1e8e817 commit 6486839

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Caching/MessageCachingService.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ protected function getTranslatedMessages(array $messageKeys, $locale)
122122
$translatedMessages = [];
123123

124124
foreach ($messageKeys as $key) {
125-
$translation = Lang::get($key, [], $locale);
125+
$translation = __($key, [], $locale);
126126

127127
if (is_array($translation)) {
128128
$flattened = $this->flattenTranslations($translation, $key.'.');

tests/TestCase.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ protected function mockLang($locale = "en")
8080
$lang->shouldReceive('locale')->andReturn($locale);
8181

8282
foreach ($this->testMessages[$locale] as $key=>$message) {
83-
$lang->shouldReceive('get')
83+
$lang->shouldReceive('getFromJson')
8484
->with($key)->andReturn($message);
85-
$lang->shouldReceive('get')
85+
$lang->shouldReceive('getFromJson')
8686
->with($key, m::any(), $locale)->andReturn($message);
8787
}
8888
}

0 commit comments

Comments
 (0)