75 languages support for Laravel 5 application based on Laravel-Lang/lang.

Overview

Laravel-lang

75 languages support for Laravel 5 application based on Laravel-Lang/lang.

For Laravel 5 For Lumen 5 Latest Stable Version Latest Unstable Version Total Downloads License

Features

  • Laravel 5+ && Lumen support.
  • Translations Publisher.
  • Made with 💖 .

Sponsor me

Install

Laravel version Composer command
Laravel 7.x-8.x composer require overtrue/laravel-lang:~5.0
Laravel 6.x composer require overtrue/laravel-lang:~4.0
Laravel 5.8 composer require overtrue/laravel-lang:~3.0
Laravel 5.1-5.7 composer require overtrue/laravel-lang:~2.0
Laravel 5 composer require overtrue/laravel-lang:~1.0
$ composer require "overtrue/laravel-lang:~5.0"

Lumen

Add the following line to bootstrap/app.php:

$app->register(Overtrue\LaravelLang\TranslationServiceProvider::class);

Configuration

Laravel

you can change the locale at config/app.php:

'locale' => 'zh_CN',

Lumen

set locale in .env file:

APP_LOCALE=zh_CN

Usage

There is no difference with the usual usage.

If you need to add additional language content, Please create a file in the resources/lang/{LANGUAGE} directory.

Add custom language items

Here, for example in Chinese:

resources/lang/zh_CN/demo.php:



return [
    'user_not_exists'    => '用户不存在',
    'email_has_registed' => '邮箱 :email 已经注册过!',
];

Used in the template:

echo trans('demo.user_not_exists'); // 用户不存在
echo trans('demo.email_has_registed', ['email' => '[email protected]']);
// 邮箱 [email protected] 已经注册过!

Replace the default language items partially

We assume that want to replace the password.reset message:

resources/lang/zh_CN/passwords.php:



return [
    'reset' => '您的密码已经重置成功了,你可以使用新的密码登录了!',
];

You need only add the partials item what you want.

publish the language files to your project resources/lang/ directory:

$ php artisan lang:publish [LOCALES] {--force}

examples:

$ php artisan lang:publish zh_CN,zh_HK,th,tk

❤️ Sponsor me

Sponsor me

如果你喜欢我的项目并想支持它,点击这里 ❤️

Project supported by JetBrains

Many thanks to Jetbrains for kindly providing a license for me to work on this and other open-source projects.

PHP 扩展包开发

想知道如何从零开始构建 PHP 扩展包?

请关注我的实战课程,我会在此课程中分享一些扩展开发经验 —— 《PHP 扩展包实战教程 - 从入门到发布》

License

MIT

Comments
  • MAC使用php artisan lang:publish zh-CN 报错

    MAC使用php artisan lang:publish zh-CN 报错

    chenjinhaodeMacBook-Pro:rarone_watch chenjinhao$ php artisan lang:publish zh-CN

    cp: /Applications/MAMP/htdocs/rarone_watch/vendor/caouecs/laravel-lang/src/zh-CN /Applications/MAMP/htdocs/rarone_watch/vendor/caouecs/laravel-lang/json/zh-CN.json: No such file or directory

    published languages (no overwrite): ["zh-CN"].

    opened by richarduncle 15
  • Call to undefined function Overtrue\LaravelLang\resource_path()

    Call to undefined function Overtrue\LaravelLang\resource_path()

    After last update when I do a php artisan clear-compiled I recive the following error:

    [Symfony\Component\Debug\Exception\FatalErrorException]
    Call to undefined function Overtrue\LaravelLang\resource_path()

    Script php artisan clear-compiled handling the post-update-cmd event returned with an error

    opened by grudge61 6
  • Old version of translation

    Old version of translation

    When I try to publish the translation file, I note that was an old version of Caouse-laravel-lang files.

    I hope to check it to publish the newest translation files.

    opened by mohamedsabil83 5
  • Update laravel-lang/lang requirement from ^8.0 to ^10.1

    Update laravel-lang/lang requirement from ^8.0 to ^10.1

    Updates the requirements on laravel-lang/lang to permit the latest version.

    Changelog

    Sourced from laravel-lang/lang's changelog.

    [10.1.0] - 2021-06-02

    Changed

    • feature: [ms] #1772 auth.php

    Reference

    • add Laravel Breeze

    Todo script

    • fix: #1762 Some translations have been lost in the new version (10.0)

    [10.0.2] - 2021-05-30

    Changed

    • feature: [de] #1759 cashier jetstream nova spark-paddle spark-stripe
    • feature: [es] #1760 nova
    • feature: [pt_BR] #1767 #1769 #1771 exclude cashier jetstream nova spark-paddle spark-stripe validation-inline
    • feature: [tr] #1766 #1768 #1770 exclude auth jetstream nova spark-paddle spark-stripe json file

    [10.0.1] - 2021-05-24

    Changed

    • feature: [ar] #1757 jetstream spark-paddle spark-stripe
    • feature: [es] #1753 jetstream spark-paddle spark-stripe
    • feature: [fi] #1758 exclude auth.php cashier fortify jetstream nova spark-paddle spark-stripe validation-inline.php validation.php json file
    • feature: [fr] cashier jetstream nova spark-paddle spark-stripe
    • feature: [ru] #1751 cashier jetstream spark-paddle spark-stripe
    • feature: [vi] #1756 cashier jetstream spark-paddle
    • feature: [zh_TW] #1754 validation-inline.php json file

    Todo script

    • fix: #1751
    • feature: #1752 Added dock block to structure splitter file

    [10.0.0] - 2021-05-20

    Changed

    • feature: [de] #1750 json file
    • feature: [nb] #1747 auth.php pagination.php passwords.php validation-inline.php validation.php json file

    Reference

    • feature: #1748 Split translation keys into Laravel packages

    ... (truncated)

    Commits
    • 60f3438 doc for 10.1.0
    • 4ccc94e Updated status of translations
    • cd8a396 Updating the file
    • ae8b99f Merge pull request #1762 from andrey-helldar/patch/2021-05-26/22-46
    • ab54cb8 Resolving merge conflict
    • 6f8b39c Merge remote-tracking branch 'caouecs/master' into patch/2021-05-26/22-46
    • 5c2532b Update tests
    • 9640443 Update script app/status.php
    • 25cdb9b Update script app/keys.php
    • 1b40b00 Updated status of translations
    • Additional commits viewable in compare view

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 4
  • 3.0.9 introduced a break in backward compatibility

    3.0.9 introduced a break in backward compatibility

    Since the addJsonPath method was introduced in version 5.5 of Laravel, the use of it in your package breaks compatibility with Laravel <5.5

    https://laravel.com/api/5.4/search.html?search=addJsonPath https://laravel.com/api/5.5/search.html?search=addJsonPath

    You should use Semver to avoid this. Besides, it would be nice to indicate the compatability requirements in your composer.json file.

    opened by forxer 4
  • Laravel 5.4 trans()不能正常使用

    Laravel 5.4 trans()不能正常使用

    5.4 Translator.php trans方法移除了$domain = 'messages'传参

        public function trans($key, array $replace = [], $locale = null)
        {
            return $this->get($key, $replace, $locale);
        }
    
    opened by mugennsou 4
  • 版本化建议

    版本化建议

    推荐和 laravel-lang/lang 一致,用大版本的版本号来对应不同的 laravel 版本,例如:

    | Laravel version | Composer command | |-------------------------------------|---------------------------------------------------| | Laravel 8.x | composer require overtrue/laravel-lang:~7.0 | | Laravel 7.x and new directory names | composer overtrue/laravel-lang:~7.0 | | Laravel 7.x | composer require overtrue/laravel-lang:~6.1 | | Laravel 6.x | composer require overtrue/laravel-lang:~5.0 | | Laravel 5.8 | composer require overtrue/laravel-lang:~4.0 | | Laravel 5.1-5.7 | composer require overtrue/laravel-lang:~3.0 | | Laravel 5 | composer require overtrue/laravel-lang:~2.0 | | Laravel 4 | composer require overtrue/laravel-lang:~1.0 |

    否则用户不知道哪个版本的翻译对应到哪个 laravel 版本。

    opened by suyar 3
  • Update laravel/framework requirement from ~7.0 to ~8.1

    Update laravel/framework requirement from ~7.0 to ~8.1

    Updates the requirements on laravel/framework to permit the latest version.

    Changelog

    Sourced from laravel/framework's changelog.

    Release Notes for 7.x

    Unreleased

    v7.27.0 (2020-09-01)

    Added

    • Allow to use alias of morphed model (#34032)
    • Introduced basic padding (both, left, right) methods to Str and Stringable (#34053)

    Refactoring

    Changed

    • allow to reset forced scheme and root-url in UrlGenerator (#34039)
    • Updating the make commands to use a custom views path (#34060, b593c62)
    • Using "public static property" in View Component causes an error (#34058)
    • Changed postgres processor (#34055)

    v7.26.1 (2020-08-27)

    Fixed

    • Fixed offset error on invalid remember token (#34020)
    • Only prepend scheme to PhpRedis host when necessary (#34017)
    • Fixed whereKey and whereKeyNot in Illuminate\Database\Eloquent\Builder (#34031)

    v7.26.0 (2020-08-25)

    Added

    • Added whenHas and whenFilled methods to Illuminate\Http\Concerns\InteractsWithInput class (#33829)
    • Added email validating with custom class (#33835)
    • Added Illuminate\View\ComponentAttributeBag::whereDoesntStartWith() (#33851)
    • Allow setting synchronous_commit for Postgres (#33897)
    • Allow nested errors in Illuminate\Testing\TestResponse::assertJsonValidationErrors() (#33989)
    • Added support for stream reads to FilesystemManager (#34001)

    Fixed

    • Fix defaultTimezone not respected in scheduled Events (#33834)
    • Fixed usage of Support Collection#countBy($key) (#33852)
    • Fixed route registerar bug (42ba0ef)
    • Fixed key composition for attribute with dot at validation error messages (#33932)
    • Fixed the dump method for LazyCollection (#33944)
    • Fixed dimension ratio calculation in Illuminate\Validation\Concerns\ValidatesAttributes::failsRatioCheck() (#34003)

    Changed

    • Implement LockProvider on DatabaseStore (#33844)
    • Publish resources.stub in stub:publish command (#33862)
    Commits

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
    • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

    Additionally, you can set the following in your Dependabot dashboard:

    • Update frequency (including time of day and day of week)
    • Pull request limits (per update run and/or open at any time)
    • Automerge options (never/patch/minor, and dev/runtime dependencies)
    • Out-of-range updates (receive only lockfile updates, if desired)
    • Security updates (receive only security updates, if desired)
    dependencies 
    opened by dependabot-preview[bot] 3
  • Can't load translation files

    Can't load translation files

    Hi, i'm using Laravel Framework version 5.2.31,

    i have installed the package according to the main page instructions but i still see validation errors in english instead in the locale i have set in config/app.php.

    I discovered that within the registerLoader method in TranslationServiceProvider there is a reference to this method:

    app()->basePath('vendor/caouecs/laravel-lang/src/'),
    

    And looking into the basePath Application class it does not accept any parameters. This line will output just the base path and not the base path with 'vendor/caouecs/laravel-lang/src/' concatenated, this is preventing the FIleLoader class to find the translation files.

    there is a function in Illuminate/Foundation/helpers.php that it does accept a path parameter and it will concatenate it to the base path:

    if (! function_exists('base_path')) {
        /**
         * Get the path to the base of the install.
         *
         * @param  string  $path
         * @return string
         */
        function base_path($path = '')
        {
            return app()->basePath().($path ? DIRECTORY_SEPARATOR.$path : $path);
        }
    }
    

    I think this will work good.

    Could you please fix this?

    Thanks for this great package, i love it!

    opened by uxweb 3
  • caouecs/laravel-lang更新到Laravel-lang/lang

    caouecs/laravel-lang更新到Laravel-lang/lang

    caouecs/laravel-lang更新到Laravel-lang/lang已经有段时间了,也看到了本项目依赖已经更改,但是好像还没打标签,导致packagist上还没更改,最近composer update老是提示 “Package caouecs/laravel-lang is abandoned, you should avoid using it.” 。

    opened by fishtailstudio 2
  • 升级到 3.0.9 和 3.0.10 报错

    升级到 3.0.9 和 3.0.10 报错

    Lumen 5.6 + ValidationException,升级到 3.0.9 和 3.0.10 报错,降级到 3.0.8 正常。

    [2018-09-02 16:06:18] local.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError: Argument 1 passed to Illuminate\Translation\Translator::__construct() must implement interface Illuminate\Contracts\Translation\Loader, null given, called in /Users/huachen/Projects/dongri/api/vendor/illuminate/translation/TranslationServiceProvider.php on line 33 in /Users/huachen/Projects/dongri/api/vendor/illuminate/translation/Translator.php:60
    Stack trace:
    #0 /Users/huachen/Projects/dongri/api/vendor/illuminate/translation/TranslationServiceProvider.php(33): Illuminate\Translation\Translator->__construct(NULL, 'zh-CN')
    #1 /Users/huachen/Projects/dongri/api/vendor/illuminate/container/Container.php(764): Illuminate\Translation\TranslationServiceProvider->Illuminate\Translation\{closure}(Object(Laravel\Lumen\Application), Array)
    #2 /Users/huachen/Projects/dongri/api/vendor/illuminate/container/Container.php(646): Illuminate\Container\Container->build(Object(Closure))
    #3 /Users/huachen/Projects/dongri/api/vendor/illuminate/container/Container.php(601): Illuminate\Container\Container->resolve('translator', Array)
    #4 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Application.php(223): Illuminate\Container\Container->make('translator', Array)
    #5 /Users/huachen/Projects/dongri/api/vendor/illuminate/container/Container.php(1210): Laravel\Lumen\Application->make('translator')
    #6 /Users/huachen/Projects/dongri/api/vendor/illuminate/validation/ValidationServiceProvider.php(36): Illuminate\Container\Container->offsetGet('translator')
    #7 /Users/huachen/Projects/dongri/api/vendor/illuminate/container/Container.php(764): Illuminate\Validation\ValidationServiceProvider->Illuminate\Validation\{closure}(Object(Laravel\Lumen\Application), Array)
    #8 /Users/huachen/Projects/dongri/api/vendor/illuminate/container/Container.php(646): Illuminate\Container\Container->build(Object(Closure))
    #9 /Users/huachen/Projects/dongri/api/vendor/illuminate/container/Container.php(601): Illuminate\Container\Container->resolve('validator', Array)
    #10 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Application.php(223): Illuminate\Container\Container->make('validator', Array)
    #11 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Application.php(524): Laravel\Lumen\Application->make('validator')
    #12 /Users/huachen/Projects/dongri/api/vendor/illuminate/container/Container.php(764): Laravel\Lumen\Application->Laravel\Lumen\{closure}(Object(Laravel\Lumen\Application), Array)
    #13 /Users/huachen/Projects/dongri/api/vendor/illuminate/container/Container.php(646): Illuminate\Container\Container->build(Object(Closure))
    #14 /Users/huachen/Projects/dongri/api/vendor/illuminate/container/Container.php(601): Illuminate\Container\Container->resolve('validator', Array)
    #15 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Application.php(223): Illuminate\Container\Container->make('validator', Array)
    #16 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/helpers.php(38): Laravel\Lumen\Application->make('validator')
    #17 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Routing/ProvidesConvenienceMethods.php(206): app('validator')
    #18 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Routing/ProvidesConvenienceMethods.php(64): Laravel\Lumen\Routing\Controller->getValidationFactory()
    #19 /Users/huachen/Projects/dongri/api/app/Http/Controllers/V2/SolutionRecordsController.php(15): Laravel\Lumen\Routing\Controller->validate(Object(Illuminate\Http\Request), Array)
    #20 [internal function]: App\Http\Controllers\V2\SolutionRecordsController->index(Object(Illuminate\Http\Request))
    #21 /Users/huachen/Projects/dongri/api/vendor/illuminate/container/BoundMethod.php(29): call_user_func_array(Array, Array)
    #22 /Users/huachen/Projects/dongri/api/vendor/illuminate/container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
    #23 /Users/huachen/Projects/dongri/api/vendor/illuminate/container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Laravel\Lumen\Application), Array, Object(Closure))
    #24 /Users/huachen/Projects/dongri/api/vendor/illuminate/container/Container.php(564): Illuminate\Container\BoundMethod::call(Object(Laravel\Lumen\Application), Array, Array, NULL)
    #25 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(373): Illuminate\Container\Container->call(Array, Array)
    #26 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(339): Laravel\Lumen\Application->callControllerCallable(Array, Array)
    #27 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(313): Laravel\Lumen\Application->callLumenController(Object(App\Http\Controllers\V2\SolutionRecordsController), 'index', Array)
    #28 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(275): Laravel\Lumen\Application->callControllerAction(Array)
    #29 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(260): Laravel\Lumen\Application->callActionOnArrayBasedRoute(Array)
    #30 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(160): Laravel\Lumen\Application->handleFoundRoute(Array)
    #31 [internal function]: Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}(Object(Illuminate\Http\Request))
    #32 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
    #33 /Users/huachen/Projects/dongri/api/vendor/barryvdh/laravel-cors/src/HandlePreflight.php(35): Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(Object(Illuminate\Http\Request))
    #34 /Users/huachen/Projects/dongri/api/vendor/illuminate/pipeline/Pipeline.php(151): Barryvdh\Cors\HandlePreflight->handle(Object(Illuminate\Http\Request), Object(Closure))
    #35 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
    #36 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
    #37 /Users/huachen/Projects/dongri/api/vendor/barryvdh/laravel-cors/src/HandleCors.php(36): Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(Object(Illuminate\Http\Request))
    #38 /Users/huachen/Projects/dongri/api/vendor/illuminate/pipeline/Pipeline.php(151): Barryvdh\Cors\HandleCors->handle(Object(Illuminate\Http\Request), Object(Closure))
    #39 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
    #40 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
    #41 /Users/huachen/Projects/dongri/api/vendor/illuminate/pipeline/Pipeline.php(104): Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(Object(Illuminate\Http\Request))
    #42 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(410): Illuminate\Pipeline\Pipeline->then(Object(Closure))
    #43 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(166): Laravel\Lumen\Application->sendThroughPipeline(Array, Object(Closure))
    #44 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(107): Laravel\Lumen\Application->dispatch(NULL)
    #45 /Users/huachen/Projects/dongri/api/public/index.php(28): Laravel\Lumen\Application->run()
    #46 {main} {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Argument 1 passed to Illuminate\\Translation\\Translator::__construct() must implement interface Illuminate\\Contracts\\Translation\\Loader, null given, called in /Users/huachen/Projects/dongri/api/vendor/illuminate/translation/TranslationServiceProvider.php on line 33 at /Users/huachen/Projects/dongri/api/vendor/illuminate/translation/Translator.php:60)
    [stacktrace]
    #0 /Users/huachen/Projects/dongri/api/vendor/illuminate/translation/TranslationServiceProvider.php(33): Illuminate\\Translation\\Translator->__construct(NULL, 'zh-CN')
    #1 /Users/huachen/Projects/dongri/api/vendor/illuminate/container/Container.php(764): Illuminate\\Translation\\TranslationServiceProvider->Illuminate\\Translation\\{closure}(Object(Laravel\\Lumen\\Application), Array)
    #2 /Users/huachen/Projects/dongri/api/vendor/illuminate/container/Container.php(646): Illuminate\\Container\\Container->build(Object(Closure))
    #3 /Users/huachen/Projects/dongri/api/vendor/illuminate/container/Container.php(601): Illuminate\\Container\\Container->resolve('translator', Array)
    #4 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Application.php(223): Illuminate\\Container\\Container->make('translator', Array)
    #5 /Users/huachen/Projects/dongri/api/vendor/illuminate/container/Container.php(1210): Laravel\\Lumen\\Application->make('translator')
    #6 /Users/huachen/Projects/dongri/api/vendor/illuminate/validation/ValidationServiceProvider.php(36): Illuminate\\Container\\Container->offsetGet('translator')
    #7 /Users/huachen/Projects/dongri/api/vendor/illuminate/container/Container.php(764): Illuminate\\Validation\\ValidationServiceProvider->Illuminate\\Validation\\{closure}(Object(Laravel\\Lumen\\Application), Array)
    #8 /Users/huachen/Projects/dongri/api/vendor/illuminate/container/Container.php(646): Illuminate\\Container\\Container->build(Object(Closure))
    #9 /Users/huachen/Projects/dongri/api/vendor/illuminate/container/Container.php(601): Illuminate\\Container\\Container->resolve('validator', Array)
    #10 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Application.php(223): Illuminate\\Container\\Container->make('validator', Array)
    #11 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Application.php(524): Laravel\\Lumen\\Application->make('validator')
    #12 /Users/huachen/Projects/dongri/api/vendor/illuminate/container/Container.php(764): Laravel\\Lumen\\Application->Laravel\\Lumen\\{closure}(Object(Laravel\\Lumen\\Application), Array)
    #13 /Users/huachen/Projects/dongri/api/vendor/illuminate/container/Container.php(646): Illuminate\\Container\\Container->build(Object(Closure))
    #14 /Users/huachen/Projects/dongri/api/vendor/illuminate/container/Container.php(601): Illuminate\\Container\\Container->resolve('validator', Array)
    #15 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Application.php(223): Illuminate\\Container\\Container->make('validator', Array)
    #16 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/helpers.php(38): Laravel\\Lumen\\Application->make('validator')
    #17 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Routing/ProvidesConvenienceMethods.php(206): app('validator')
    #18 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Routing/ProvidesConvenienceMethods.php(64): Laravel\\Lumen\\Routing\\Controller->getValidationFactory()
    #19 /Users/huachen/Projects/dongri/api/app/Http/Controllers/V2/SolutionRecordsController.php(15): Laravel\\Lumen\\Routing\\Controller->validate(Object(Illuminate\\Http\\Request), Array)
    #20 [internal function]: App\\Http\\Controllers\\V2\\SolutionRecordsController->index(Object(Illuminate\\Http\\Request))
    #21 /Users/huachen/Projects/dongri/api/vendor/illuminate/container/BoundMethod.php(29): call_user_func_array(Array, Array)
    #22 /Users/huachen/Projects/dongri/api/vendor/illuminate/container/BoundMethod.php(87): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
    #23 /Users/huachen/Projects/dongri/api/vendor/illuminate/container/BoundMethod.php(31): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(Laravel\\Lumen\\Application), Array, Object(Closure))
    #24 /Users/huachen/Projects/dongri/api/vendor/illuminate/container/Container.php(564): Illuminate\\Container\\BoundMethod::call(Object(Laravel\\Lumen\\Application), Array, Array, NULL)
    #25 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(373): Illuminate\\Container\\Container->call(Array, Array)
    #26 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(339): Laravel\\Lumen\\Application->callControllerCallable(Array, Array)
    #27 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(313): Laravel\\Lumen\\Application->callLumenController(Object(App\\Http\\Controllers\\V2\\SolutionRecordsController), 'index', Array)
    #28 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(275): Laravel\\Lumen\\Application->callControllerAction(Array)
    #29 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(260): Laravel\\Lumen\\Application->callActionOnArrayBasedRoute(Array)
    #30 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(160): Laravel\\Lumen\\Application->handleFoundRoute(Array)
    #31 [internal function]: Laravel\\Lumen\\Application->Laravel\\Lumen\\Concerns\\{closure}(Object(Illuminate\\Http\\Request))
    #32 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\\Http\\Request))
    #33 /Users/huachen/Projects/dongri/api/vendor/barryvdh/laravel-cors/src/HandlePreflight.php(35): Laravel\\Lumen\\Routing\\Pipeline->Laravel\\Lumen\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
    #34 /Users/huachen/Projects/dongri/api/vendor/illuminate/pipeline/Pipeline.php(151): Barryvdh\\Cors\\HandlePreflight->handle(Object(Illuminate\\Http\\Request), Object(Closure))
    #35 [internal function]: Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
    #36 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\\Http\\Request))
    #37 /Users/huachen/Projects/dongri/api/vendor/barryvdh/laravel-cors/src/HandleCors.php(36): Laravel\\Lumen\\Routing\\Pipeline->Laravel\\Lumen\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
    #38 /Users/huachen/Projects/dongri/api/vendor/illuminate/pipeline/Pipeline.php(151): Barryvdh\\Cors\\HandleCors->handle(Object(Illuminate\\Http\\Request), Object(Closure))
    #39 [internal function]: Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
    #40 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\\Http\\Request))
    #41 /Users/huachen/Projects/dongri/api/vendor/illuminate/pipeline/Pipeline.php(104): Laravel\\Lumen\\Routing\\Pipeline->Laravel\\Lumen\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
    #42 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(410): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
    #43 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(166): Laravel\\Lumen\\Application->sendThroughPipeline(Array, Object(Closure))
    #44 /Users/huachen/Projects/dongri/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(107): Laravel\\Lumen\\Application->dispatch(NULL)
    #45 /Users/huachen/Projects/dongri/api/public/index.php(28): Laravel\\Lumen\\Application->run()
    #46 {main}
    "} 
    
    opened by hclj37 2
  • Update laravel-lang/lang requirement from ^10.4 to ^11.0

    Update laravel-lang/lang requirement from ^10.4 to ^11.0

    Updates the requirements on laravel-lang/lang to permit the latest version.

    Release notes

    Sourced from laravel-lang/lang's releases.

    11.0.2 - 2022-06-30

    Changed

    Full Changelog: https://github.com/Laravel-Lang/lang/compare/11.0.1...11.0.2

    Commits

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Publishing language files should support publishing to the lang directory

    Publishing language files should support publishing to the lang directory

    It is officially supported to place language packs in the resources/lang or lang directory.

    The location of language packs for each project is different. The release command should support publishing to the lang directory.

    https://laravel.com/docs/9.x/localization

    opened by peibinzhu 1
  • 字段 验证提示 还是英文

    字段 验证提示 还是英文

    Laravel Framework 8.68.0

    "overtrue/laravel-lang": "^5.0",

    app.php 设置 'locale' => 'zh_CN', 验证 提示 是 phone 必须介于 3 - 10 个字符之间。 , 这个 phone 字段 在 validation-attributes.php 文件中 有定义, 没有 将 phone 提示为手机

    猜测: validation-attributes.phpvalidation-inline.php 都没有起作用

    validation.php 文件中 添加

    'attributes' => [
        'phone'         => '手机号',
    ],
    

    这样 才有作用

    bug todo :spiral_notepad: 
    opened by gyp719 4
Releases(6.0.3)
Owner
安正超
Keep calm and coding.
安正超
List of 77 languages for Laravel Framework 4, 5, 6, 7 and 8, Laravel Jetstream , Laravel Fortify, Laravel Cashier and Laravel Nova.

Laravel Lang In this repository, you can find the lang files for the Laravel Framework 4/5/6/7/8, Laravel Jetstream , Laravel Fortify, Laravel Cashier

Laravel Lang 6.9k Dec 29, 2022
Extracts translatable strings from source. Identical to xgettext but for template languages.

xgettext-template Extracts translatable strings from source. Identical to xgettext(1) but for template languages. Template language support Handlebars

Guillaume C. Marty 79 Oct 7, 2022
Easy multilingual urls and redirection support for the Laravel framework

Linguist - Multilingual urls and redirects for Laravel This package provides an easy multilingual urls and redirection support for the Laravel framewo

Tanel Tammik 189 Jul 18, 2022
Support multiple language resources for Laravel

Laratrans Support multiple language resources for Laravel. Docs Installation composer require lechihuy/laratrans After you install the package success

Lê Chí Huy 3 Dec 21, 2021
Trait for multilingual resource file support

⚡ Usage This library supports MultilingualResourceTrait which can be used in PluginBase. Multilingual support of resource files is possible using this

PocketMine-MP projects of PresentKim 1 Jun 7, 2022
Provides support for message translation and localization for dates and numbers.

The I18n library provides a I18n service locator that can be used for setting the current locale, building translation bundles and translating messages. Additionally, it provides the Time and Number classes which can be used to output dates, currencies and any numbers in the right format for the specified locale.

CakePHP 26 Oct 22, 2022
The Translation component provides tools to internationalize your application.

Translation Component The Translation component provides tools to internationalize your application. Getting Started $ composer require symfony/transl

Symfony 6.4k Jan 6, 2023
Easy localization for Laravel

Laravel Localization Easy i18n localization for Laravel, an useful tool to combine with Laravel localization classes. The package offers the following

Marc Cámara 3k Jan 4, 2023
[Deprecated] A Laravel package for multilingual models

This package has been deprecated. But worry not. You can use Astrotomic/laravel-translatable. Laravel-Translatable If you want to store translations o

Dimitris Savvopoulos 2k Dec 25, 2022
Better translation management for Laravel

Better localization management for Laravel Introduction Keeping a project's translations properly updated is cumbersome. Usually translators do not ha

Waavi 354 Dec 18, 2022
Package to manage Laravel translations locally

Translation Manager For Laravel Easy to use package that helps you with the translation of your Laravel application locally. Features ✅ Check all loca

null 5 Jan 8, 2022
Laravel translation made __('simple').

Translation.io client for Laravel 5.5+/6/7/8 Add this package to localize your Laravel application. Use the official Laravel syntax (with PHP or JSON

Translation.io 109 Dec 29, 2022
🎌 Laravel Localization Helper :: Easily add translation variables from Blade templates.

LocalizationHelper Package for convenient work with Laravel's localization features and fast language files generation. Take a look at contributing.md

Awes.io 36 Jul 18, 2022
Manage Laravel translation files

Laravel 5 Translation Manager For Laravel 4, please use the 0.1 branch! This is a package to manage Laravel translation files. It does not replace the

Barry vd. Heuvel 1.5k Jan 4, 2023
A GUI for managing JSON translation files in your laravel projects.

Laravel Language Manager Langman is a GUI for managing your JSON language files in a Laravel project. Installation Begin by installing the package thr

Mohamed Said 515 Nov 30, 2022
A Gui To Manage Laravel Translation Files

Lingo A file based translation manager, which unlike other Lang managers don't need a database connection to handle the translation. Installation comp

Muah 97 Dec 5, 2022
Generates a vue-i18n compatible include file from your Laravel translations

This is fork of martinlindhe/laravel-vue-i18n-generator to give Laravel 8+ support for this excellent package.

Alefe Souza 1 Nov 11, 2021
🌐 A minimalist languages library that made plugins support multiple languages.

libLanguages · libLanguages is a PocketMine-MP library for making plugins support multiple languages. Easy To Learn: Just declare it in onEnable() fun

thebigcrafter 1 May 1, 2022
Pico disk, Not need any database, support html5, support mp3, mp4, support streaming media, support AriaNg

Nano netdisk, Now changed to pico disk. Pico disk,does not need any database, support html5, support mp3, mp4, support streaming media, support AriaNg.

null 53 Dec 26, 2022
🗓 A library to help you work with dates in multiple languages, based on Carbon.

Date This date library extends Carbon with multi-language support. Methods such as format, diffForHumans, parse, createFromFormat and the new timespan

Jens Segers 1.8k Dec 30, 2022