{"id":25391607,"url":"https://github.com/awes-io/localization-helper","last_synced_at":"2025-10-30T17:31:25.751Z","repository":{"id":62490209,"uuid":"192965345","full_name":"awes-io/localization-helper","owner":"awes-io","description":"🎌 Laravel Localization Helper :: Easily add translation variables from Blade templates. ","archived":false,"fork":false,"pushed_at":"2019-10-10T16:12:15.000Z","size":28,"stargazers_count":35,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-02-23T22:43:36.936Z","etag":null,"topics":["language","laravel","locale","localization","php","translation"],"latest_commit_sha":null,"homepage":"https://www.awes.io","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/awes-io.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":"contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-20T17:59:20.000Z","updated_at":"2023-07-12T11:30:28.000Z","dependencies_parsed_at":"2022-11-02T09:31:24.507Z","dependency_job_id":null,"html_url":"https://github.com/awes-io/localization-helper","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awes-io%2Flocalization-helper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awes-io%2Flocalization-helper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awes-io%2Flocalization-helper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awes-io%2Flocalization-helper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/awes-io","download_url":"https://codeload.github.com/awes-io/localization-helper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239016774,"owners_count":19568302,"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","locale","localization","php","translation"],"created_at":"2025-02-15T15:56:06.866Z","updated_at":"2025-10-30T17:31:25.401Z","avatar_url":"https://github.com/awes-io.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LocalizationHelper\n\n[![Coverage report](https://repo.pkgkit.com/4GBWO/awes-io/localization-helper/badges/master/coverage.svg)](https://www.awes.io/)\n[![Build status](https://repo.pkgkit.com/4GBWO/awes-io/localization-helper/badges/master/build.svg)](https://www.awes.io/)\n[![Composer Ready](https://www.pkgkit.com/4GBWO/awes-io/localization-helper/status.svg)](https://www.awes.io/)\n[![Downloads](https://www.pkgkit.com/4GBWO/awes-io/localization-helper/downloads.svg)](https://www.awes.io/)\n[![Last version](https://www.pkgkit.com/4GBWO/awes-io/localization-helper/version.svg)](https://www.awes.io/)\n\nPackage for convenient work with Laravel's localization features and fast language files generation. Take a look at [contributing.md](contributing.md) to see a to do list.\n\n## Installation\n\nVia Composer\n\n``` bash\n$ composer require awes-io/localization-helper\n```\n\nIn Laravel 5.5+, service provider and facade will be automatically registered. For older versions, follow the steps below:\n\nRegister service provider in `config/app.php`:\n\n```php\n'providers' =\u003e [\n// [...]\n        AwesIO\\LocalizationHelper\\LocalizationHelperServiceProvider::class,\n],\n```\n\nYou may also register `LaravelLocalization` facade:\n\n```php\n'aliases' =\u003e [\n// [...]\n        'LocalizationHelper' =\u003e AwesIO\\LocalizationHelper\\Facades\\LocalizationHelper::class,\n],\n```\n\n## Config\n\n### Config Files\n\nIn order to edit default configuration you may execute:\n\n```\nphp artisan vendor:publish --provider=\"AwesIO\\LocalizationHelper\\LocalizationHelperServiceProvider\"\n```\n\nAfter that, `config/localizationhelper.php` will be created.\n\n## Usage\n\nPackage registers global helper function `_p($file_key, $default, $placeholders)`:\n\n```php\n_p('auth.login', 'Login'); // \"Login\"\n```\n\nIt will create new localization file `auth.php` (if it doesn't exist) and write second parameter as language string under `login` key:\n\n```php\nreturn [\n    \"login\" =\u003e \"Login\"\n];\n```\n\nOn second call with same file/key `_p('auth.login')`, localization string will be returned, file will remain untouched.\n\nPlaceholders are also supported:\n\n```php\n_p(\n    'mail.invitation', \n    'You’re invited to join :company company workspace', \n    ['company' =\u003e 'Awesio']\n);\n```\n\nIf key is returned, it means that string already exists in localization file and you are trying to add new one using its value as an array.\n\n```php\n// in localization file.php\nreturn [\n    \"test\" =\u003e \"Test string\"\n];\n\n_p('file.test.new', 'Test string'); // will return \"file.test.new\"\n\n_p('file.test_2.new', 'Test string'); // will return \"Test string\"\n\n// and modify localization file:\nreturn [\n    \"test\" =\u003e \"Test string\",\n    \"test_2\" =\u003e [\n        \"new\" =\u003e \"Test string\"\n    ]\n];\n```\n\n## Change log\n\nPlease see the [changelog](changelog.md) for more information on what has changed recently.\n\n## Testing\n\n``` bash\n$ composer test\n```\n\n## Contributing\n\nPlease see [contributing.md](contributing.md) for details and a todolist.\n\n## Security\n\nIf you discover any security related issues, please email info@awescrm.de instead of using the issue tracker.\n\n## Credits\n\n- [Galymzhan Begimov](https://github.com/begimov)\n- [All Contributors](contributing.md)\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawes-io%2Flocalization-helper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fawes-io%2Flocalization-helper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawes-io%2Flocalization-helper/lists"}