Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7c54eb6

Browse files
authored
Revert "fallback to fallback_locale translation when requested translation line is empty (#34136)" (#34228)
This reverts commit02e983e.
1 parent36db948 commit7c54eb6

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

‎src/Illuminate/Translation/Translator.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public function get($key, array $replace = [], $locale = null, $fallback = true)
122122
$locales =$fallback ?$this->localeArray($locale) : [$locale];
123123

124124
foreach ($localesas$locale) {
125-
if (!empty($line =$this->getLine(
125+
if (!is_null($line =$this->getLine(
126126
$namespace,$group,$locale,$item,$replace
127127
))) {
128128
return$line ??$key;

‎tests/Translation/TranslationTranslatorTest.php‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,6 @@ public function testGetMethodProperlyLoadsAndRetrievesItemForFallback()
104104
$this->assertSame('foo',$t->get('foo::bar.foo'));
105105
}
106106

107-
publicfunctiontestGetMethodProperlyLoadsAndRetrievesItemForFallbackWhenLineIsEmpty()
108-
{
109-
$t =newTranslator($this->getLoader(),'en');
110-
$t->setFallback('lv');
111-
$t->getLoader()->shouldReceive('load')->once()->with('en','*','*')->andReturn([]);
112-
$t->getLoader()->shouldReceive('load')->once()->with('en','bar','foo')->andReturn(['baz' =>'']);
113-
$t->getLoader()->shouldReceive('load')->once()->with('lv','bar','foo')->andReturn(['foo' =>'foo','baz' =>'breeze :foo']);
114-
$this->assertSame('breeze bar',$t->get('foo::bar.baz', ['foo' =>'bar'],'en'));
115-
$this->assertSame('foo',$t->get('foo::bar.foo'));
116-
}
117-
118107
publicfunctiontestGetMethodProperlyLoadsAndRetrievesItemForGlobalNamespace()
119108
{
120109
$t =newTranslator($this->getLoader(),'en');

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp