laravel设置中文语言包,修改自带的时间区域

laravel默认的是英文提示,这就会造成即使我们自己写了提示,但是有些系统自带的提示依然是英文的,这就需要我们将系统提示转换成中文的
首先,现在下lang语言包

composer require caouecs/laravel-lang

这里用composer下载的,后面不用加版本号,以确保我们下载的是最新版
然后再将vendor\caouecs\laravel-lang\src\zh-CN文件复制到resources\lang
最后修改cofig里面的app.php修改完就可以使用了

/*
    |--------------------------------------------------------------------------
    | Application Locale Configuration
    |--------------------------------------------------------------------------
    |
    | The application locale determines the default locale that will be used
    | by the translation service provider. You are free to set this value
    | to any of the locales which will be supported by the application.
    |
    */

    //'locale' => 'en',
    'locale' => 'zh-CN',

修改时区【cofig里面的app.php】,laravel默认的是UTC
在国际无线电通信中,为统一而普遍使用一个标准时间,称为通用协调时(UTC, Universal Time Coordinated)。UTC与格林尼治平均时(GMT, Greenwich Mean Time)一样,都与英国伦敦的本地时相同。UTC与GMT含义完全相同。

/*
    |--------------------------------------------------------------------------
    | Application Timezone
    |--------------------------------------------------------------------------
    |
    | Here you may specify the default timezone for your application, which
    | will be used by the PHP date and date-time functions. We have gone
    | ahead and set this to a sensible default for you out of the box.
    |
    */

    //'timezone' => 'UTC',
    'timezone' => 'PRC',

PRC (Primary Reference Clock) 基准参考时钟(主参考时钟)我国的数字同步网采用主从同步方式,即北京建立基准时钟(PRC),武汉建立备用基准时钟(P在全国各大城市设立若干从时钟,并在长途交换中心设立大楼综合定时系统(BITS)
所以使用PRC就是我们国家的时间标准。
好了教程到此结束,愿大家的技术越来越好!

猜你喜欢

转载自blog.csdn.net/lo6064200/article/details/104710313