Skip to content

Commit ff102e3

Browse files
committed
fix an issue with creating package files
1 parent 92959aa commit ff102e3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Commands/TransCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ private function filesFromKey()
144144
return $this->manager->files()[$this->fileName];
145145
} catch (\ErrorException $e) {
146146
if ($this->confirm(sprintf('Language file %s.php not found, would you like to create it?', $this->fileName))) {
147-
$this->manager->createFile($this->fileName);
147+
$this->manager->createFile(str_replace($this->packageName.'::', '', $this->fileName));
148148
}
149149

150150
return [];

tests/TransCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function testCommandAsksForConfirmationToCreatePackageFileIfNotFound()
4747
$this->app['artisan']->add($command);
4848
$this->artisan('langman:trans', ['key' => 'package::file.name']);
4949

50-
$this->assertFileNotExists($this->app['config']['langman.path'].'/vendor/package/en/file.php');
50+
$this->assertFileExists($this->app['config']['langman.path'].'/vendor/package/en/file.php');
5151
}
5252

5353
public function testCommandExitsWhenFileNotFoundAndConfirmationFalse()

0 commit comments

Comments
 (0)