diff --git a/README.md b/README.md index 48e781f..3aab309 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@

Laravel Langman

+ +

+This is a fork of https://github.com/themsaid/laravel-langman and its needed in my project, but because of its not maintained any more and after I pulled request to fix an issue I re-namespace this package to use it in my projects +

Langman is a language files manager in your artisan console, it helps you search, update, add, and remove translation lines with ease. Taking care of a multilingual interface is not a headache anymore. @@ -27,14 +31,14 @@ $ composer require themsaid/laravel-langman Once done, add the following line in your providers array of `config/app.php`: ```php -Themsaid\Langman\LangmanServiceProvider::class +Muathye\Themsaid\Langman\LangmanServiceProvider::class ``` This package has a single configuration option that points to the `resources/lang` directory, if only you need to change the path then publish the config file: ``` -php artisan vendor:publish --provider="Themsaid\Langman\LangmanServiceProvider" +php artisan vendor:publish --provider="Muathye\Themsaid\Langman\LangmanServiceProvider" ``` ## Usage diff --git a/composer.json b/composer.json index 580cfe6..772f043 100644 --- a/composer.json +++ b/composer.json @@ -1,14 +1,18 @@ { - "name": "themsaid/laravel-langman", + "name": "muath-ye/laravel-langman", "description": "Manage language files with ease.", "keywords": ["laravel", "localization", "multilingual"], - "homepage": "https://github.com/themsaid/laravel-langman", + "homepage": "https://github.com/muath-ye/laravel-langman", "license": "MIT", "authors": [ { "name": "Mohamed Said", "email": "theMohamedSaid@gmail.com", "homepage": "https://themsaid.github.io" + }, + { + "name": "Muath Assawadi", + "homepage": "https://muath-ye.github.io" } ], "require": { @@ -25,7 +29,7 @@ }, "autoload": { "psr-4": { - "Themsaid\\Langman\\": "src" + "Muathye\\Themsaid\\Langman\\": "src" }, "classmap": [ "tests" @@ -34,7 +38,7 @@ "extra": { "laravel": { "providers": [ - "Themsaid\\Langman\\LangmanServiceProvider" + "Muathye\\Themsaid\\Langman\\LangmanServiceProvider" ] } } diff --git a/src/Commands/FindCommand.php b/src/Commands/FindCommand.php index 73cad05..fb2b7f5 100644 --- a/src/Commands/FindCommand.php +++ b/src/Commands/FindCommand.php @@ -1,10 +1,10 @@ commands([ - \Themsaid\Langman\Commands\MissingCommand::class, - \Themsaid\Langman\Commands\RemoveCommand::class, - \Themsaid\Langman\Commands\TransCommand::class, - \Themsaid\Langman\Commands\ShowCommand::class, - \Themsaid\Langman\Commands\FindCommand::class, - \Themsaid\Langman\Commands\SyncCommand::class, - \Themsaid\Langman\Commands\RenameCommand::class, + \Muathye\Themsaid\Langman\Commands\MissingCommand::class, + \Muathye\Themsaid\Langman\Commands\RemoveCommand::class, + \Muathye\Themsaid\Langman\Commands\TransCommand::class, + \Muathye\Themsaid\Langman\Commands\ShowCommand::class, + \Muathye\Themsaid\Langman\Commands\FindCommand::class, + \Muathye\Themsaid\Langman\Commands\SyncCommand::class, + \Muathye\Themsaid\Langman\Commands\RenameCommand::class, ]); } } diff --git a/src/Manager.php b/src/Manager.php index 4ff5824..9cdd736 100644 --- a/src/Manager.php +++ b/src/Manager.php @@ -1,6 +1,6 @@ app[\Themsaid\Langman\Manager::class]; + $manager = $this->app[\Muathye\Themsaid\Langman\Manager::class]; $this->createTempFiles([ 'en' => ['user' => '', 'category' => ''], @@ -40,7 +40,7 @@ public function testFilesMethod() public function testLanguagesMethod() { - $manager = $this->app[\Themsaid\Langman\Manager::class]; + $manager = $this->app[\Muathye\Themsaid\Langman\Manager::class]; $this->createTempFiles([ 'en' => [], @@ -53,7 +53,7 @@ public function testLanguagesMethod() public function testCreateFileIfNotExisting() { - $manager = $this->app[\Themsaid\Langman\Manager::class]; + $manager = $this->app[\Muathye\Themsaid\Langman\Manager::class]; $this->createTempFiles([ 'en' => [], @@ -71,7 +71,7 @@ public function testCreateFileIfNotExisting() public function testWriteFile() { - $manager = $this->app[\Themsaid\Langman\Manager::class]; + $manager = $this->app[\Muathye\Themsaid\Langman\Manager::class]; $this->createTempFiles([ 'en' => ['users' => ''], @@ -94,7 +94,7 @@ public function testWriteFile() public function testGetFileContentReadsContent() { - $manager = $this->app[\Themsaid\Langman\Manager::class]; + $manager = $this->app[\Muathye\Themsaid\Langman\Manager::class]; $this->createTempFiles([ 'en' => ['users' => "app[\Themsaid\Langman\Manager::class]; + $manager = $this->app[\Muathye\Themsaid\Langman\Manager::class]; $this->createTempFiles(); @@ -121,7 +121,7 @@ public function testGetFileContentThrowsExceptionIfNotFound() public function testGetFileContentCreatesFileIfNeeded() { - $manager = $this->app[\Themsaid\Langman\Manager::class]; + $manager = $this->app[\Muathye\Themsaid\Langman\Manager::class]; $this->createTempFiles(); @@ -134,7 +134,7 @@ public function testGetFileContentCreatesFileIfNeeded() public function testRemoveTranslationLineFromAllFiles() { - $manager = $this->app[\Themsaid\Langman\Manager::class]; + $manager = $this->app[\Muathye\Themsaid\Langman\Manager::class]; $this->createTempFiles([ 'en' => ['users' => " 'a', 'age' => 'b'];"], @@ -154,7 +154,7 @@ public function testRemoveTranslationLineFromAllFiles() public function testRemoveNestedTranslationLineFromAllFiles() { - $manager = $this->app[\Themsaid\Langman\Manager::class]; + $manager = $this->app[\Muathye\Themsaid\Langman\Manager::class]; $this->createTempFiles([ 'en' => ['users' => " ['f' => '1', 's' => 2], 'age' => 'b'];"], @@ -176,7 +176,7 @@ public function testRemoveNestedTranslationLineFromAllFiles() public function testFillTranslationLinesThatDoesNotExistYet() { - $manager = $this->app[\Themsaid\Langman\Manager::class]; + $manager = $this->app[\Muathye\Themsaid\Langman\Manager::class]; $this->createTempFiles([ 'en' => ['users' => 'app[\Themsaid\Langman\Manager::class]; + $manager = $this->app[\Muathye\Themsaid\Langman\Manager::class]; $this->createTempFiles([ 'en' => ['users' => " 'nil'];"], @@ -209,7 +209,7 @@ public function testUpdatesTranslationLineThatExists() public function testFillNestedTranslationLines() { - $manager = $this->app[\Themsaid\Langman\Manager::class]; + $manager = $this->app[\Muathye\Themsaid\Langman\Manager::class]; $this->createTempFiles([ 'en' => ['users' => ' "class"];'], @@ -228,7 +228,7 @@ public function testFillNestedTranslationLines() public function testFindTranslationsInProjectFiles() { - $manager = $this->app[\Themsaid\Langman\Manager::class]; + $manager = $this->app[\Muathye\Themsaid\Langman\Manager::class]; array_map('unlink', glob(__DIR__.'/views_temp/users/index.blade.php')); array_map('rmdir', glob(__DIR__.'/views_temp/users')); @@ -252,7 +252,7 @@ public function testFindTranslationsInProjectFiles() public function testGetKeysExistingInALanguageButNotTheOther() { - $manager = m::mock('Themsaid\Langman\Manager[languages]', [new Filesystem(), '', []]); + $manager = m::mock('Muathye\Themsaid\Langman\Manager[languages]', [new Filesystem(), '', []]); $manager->shouldReceive('languages')->andReturn(['en', 'nl']); diff --git a/tests/MissingCommandTest.php b/tests/MissingCommandTest.php index 389d62f..88579a2 100644 --- a/tests/MissingCommandTest.php +++ b/tests/MissingCommandTest.php @@ -1,6 +1,6 @@ shouldReceive('ask')->once()->with('/user\.age:nl/', null)->andReturn('fill_age'); $command->shouldReceive('ask')->once()->with('/product\.name:en/', null)->andReturn('fill_name'); $command->shouldReceive('ask')->once()->with('/product\.color:nl/', null)->andReturn('fill_color'); @@ -63,7 +63,7 @@ public function testAllowSeeTranslationInDefaultLanguage() ], ]); - $command = m::mock('\Themsaid\Langman\Commands\MissingCommand[ask]', [$manager]); + $command = m::mock('\Muathye\Themsaid\Langman\Commands\MissingCommand[ask]', [$manager]); $command->shouldReceive('ask')->once()->with('/user\.age:nl<\/> translation/', '/en:Age/'); $this->app['artisan']->add($command); @@ -86,7 +86,7 @@ public function testShowsNoDefaultWhenDefaultLanguageFileIsNotFound() ], ]); - $command = m::mock('\Themsaid\Langman\Commands\MissingCommand[ask]', [$manager]); + $command = m::mock('\Muathye\Themsaid\Langman\Commands\MissingCommand[ask]', [$manager]); $command->shouldReceive('ask')->once()->with('/user\.age:nl<\/> translation/', null); $this->app['artisan']->add($command); diff --git a/tests/RemoveCommandTest.php b/tests/RemoveCommandTest.php index 1f845a5..2bd39ea 100644 --- a/tests/RemoveCommandTest.php +++ b/tests/RemoveCommandTest.php @@ -1,6 +1,6 @@ shouldReceive('confirm')->once()->with('Are you sure you want to remove "user.name"?')->andReturn(true); $this->app['artisan']->add($command); @@ -44,7 +44,7 @@ public function testRemovesNestedKeys() ], ]); - $command = m::mock('\Themsaid\Langman\Commands\RemoveCommand[confirm]', [$manager]); + $command = m::mock('\Muathye\Themsaid\Langman\Commands\RemoveCommand[confirm]', [$manager]); $command->shouldReceive('confirm')->once()->andReturn(true); $this->app['artisan']->add($command); @@ -72,7 +72,7 @@ public function testRemovesParentOfNestedKeys() ], ]); - $command = m::mock('\Themsaid\Langman\Commands\RemoveCommand[confirm]', [$manager]); + $command = m::mock('\Muathye\Themsaid\Langman\Commands\RemoveCommand[confirm]', [$manager]); $command->shouldReceive('confirm')->once()->andReturn(true); $this->app['artisan']->add($command); @@ -95,7 +95,7 @@ public function testCommandOutputForVendorPackage() 'vendor' => ['package' => ['en' => ['file' => " 'file not found here'];"], 'sp' => ['file' => " 'something'];"]]], ]); - $command = m::mock('\Themsaid\Langman\Commands\RemoveCommand[confirm]', [$manager]); + $command = m::mock('\Muathye\Themsaid\Langman\Commands\RemoveCommand[confirm]', [$manager]); $command->shouldReceive('confirm')->once()->with('Are you sure you want to remove "package::file.not_found"?')->andReturn(true); $this->app['artisan']->add($command); diff --git a/tests/RenameCommandTest.php b/tests/RenameCommandTest.php index 2e2fd32..4dc0f17 100644 --- a/tests/RenameCommandTest.php +++ b/tests/RenameCommandTest.php @@ -71,7 +71,7 @@ public function testRenameOfANestedKeyValueForAllLanguagesInAnyDepth() public function testRenameCommandShowViewFilesAffectedForTheChange() { - $manager = $this->app[\Themsaid\Langman\Manager::class]; + $manager = $this->app[\Muathye\Themsaid\Langman\Manager::class]; $this->createTempFiles([ 'en' => ['users' => " 'Name'];"], diff --git a/tests/TestCase.php b/tests/TestCase.php index 9e94e0b..a794bc5 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -6,7 +6,7 @@ abstract class TestCase extends Orchestra\Testbench\TestCase protected function getPackageProviders($app) { - return [\Themsaid\Langman\LangmanServiceProvider::class]; + return [\Muathye\Themsaid\Langman\LangmanServiceProvider::class]; } protected function getEnvironmentSetUp($app) diff --git a/tests/TransCommandTest.php b/tests/TransCommandTest.php index 0704dfb..658cfda 100644 --- a/tests/TransCommandTest.php +++ b/tests/TransCommandTest.php @@ -1,7 +1,7 @@ createTempFiles(); $manager = $this->app[Manager::class]; - $command = m::mock('\Themsaid\Langman\Commands\TransCommand[confirm]', [$manager]); + $command = m::mock('\Muathye\Themsaid\Langman\Commands\TransCommand[confirm]', [$manager]); $command->shouldReceive('confirm')->once()->andReturn(false); $this->app['artisan']->add($command); @@ -41,7 +41,7 @@ public function testCommandAsksForConfirmationToCreatePackageFileIfNotFound() ]); $manager = $this->app[Manager::class]; - $command = m::mock('\Themsaid\Langman\Commands\TransCommand[confirm]', [$manager]); + $command = m::mock('\Muathye\Themsaid\Langman\Commands\TransCommand[confirm]', [$manager]); $command->shouldReceive('confirm')->once()->andReturn(true); $this->app['artisan']->add($command); @@ -55,7 +55,7 @@ public function testCommandExitsWhenFileNotFoundAndConfirmationFalse() $this->createTempFiles(['en' => []]); $manager = $this->app[Manager::class]; - $command = m::mock('\Themsaid\Langman\Commands\TransCommand[confirm]', [$manager]); + $command = m::mock('\Muathye\Themsaid\Langman\Commands\TransCommand[confirm]', [$manager]); $command->shouldReceive('confirm')->once()->andReturn(false); $this->app['artisan']->add($command); @@ -69,7 +69,7 @@ public function testCommandCreatesFileIfNotFoundWhenConfirmed() $this->createTempFiles(['en' => []]); $manager = $this->app[Manager::class]; - $command = m::mock('\Themsaid\Langman\Commands\TransCommand[confirm]', [$manager]); + $command = m::mock('\Muathye\Themsaid\Langman\Commands\TransCommand[confirm]', [$manager]); $command->shouldReceive('confirm')->once()->andReturn(true); $this->app['artisan']->add($command); @@ -86,7 +86,7 @@ public function testCommandAsksForValuePerLanguageAndWriteToFile() ]); $manager = $this->app[Manager::class]; - $command = m::mock('\Themsaid\Langman\Commands\TransCommand[ask]', [$manager]); + $command = m::mock('\Muathye\Themsaid\Langman\Commands\TransCommand[ask]', [$manager]); $command->shouldReceive('confirm')->never(); $command->shouldReceive('ask')->once()->with('/users\.name:en/', null)->andReturn('name'); $command->shouldReceive('ask')->once()->with('/users\.name:nl/', null)->andReturn('naam'); @@ -107,7 +107,7 @@ public function testCommandAsksForValuePerLanguageForPackageAndWriteToFile() ]); $manager = $this->app[Manager::class]; - $command = m::mock('\Themsaid\Langman\Commands\TransCommand[ask]', [$manager]); + $command = m::mock('\Muathye\Themsaid\Langman\Commands\TransCommand[ask]', [$manager]); $command->shouldReceive('ask')->once()->with('/users\.name:en/', null)->andReturn('name'); $command->shouldReceive('ask')->once()->with('/users\.name:sp/', null)->andReturn('naam'); @@ -128,7 +128,7 @@ public function testCommandAsksForValuePerLanguageAndUpdatingExistingInFile() ]); $manager = $this->app[Manager::class]; - $command = m::mock('\Themsaid\Langman\Commands\TransCommand[ask]', [$manager]); + $command = m::mock('\Muathye\Themsaid\Langman\Commands\TransCommand[ask]', [$manager]); $command->shouldReceive('confirm')->never(); $command->shouldReceive('ask')->once()->with('/users\.name:en/', 'nil')->andReturn('name'); $command->shouldReceive('ask')->once()->with('/users\.name:nl/', '')->andReturn('naam'); @@ -150,7 +150,7 @@ public function testCommandAsksForValueForOnlyProvidedLanguage() ]); $manager = $this->app[Manager::class]; - $command = m::mock('\Themsaid\Langman\Commands\TransCommand[ask]', [$manager]); + $command = m::mock('\Muathye\Themsaid\Langman\Commands\TransCommand[ask]', [$manager]); $command->shouldReceive('confirm')->never(); $command->shouldReceive('ask')->once()->with('/users\.name:en/', null)->andReturn('name'); @@ -169,7 +169,7 @@ public function testCommandAsksForValuePerLanguageForNestedKeysAndWriteFile() ]); $manager = $this->app[Manager::class]; - $command = m::mock('\Themsaid\Langman\Commands\TransCommand[ask]', [$manager]); + $command = m::mock('\Muathye\Themsaid\Langman\Commands\TransCommand[ask]', [$manager]); $command->shouldReceive('confirm')->never(); $command->shouldReceive('ask')->once()->with('/users\.name\.first:en/', null)->andReturn('name'); $command->shouldReceive('ask')->once()->with('/users\.name\.first:nl/', null)->andReturn('naam'); @@ -191,7 +191,7 @@ public function testCommandAsksForLanguageForNestedKeysAndWriteFile() ]); $manager = $this->app[Manager::class]; - $command = m::mock('\Themsaid\Langman\Commands\TransCommand[ask]', [$manager]); + $command = m::mock('\Muathye\Themsaid\Langman\Commands\TransCommand[ask]', [$manager]); $command->shouldReceive('confirm')->never(); $command->shouldReceive('ask')->once()->with('/users\.name\.first:en/', null)->andReturn('name');