{"id":16275145,"url":"https://github.com/chinleung/verbose-localization","last_synced_at":"2025-04-08T16:25:59.878Z","repository":{"id":62501771,"uuid":"200906472","full_name":"chinleung/verbose-localization","owner":"chinleung","description":"A package to allow your class to support verbose localization.","archived":false,"fork":false,"pushed_at":"2019-08-06T19:58:50.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T14:35:21.161Z","etag":null,"topics":["localization","php","verbose"],"latest_commit_sha":null,"homepage":null,"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/chinleung.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-06T18:46:10.000Z","updated_at":"2019-08-06T19:58:52.000Z","dependencies_parsed_at":"2022-11-02T09:46:31.246Z","dependency_job_id":null,"html_url":"https://github.com/chinleung/verbose-localization","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinleung%2Fverbose-localization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinleung%2Fverbose-localization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinleung%2Fverbose-localization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinleung%2Fverbose-localization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chinleung","download_url":"https://codeload.github.com/chinleung/verbose-localization/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247879963,"owners_count":21011557,"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":["localization","php","verbose"],"created_at":"2024-10-10T18:32:10.552Z","updated_at":"2025-04-08T16:25:59.860Z","avatar_url":"https://github.com/chinleung.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Verbose Localization\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/chinleung/verbose-localization.svg?style=flat-square)](https://packagist.org/packages/chinleung/verbose-localization)\n[![Build Status](https://img.shields.io/travis/chinleung/verbose-localization/master.svg?style=flat-square)](https://travis-ci.org/chinleung/verbose-localization)\n[![Quality Score](https://img.shields.io/scrutinizer/g/chinleung/verbose-localization.svg?style=flat-square)](https://scrutinizer-ci.com/g/chinleung/verbose-localization)\n[![Total Downloads](https://img.shields.io/packagist/dt/chinleung/verbose-localization.svg?style=flat-square)](https://packagist.org/packages/chinleung/verbose-localization)\n\nA package to allow your class to support verbose localization.\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require chinleung/verbose-localization\n```\n\n## Usage\n\nAdd the `ChinLeung\\VerboseLocalization\\HasVerboseLocalization` trait to your class and create a method `getTranslationIn(string $locale)` to handle the translation of your class and get access to all the verbose methods instantly like the following example.\n\nSuppose you have files with the translation of the text equivalent of numbers:\n\n``` php\n\u003c?php\n\nclass NumberClass\n{\n    use ChinLeung\\VerboseLocalization\\HasVerboseLocalization;\n\n    /**\n     * Constructor of the class.\n     *\n     * @param  int  $value\n     */\n    public function __construct(int $value)\n    {\n        $this-\u003evalue = $value;\n    }\n\n    /**\n     * Retrieve the translation in a specific locale.\n     *\n     * @param  string  $locale\n     * @return string\n     */\n    public function getTranslationIn(string $locale) : string\n    {\n        $translations = require __DIR__.\"/resources/lang/$locale/numbers.php\";\n\n        return $translations[$this-\u003evalue];\n    }\n}\n```\n\nThen you can retrieve the translations like this:\n\n```\n$number = new NumberClass(1);\n\n$number-\u003einFrench(); // 'un'\n$number-\u003einEnglish(); // 'one'\n$number-\u003einSimplifiedChinese(); // '一'\n```\n\n## Methods\n\nThe methods are seperated by language families which are located in [src/Concerns](https://github.com/chinleung/verbose-localization/tree/master/src/Concerns).\n\n### [Afro-Asiatic](https://github.com/chinleung/verbose-localization/tree/master/src/Concerns/HasAfroAsiaticVerboseMethods.php)\n\n\u003cdetails\u003e\n\u003csummary\u003eView Methods\u003c/summary\u003e\n\n* inAmharic\n* inArabic\n* inHausa\n* inHebrew\n* inMaltese\n* inSomali\n\u003c/details\u003e\n\n### [Austronesian](https://github.com/chinleung/verbose-localization/tree/master/src/Concerns/HasAustronesianVerboseMethods.php)\n\n\u003cdetails\u003e\n\u003csummary\u003eView Methods\u003c/summary\u003e\n\n* inCebuano\n* inFilipino\n* inHawaiian\n* inJavanese\n* inKhmer\n* inMalagasy\n* inMalay\n\u003c/details\u003e\n\n### [Dravidian](https://github.com/chinleung/verbose-localization/tree/master/src/Concerns/HasDravidianVerboseMethods.php)\n\n\u003cdetails\u003e\n\u003csummary\u003eView Methods\u003c/summary\u003e\n\n* inKannada\n* inMalayalam\n* inTamil\n* inTelugu\n\u003c/details\u003e\n\n### [French Creole](https://github.com/chinleung/verbose-localization/tree/master/src/Concerns/HasFrenchCreoleVerboseMethods.php)\n\n\u003cdetails\u003e\n\u003csummary\u003eView Methods\u003c/summary\u003e\n\n* inHaitianCreole\n\u003c/details\u003e\n\n### [Hmong-Mien](https://github.com/chinleung/verbose-localization/tree/master/src/Concerns/HasHmongMienVerboseMethods.php)\n\n\u003cdetails\u003e\n\u003csummary\u003eView Methods\u003c/summary\u003e\n\n* inHmong\n\u003c/details\u003e\n\n### [Indo-European](https://github.com/chinleung/verbose-localization/tree/master/src/Concerns/HasIndoEuropeanVerboseMethods.php)\n\n\u003cdetails\u003e\n\u003csummary\u003eView Methods\u003c/summary\u003e\n    \n* inAlbanian\n* inArmenian\n* inGreek\n\n#### [Balto-Slavic](https://github.com/chinleung/verbose-localization/tree/master/src/Concerns/HasBaltoSlavicVerboseMethods.php)\n\n\u003cdetails\u003e\n\u003csummary\u003eView Methods\u003c/summary\u003e\n    \n* inBelarusian\n* inBosnian\n* inBulgarian\n* inCroatian\n* inCzech\n* inLatvian\n* inLithuanian\n* inMacedonian\n* inPolish\n* inRussian\n* inSerbian\n* inSlovak\n* inSlovenian\n* inUkrainian\n\u003c/details\u003e\n\n#### [Celtic](https://github.com/chinleung/verbose-localization/tree/master/src/Concerns/HasCelticVerboseMethods.php)\n\n\u003cdetails\u003e\n\u003csummary\u003eView Methods\u003c/summary\u003e\n    \n* inIrish\n* inScotsGaelic\n* inWelsh\n\u003c/details\u003e\n\n#### [Germanic](https://github.com/chinleung/verbose-localization/tree/master/src/Concerns/HasGermanicVerboseMethods.php)\n\n\u003cdetails\u003e\n\u003csummary\u003eView Methods\u003c/summary\u003e\n    \n* inAfrikaans\n* inDanish\n* inDutch\n* inEnglish\n* inFrisian\n* inGerman\n* inIcelandic\n* inLuxembourgish\n* inNorwegian\n* inSwedish\n* inYiddish\n\u003c/details\u003e\n\n#### [Indo-Iranian](https://github.com/chinleung/verbose-localization/tree/master/src/Concerns/HasIndoIranianVerboseMethods.php)\n\n\u003cdetails\u003e\n\u003csummary\u003eView Methods\u003c/summary\u003e\n    \n* inBengali\n* inGujarati\n* inHindi\n* inKurmanjiKurdish\n* inMarathi\n* inNepali\n* inPashto\n* inPersian\n* inPunjabi\n* inSindhi\n* inSinhala\n* inTajik\n* inUrdu\n\u003c/details\u003e\n\n#### [Italic](https://github.com/chinleung/verbose-localization/tree/master/src/Concerns/HasItalicVerboseMethods.php)\n\n\u003cdetails\u003e\n\u003csummary\u003eView Methods\u003c/summary\u003e\n    \n* inCatalan\n* inCorsican\n* inFrench\n* inGalician\n* inItalian\n* inLatin\n* inPortuguese\n* inRomanian\n* inSpanish\n\u003c/details\u003e\n\n\u003c/details\u003e\n\n### [Isolate](https://github.com/chinleung/verbose-localization/tree/master/src/Concerns/HasIsolateVerboseMethods.php)\n\n\u003cdetails\u003e\n\u003csummary\u003eView Methods\u003c/summary\u003e\n\n* inBasque\n* inEsperanto\n\u003c/details\u003e\n\n### [Japonic](https://github.com/chinleung/verbose-localization/tree/master/src/Concerns/HasJaponicVerboseMethods.php)\n\n\u003cdetails\u003e\n\u003csummary\u003eView Methods\u003c/summary\u003e\n\n* inJapanese\n\u003c/details\u003e\n\n### [Kartvelian](https://github.com/chinleung/verbose-localization/tree/master/src/Concerns/HasKartvelianVerboseMethods.php)\n\n\u003cdetails\u003e\n\u003csummary\u003eView Methods\u003c/summary\u003e\n\n* inGeorgian\n\u003c/details\u003e\n\n### [Koreanic](https://github.com/chinleung/verbose-localization/tree/master/src/Concerns/HasKoreanicVerboseMethods.php)\n\n\u003cdetails\u003e\n\u003csummary\u003eView Methods\u003c/summary\u003e\n\n* inKorean\n\u003c/details\u003e\n\n### [Kra-Dai](https://github.com/chinleung/verbose-localization/tree/master/src/Concerns/HasKraDaiVerboseMethods.php)\n\n\u003cdetails\u003e\n\u003csummary\u003eView Methods\u003c/summary\u003e\n\n* inLao\n* inThai\n\u003c/details\u003e\n\n### [Monogolic](https://github.com/chinleung/verbose-localization/tree/master/src/Concerns/HasMonogolicVerboseMethods.php)\n\n\u003cdetails\u003e\n\u003csummary\u003eView Methods\u003c/summary\u003e\n\n* Mongolian\n\u003c/details\u003e\n\n### [Niger-Congo](https://github.com/chinleung/verbose-localization/tree/master/src/Concerns/HasNigerCongoVerboseMethods.php)\n\n\u003cdetails\u003e\n\u003csummary\u003eView Methods\u003c/summary\u003e\n\n* inChewa\n* inChichewa\n* inIgbo\n* inSesotho\n* inShona\n* inSwahili\n* inXhosa\n* inYoruba\n* inZulu\n\u003c/details\u003e\n\n### [Sino-Tibetan](https://github.com/chinleung/verbose-localization/tree/master/src/Concerns/HasSinoTibetanVerboseMethods.php)\n\n\u003cdetails\u003e\n\u003csummary\u003eView Methods\u003c/summary\u003e\n\n* inBurmeseMyanmar\n* inSimplifiedChinese\n* inTraditionalChinese\n\u003c/details\u003e\n\n### [Turkic](https://github.com/chinleung/verbose-localization/tree/master/src/Concerns/HasTurkicVerboseMethods.php)\n\n\u003cdetails\u003e\n\u003csummary\u003eView Methods\u003c/summary\u003e\n\n* inAzerbaijani\n* inKazakh\n* inKyrgyz\n* inTurkish\n* inUzbek\n\u003c/details\u003e\n\n### [Uralic](https://github.com/chinleung/verbose-localization/tree/master/src/Concerns/HasUralicVerboseMethods.php)\n\n\u003cdetails\u003e\n\u003csummary\u003eView Methods\u003c/summary\u003e\n\n* inEstonian\n* inFinnish\n* inHungarian\n\u003c/details\u003e\n\n### Testing\n\n``` bash\ncomposer test\n```\n\n### Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n### Security\n\nIf you discover any security related issues, please email hello@chinleung.com instead of using the issue tracker.\n\n## Credits\n\n- [Chin Leung](https://github.com/chinleung)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n\n## PHP Package Boilerplate\n\nThis package was generated using the [PHP Package Boilerplate](https://laravelpackageboilerplate.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchinleung%2Fverbose-localization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchinleung%2Fverbose-localization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchinleung%2Fverbose-localization/lists"}