Browse Source

语言包路径

XuTongle 3 years ago
parent
commit
42e10b1852
3 changed files with 5 additions and 4 deletions
  1. 1 0
      README.md
  2. 1 1
      src/AdminServiceProvider.php
  3. 3 3
      tests/Feature/InstallTest.php

+ 1 - 0
README.md

@@ -26,6 +26,7 @@
 - [Demo / 在线演示](http://103.39.211.179:8080/admin)
 - [Demo源码](https://github.com/jqhph/dcat-admin-demo)
 - [Demo源码 (码云)](https://gitee.com/jqhph/dcat-admin-demo)
+- [扩展](#)
 
 
 ![](https://cdn.learnku.com/uploads/images/202101/28/38389/YLmL7PLqH7.png!large)

+ 1 - 1
src/AdminServiceProvider.php

@@ -169,7 +169,7 @@ class AdminServiceProvider extends ServiceProvider
     {
         if ($this->app->runningInConsole()) {
             $this->publishes([__DIR__.'/../config' => config_path()], 'dcat-admin-config');
-            $this->publishes([__DIR__.'/../resources/lang' => lang_path()], 'dcat-admin-lang');
+            $this->publishes([__DIR__.'/../resources/lang' => $this->app->langPath()], 'dcat-admin-lang');
             $this->publishes([__DIR__.'/../database/migrations' => database_path('migrations')], 'dcat-admin-migrations');
             $this->publishes([__DIR__.'/../resources/dist' => public_path(Admin::asset()->getRealPath('@admin'))], 'dcat-admin-assets');
         }

+ 3 - 3
tests/Feature/InstallTest.php

@@ -31,8 +31,8 @@ class InstallTest extends TestCase
         $this->assertFileExists(config_path('admin.php'));
         $this->assertFileExists(public_path(Admin::asset()->getRealPath('@admin')));
         $this->assertFileExists(database_path('migrations/2016_01_04_173148_create_admin_tables.php'));
-        $this->assertFileExists(lang_path('en/admin.php'));
-        $this->assertFileExists(lang_path('zh_CN/admin.php'));
-        $this->assertFileExists(lang_path('zh_CN/global.php'));
+        $this->assertFileExists(app()->langPath().'en/admin.php');
+        $this->assertFileExists(app()->langPath().'zh_CN/admin.php');
+        $this->assertFileExists(app()->langPath().'zh_CN/global.php');
     }
 }