{"id":21467401,"url":"https://github.com/elusivecodes/fyrelang","last_synced_at":"2026-02-28T06:16:12.383Z","repository":{"id":62508433,"uuid":"417726952","full_name":"elusivecodes/FyreLang","owner":"elusivecodes","description":"FyreLang is a free, open-source language library for PHP.","archived":false,"fork":false,"pushed_at":"2025-03-23T11:33:10.000Z","size":119,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-12T01:08:01.451Z","etag":null,"topics":["intl","lang","php","translation"],"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/elusivecodes.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":"2021-10-16T05:27:18.000Z","updated_at":"2025-03-23T11:33:02.000Z","dependencies_parsed_at":"2024-11-15T11:20:31.010Z","dependency_job_id":"eb393a89-daa0-4f1a-abff-4e9e07016732","html_url":"https://github.com/elusivecodes/FyreLang","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/elusivecodes/FyreLang","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFyreLang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFyreLang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFyreLang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFyreLang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elusivecodes","download_url":"https://codeload.github.com/elusivecodes/FyreLang/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFyreLang/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261250207,"owners_count":23130537,"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":["intl","lang","php","translation"],"created_at":"2024-11-23T08:17:53.224Z","updated_at":"2026-02-28T06:16:12.272Z","avatar_url":"https://github.com/elusivecodes.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FyreLang\r\n\r\n**FyreLang** is a free, open-source language library for *PHP*.\r\n\r\n\r\n## Table Of Contents\r\n- [Installation](#installation)\r\n- [Basic Usage](#basic-usage)\r\n- [Methods](#methods)\r\n\r\n\r\n\r\n## Installation\r\n\r\n**Using Composer**\r\n\r\n```\r\ncomposer require fyre/lang\r\n```\r\n\r\nIn PHP:\r\n\r\n```php\r\nuse Fyre\\Lang\\Lang;\r\n```\r\n\r\n\r\n## Basic Usage\r\n\r\n- `$config` is a [*Config*](https://github.com/elusivecodes/FyreConfig).\r\n\r\n```php\r\n$lang = new Lang($config);\r\n```\r\n\r\nThe default locale will be resolved from the \"*App.defaultLocale*\" key in the *Config*.\r\n\r\n**Autoloading**\r\n\r\nIt is recommended to bind the *Lang* to the [*Container*](https://github.com/elusivecodes/FyreContainer) as a singleton.\r\n\r\n```php\r\n$container-\u003esingleton(Lang::class);\r\n```\r\n\r\nAny dependencies will be injected automatically when loading from the [*Container*](https://github.com/elusivecodes/FyreContainer).\r\n\r\n```php\r\n$lang = $container-\u003euse(Lang::class);\r\n```\r\n\r\n\r\n## Methods\r\n\r\n**Add Path**\r\n\r\nAdd a language path.\r\n\r\n- `$path` is a string representing the path to add.\r\n- `$prepend` is a boolean indicating whether to prepend the file path, and will default to *false*.\r\n\r\n```php\r\n$lang-\u003eaddPath($path, $prepend);\r\n```\r\n\r\n**Clear**\r\n\r\nClear all language data.\r\n\r\n```php\r\n$lang-\u003eclear();\r\n```\r\n\r\n**Get**\r\n\r\nGet a language value.\r\n\r\n- `$key` is a string representing the key to lookup.\r\n- `$data` is an array containing data to insert into the language string.\r\n\r\n```php\r\n$lang = $lang-\u003eget($key, $data);\r\n```\r\n\r\nSee the [*MessageFormatter::formatMessage*](https://www.php.net/manual/en/messageformatter.formatmessage.php) method for details about message formatting.\r\n\r\n**Get Default Locale**\r\n\r\nGet the default locale.\r\n\r\n```php\r\n$defaultLocale = $lang-\u003egetDefaultLocale();\r\n```\r\n\r\n**Get Locale**\r\n\r\nGet the current locale.\r\n\r\n```php\r\n$locale = $lang-\u003egetLocale();\r\n```\r\n\r\n**Get Paths**\r\n\r\nGet the paths.\r\n\r\n```php\r\n$paths = $lang-\u003egetPaths();\r\n```\r\n\r\n**Remove Path**\r\n\r\nRemove a path.\r\n\r\n- `$path` is a string representing the path to remove.\r\n\r\n```php\r\n$lang-\u003eremovePath($path);\r\n```\r\n\r\n**Set Default Locale**\r\n\r\nSet the default locale.\r\n\r\n- `$locale` is a string representing the locale.\r\n\r\n```php\r\n$lang-\u003esetDefaultLocale($locale);\r\n```\r\n\r\n**Set Locale**\r\n\r\nSet the current locale.\r\n\r\n- `$locale` is a string representing the locale.\r\n\r\n```php\r\n$lang-\u003esetLocale($locale);\r\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felusivecodes%2Ffyrelang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felusivecodes%2Ffyrelang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felusivecodes%2Ffyrelang/lists"}