{"id":15025139,"url":"https://github.com/mputkowski/laravel-localization","last_synced_at":"2025-07-21T11:05:29.360Z","repository":{"id":57020631,"uuid":"118966076","full_name":"mputkowski/Laravel-Localization","owner":"mputkowski","description":"Localization for Laravel","archived":false,"fork":false,"pushed_at":"2025-07-18T16:39:10.000Z","size":131,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-18T20:54:02.051Z","etag":null,"topics":["language","laravel","laravel-framework","laravel-localization","laravel-package","laravel-packages","localization","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mputkowski.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-01-25T20:48:51.000Z","updated_at":"2025-07-18T16:37:53.000Z","dependencies_parsed_at":"2025-04-14T18:38:55.337Z","dependency_job_id":"796ad840-502e-4b9c-aa9f-c57a58b48942","html_url":"https://github.com/mputkowski/Laravel-Localization","commit_stats":{"total_commits":146,"total_committers":2,"mean_commits":73.0,"dds":0.006849315068493178,"last_synced_commit":"c5873afea98b23c67a1416186e273fe31c4f4ca9"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/mputkowski/Laravel-Localization","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mputkowski%2FLaravel-Localization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mputkowski%2FLaravel-Localization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mputkowski%2FLaravel-Localization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mputkowski%2FLaravel-Localization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mputkowski","download_url":"https://codeload.github.com/mputkowski/Laravel-Localization/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mputkowski%2FLaravel-Localization/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266287824,"owners_count":23905461,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["language","laravel","laravel-framework","laravel-localization","laravel-package","laravel-packages","localization","php"],"created_at":"2024-09-24T20:01:33.949Z","updated_at":"2025-07-21T11:05:29.349Z","avatar_url":"https://github.com/mputkowski.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Localization\n[![run-tests](https://github.com/mputkowski/Laravel-Localization/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/mputkowski/Laravel-Localization/actions/workflows/tests.yml)\n[![StyleCI](https://styleci.io/repos/118966076/shield)](https://styleci.io/repos/118966076)\n[![Codecov](https://img.shields.io/codecov/c/github/mputkowski/Laravel-Localization.svg?style=flat-square)](https://codecov.io/gh/mputkowski/Laravel-Localization)\n[![Latest Stable Version](https://img.shields.io/packagist/v/mputkowski/Laravel-Localization.svg?style=flat-square)](https://packagist.org/packages/mputkowski/Laravel-Localization)\n[![Total Downloads](https://img.shields.io/packagist/dt/mputkowski/Laravel-Localization.svg?style=flat-square)](https://packagist.org/packages/mputkowski/Laravel-Localization)\n[![License](https://img.shields.io/github/license/mputkowski/Laravel-Localization.svg?style=flat-square)](https://github.com/mputkowski/Laravel-Localization/blob/master/LICENSE)\n\nLocalization for Laravel\n\n## Installation\n||L6|L7|L8|L9|L10|L11|L12\n|---|---|---|---|---|---|---|---|\n|v4|\u0026check;|\u0026check;|\u0026check;|\u0026check;|\u0026cross;|\u0026cross;|\u0026cross;|\n|v5|\u0026cross;|\u0026cross;|\u0026cross;|\u0026check;|\u0026check;|\u0026check;|\u0026check;|\n\nAdd package to composer.json\n```\ncomposer require mputkowski/laravel-localization\n```\n\nPublish package's config file\n```\nphp artisan vendor:publish --provider=\"mputkowski\\Localization\\ServiceProvider\"\n```\n\n### Laravel 11 or newer\n\nAppend the middleware to the `web` group in the `bootstrap/app.php`:\n```php\n-\u003ewithMiddleware(function (Middleware $middleware) {\n    $middleware-\u003eweb(append: [\n        \\mputkowski\\Localization\\Middleware\\VerifyLangCookie::class,\n    ]);\n})\n```\n\n### Laravel 10 or older\n\nInclude middleware within the `web` group in `middlewareGroups` array (`app/Http/Kernel.php`):\n```php\n'web' =\u003e [\n    \\mputkowski\\Localization\\Middleware\\VerifyLangCookie::class,\n],\n```\n\n**You don't have to register service provider and alias, this package uses Package Auto-Discovery.**\n\n## Configuration\nConfiguration is stored in `config/localization.php` file.\n\n|Key|Type|Default|\n|---|---|---|\n|auto|bool|true|\n|cookie_name|string|`lang`|\n|default_locale|string|`en`|\n|**Route**||\n|enabled|bool|true|\n|pattern|string|`/lang/{lang}`|\n\n### Auto-detection\nIf `auto` is set to `true`, the app will automatically detect client's language. The lang directory will be compared with the client's `Accept-Language` header. If header doesn't match with the app's locales, language will be set to default.\n\nAuto-detected language could be changed by accessing a special route designed for that, or by calling the `setLocale` method:\n\n```php\nuse mputkowski\\Localization\\Facades\\Localization;\n\nLocalization::setLocale('en');\n```\n\n### Route\nThis package also provides routes for quick language change (url: `/lang/{lang}`, example `/lang/en`).\n\n## Contributing\nFeel free to create pull requests or open issues, I'll look on them as quick as I can.\n\n## License\nThis project is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).\n```\nMIT License\n\nCopyright (c) 2018 - 2025 Michał Putkowski\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmputkowski%2Flaravel-localization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmputkowski%2Flaravel-localization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmputkowski%2Flaravel-localization/lists"}