{"id":18310332,"url":"https://github.com/torann/localization","last_synced_at":"2025-04-05T18:31:39.654Z","repository":{"id":57071906,"uuid":"57933790","full_name":"Torann/localization","owner":"Torann","description":"Simplified localization for Laravel based on the application's subdomain","archived":false,"fork":false,"pushed_at":"2024-03-22T18:51:34.000Z","size":45,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"2.x","last_synced_at":"2024-04-22T21:08:14.182Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Torann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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}},"created_at":"2016-05-03T01:54:27.000Z","updated_at":"2022-02-09T14:59:51.000Z","dependencies_parsed_at":"2024-03-22T19:55:09.192Z","dependency_job_id":"c55c92ab-f546-4def-8827-e0103ffc70fe","html_url":"https://github.com/Torann/localization","commit_stats":{"total_commits":28,"total_committers":1,"mean_commits":28.0,"dds":0.0,"last_synced_commit":"ed8de495f12061a163f55d2eeb1526d12eddbb21"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Torann%2Flocalization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Torann%2Flocalization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Torann%2Flocalization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Torann%2Flocalization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Torann","download_url":"https://codeload.github.com/Torann/localization/tar.gz/refs/heads/2.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247383836,"owners_count":20930358,"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":[],"created_at":"2024-11-05T16:14:09.176Z","updated_at":"2025-04-05T18:31:39.259Z","avatar_url":"https://github.com/Torann.png","language":"PHP","funding_links":["https://www.patreon.com/torann","https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=4CJA2A97NPYVU"],"categories":[],"sub_categories":[],"readme":"# Laravel Localization - Simplified\n\n[![Build Status](https://app.travis-ci.com/Torann/localization.svg?branch=2.x)](https://app.travis-ci.com/Torann/localization)\n[![Latest Stable Version](https://poser.pugx.org/torann/localization/v/stable.png)](https://packagist.org/packages/torann/localization)\n[![Total Downloads](https://poser.pugx.org/torann/localization/downloads.png)](https://packagist.org/packages/torann/localization)\n[![Patreon donate button](https://img.shields.io/badge/patreon-donate-yellow.svg)](https://www.patreon.com/torann)\n[![Donate to this project using Flattr](https://img.shields.io/badge/flattr-donate-yellow.svg)](https://flattr.com/profile/torann)\n[![Donate to this project using Paypal](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=4CJA2A97NPYVU)\n\nSimplified localization for Laravel based on the application's subdomain.\n\n## Table of Contents\n\n- [Installation](#installation])\n  - [Composer](#composer)\n  - [Laravel](#laravel)\n- [Methods](#methods)\n- [Helpers](#helpers)\n- [Determining Locale](#determining-locale)\n- [License](#license)\n- [Localization on Packagist](https://packagist.org/packages/torann/localization)\n- [Localization on GitHub](https://github.com/Torann/localization)\n\n## Installation\n\n### Composer\n\nFrom the command line run:\n\n```\n$ composer require torann/localization\n```\n\n### Laravel\n\nOnce installed you need to register the service provider with the application. Open up `config/app.php` and find the `providers` key.\n\n``` php\n'providers' =\u003e [\n    \\Torann\\Localization\\LocalizationServiceProvider::class,\n]\n```\n\n### Publish the configurations\n\nRun this on the command line from the root of your project:\n\n```bash\nphp artisan vendor:publish --provider=\"Torann\\Localization\\LocalizationServiceProvider\"\n```\n\nA configuration file will be published to `config/localization.php`.\n\n\n## Methods\n\nThe following methods are available:\n\n- `getDefaultLocale(): string`\n- `getCurrentLocale(): string`\n- `setLocale(string $locale = null): string|null`\n- `getLocales(): array`\n- `getLocale(string $key, mixed $default = null): mixed`\n- `getLocaleDirection(string $locale = 'current'): string`\n- `getLocaleKeys(): array`\n- `getLocalizedURL(string $url = null, mixed $locale = false, array $extra = []): string`\n- `isSupported(mixed $key): bool`\n- `getConfig(string $key, mixed $default = null): mixed`\n\n\n## Helpers\n\nLaravel Localization comes with a few helper methods\n\n#### `localization()`\n\nReturns the `Torann\\Localization\\LocaleManager` instance.\n\n#### `localize_url($url = null, $locale = null, $attributes = []): string`\n\nReturns the given URL adapted to provided locale.\n\n## Determining Locale\n\n### By Subdomain\n\nFor this to work the subdomain needs to match an enabled supported locale key.\n\n### By Host\n\nWhen the given subdomain is determined to not be valid the system can then set the locale depending on the current host. You'll need to set a map of your application's locales to hosts using the **hosts** configuration option.\n\n### License\n\nLocalization is open-sourced software licensed under the BSD 2-Clause License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftorann%2Flocalization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftorann%2Flocalization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftorann%2Flocalization/lists"}