{"id":16931897,"url":"https://github.com/leodido/langcode-conv","last_synced_at":"2026-03-04T04:01:10.326Z","repository":{"id":18973952,"uuid":"22194962","full_name":"leodido/langcode-conv","owner":"leodido","description":"Convert language codes to any available format","archived":false,"fork":false,"pushed_at":"2021-07-14T14:54:12.000Z","size":23,"stargazers_count":7,"open_issues_count":5,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-25T06:44:19.999Z","etag":null,"topics":["conversion","hacktoberfest","iso639","language-codes","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leodido.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-24T02:42:35.000Z","updated_at":"2024-05-29T17:00:36.000Z","dependencies_parsed_at":"2022-08-05T02:01:11.599Z","dependency_job_id":null,"html_url":"https://github.com/leodido/langcode-conv","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/leodido/langcode-conv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leodido%2Flangcode-conv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leodido%2Flangcode-conv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leodido%2Flangcode-conv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leodido%2Flangcode-conv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leodido","download_url":"https://codeload.github.com/leodido/langcode-conv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leodido%2Flangcode-conv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30071670,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T03:25:38.285Z","status":"ssl_error","status_checked_at":"2026-03-04T03:25:05.086Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["conversion","hacktoberfest","iso639","language-codes","php"],"created_at":"2024-10-13T20:44:57.367Z","updated_at":"2026-03-04T04:01:10.281Z","avatar_url":"https://github.com/leodido.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Language Codes Converter\n========================\n\n[![Latest Stable Version](http://img.shields.io/packagist/v/leodido/langcode-conv.svg?style=flat-square)](https://packagist.org/packages/leodido/langcode-conv) [![Build Status](https://img.shields.io/travis/leodido/langcode-conv.svg?style=flat-square)](https://travis-ci.org/leodido/langcode-conv) [![Coverage](http://img.shields.io/coveralls/leodido/langcode-conv.svg?style=flat-square)](https://coveralls.io/r/leodido/langcode-conv)\n\nThis library, based on [conversio library](https://github.com/leodido/conversio), is aimed to convert every existing language code to any format you want. No matter which format the input language code is.\n\nDetails\n-------\n\nThe **available output formats** are:\n\n1. `name`\n\n    The international (often english) name of the language\n\n2. `native`\n\n    The language name written in native representation/s\n\n3. `iso639-1`\n\n    The ISO 639-1 (two-letters code) language representation\n    \n4. `iso639-2/t`\n\n    The ISO 639-2/T (three-letters code for terminology applications) language representation\n\n5. `iso639-2/b`\n\n    The ISO 639-2/B (three-letters code, for bibliographic applications) language representation\n\n6. `iso639-3`\n\n    The ISO 639-3 (same as ISO 639-2/T except that for the macrolanguages) language representation\n\nCurrently **184 languages** are fully supported.\n\nExamples\n--------\n\nFirst of all you need to create the conversion adapter and its options class.\n\n```php\nuse Conversio\\Conversion;\nuse Conversio\\Adapter\\LanguageCode;\nuse Conversio\\Adapter\\Options\\LanguageCode;\n// ...\n$adapter = new LanguageCode();\n$options = new LanguageCodeOptions();\n```\n\nThen, you can pass it to the `Conversion` class constructor (from [conversio library](https://github.com/leodido/conversio)):\n\n```php\n$converter = new Conversion($adapter);\n$converter-\u003esetAdapterOptions($options);\n```\n\nOr, compactly:\n\n```php\n$converter = new Conversion(['adapter' =\u003e $adapter, 'options' =\u003e $options]);\n```\n\nFinally we need to specify the desired output format (see above the supported formats) of the conversion and perform it.\n\n```php\n$options-\u003esetOutput('native');\n// ISO 639-1 =\u003e NATIVE\n$converter-\u003efilter('it'); // italiano\n```\n\nWhich ouputs, in this case `italiano`.\n\nHave fun, try other language codes (e.g., `vie`, `tam`).\n\n```php\n// ISO 639-2/T =\u003e NATIVE\n$converter-\u003efilter('vie'); // tiếng việt\n$converter-\u003efilter('tam'); // தமிழ்\n// ISO 639-3 =\u003e NATIVE\n$converter-\u003efilter('yid + 2'); // ייִדיש\n// ISO 639-3 =\u003e NAME\n$options-\u003esetOutput('name');\n$converter-\u003efilter('vie'); // vietnamese\n$converter-\u003efilter('tam'); // tamil\n$converter-\u003efilter('yid + 2'); // yiddish\n```\n\nInstallation\n------------\n\nAdd `leodido/langcode-conv` to your `composer.json`.\n\n```json\n{\n   \"require\": {\n       \"leodido/langcode-conv\": \"v0.3.0\"\n   }\n}\n```\n\nReferences\n----------\n\n- Language codes and schemes [reference](http://en.wikipedia.org/wiki/Language_code)\n- The [ISO 639-1](http://en.wikipedia.org/wiki/ISO_639-1) standard\n- The [ISO 639-2](http://en.wikipedia.org/wiki/ISO_639-2) standard\n- The [ISO 639-3](http://en.wikipedia.org/wiki/ISO_639-3) standard\n- [List](http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) of ISO 639-1 codes\n- [List](http://en.wikipedia.org/wiki/List_of_ISO_639-2_codes) of ISO 639-2 codes\n- [List](http://en.wikipedia.org/wiki/List_of_ISO_639-3_codes) of ISO 639-3 codes\n\n---\n\n[![Analytics](https://ga-beacon.appspot.com/UA-49657176-1/langcode-conv)](https://github.com/igrigorik/ga-beacon)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleodido%2Flangcode-conv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleodido%2Flangcode-conv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleodido%2Flangcode-conv/lists"}