Skip to content

Commit

Permalink
add translation function for dropdown labels
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanremy committed Jun 26, 2020
1 parent 2ca2f3f commit 063ad57
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/GenerateAdminProfile.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Brackets\AdminGenerator;
<?php

namespace Brackets\AdminGenerator;

use Brackets\AdminGenerator\Generate\Traits\FileManipulations;
use Illuminate\Console\Command;
Expand Down Expand Up @@ -92,18 +94,19 @@ public function handle()
resource_path('views/admin/layout/profile-dropdown.blade.php'),
'|url\(\'admin\/profile\'\)|',
'{{-- Do not delete me :) I\'m used for auto-generation menu items --}}',
'<a href="{{ url(\'admin/profile\') }}" class="dropdown-item"><i class="fa fa-user"></i> Profile</a>
{{-- Do not delete me :) I\'m used for auto-generation menu items --}}');
'<a href="{{ url(\'admin/profile\') }}" class="dropdown-item"><i class="fa fa-user"></i> {{ trans(\'brackets/admin-auth::admin.profile_dropdown.profile\') }}</a>
{{-- Do not delete me :) I\'m used for auto-generation menu items --}}'
);

$this->strReplaceInFile(
resource_path('views/admin/layout/profile-dropdown.blade.php'),
'|url\(\'admin\/password\'\)|',
'{{-- Do not delete me :) I\'m used for auto-generation menu items --}}',
'<a href="{{ url(\'admin/password\') }}" class="dropdown-item"><i class="fa fa-key"></i> Password</a>
{{-- Do not delete me :) I\'m used for auto-generation menu items --}}');
'<a href="{{ url(\'admin/password\') }}" class="dropdown-item"><i class="fa fa-key"></i> {{ trans(\'brackets/admin-auth::admin.profile_dropdown.password\') }}</a>
{{-- Do not delete me :) I\'m used for auto-generation menu items --}}'
);

$this->info('Generating whole admin "My Profile" finished');

}

protected function getArguments()
Expand All @@ -121,5 +124,4 @@ protected function getOptions()
['force', 'f', InputOption::VALUE_NONE, 'Force will delete files before regenerating admin profile'],
];
}

}
}

0 comments on commit 063ad57

Please sign in to comment.