{"id":41508865,"url":"https://github.com/thejano/text-translator","last_synced_at":"2026-01-23T19:40:06.282Z","repository":{"id":60882705,"uuid":"546366630","full_name":"thejano/text-translator","owner":"thejano","description":"This package allows to translate text using Google Translator for free without api.","archived":false,"fork":false,"pushed_at":"2025-07-13T19:58:32.000Z","size":45,"stargazers_count":4,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-25T22:13:43.649Z","etag":null,"topics":["api","google","php","translation","translator"],"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/thejano.png","metadata":{"files":{"readme":"readme.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null}},"created_at":"2022-10-06T01:08:13.000Z","updated_at":"2025-07-13T19:58:36.000Z","dependencies_parsed_at":"2024-04-06T13:23:27.715Z","dependency_job_id":"8a7e2cbe-c47a-471d-9f55-b4f18c8ebf3a","html_url":"https://github.com/thejano/text-translator","commit_stats":{"total_commits":30,"total_committers":4,"mean_commits":7.5,"dds":"0.19999999999999996","last_synced_commit":"2cd7e9c6a0df8ee3396f0e678f663e6ca7c4f767"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/thejano/text-translator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thejano%2Ftext-translator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thejano%2Ftext-translator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thejano%2Ftext-translator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thejano%2Ftext-translator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thejano","download_url":"https://codeload.github.com/thejano/text-translator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thejano%2Ftext-translator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28699119,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T17:25:48.045Z","status":"ssl_error","status_checked_at":"2026-01-23T17:25:47.153Z","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":["api","google","php","translation","translator"],"created_at":"2026-01-23T19:40:06.045Z","updated_at":"2026-01-23T19:40:06.274Z","avatar_url":"https://github.com/thejano.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Text Translator for PHP\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/thejano/text-translator.svg?style=flat-square)](https://packagist.org/packages/thejano/text-translator)\n[![Total Downloads](https://img.shields.io/packagist/dt/thejano/text-translator.svg?style=flat-square)](https://packagist.org/packages/thejano/text-translator)\n\n\nThis package allows text translation using Google Translate for free without an API. It extracts the translated text from the Google Translate website. Meanwhile, it only supports Google Translate.\n\nSupported Languages for Google Translate\n\nhttps://cloud.google.com/translate/docs/languages\n\n\n## Requirement\n\nThe package requires:\n- PHP 8.0 or higher\n\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require thejano/text-translator\n```\n\n## Usage\nYou can use the package like below example\n```php\n\u003c?php\n\nrequire_once __DIR__.'/vendor/autoload.php';\n\nuse TheJano\\TextTranslator\\GoogleTranslator;\n\n$text = 'Hello World';\n\n$translator = new GoogleTranslator();\n\n$translated =  $translator-\u003etranslate($text,'ckb'); // ckb stands for Kurdish Sorani language \n\necho $translated; // Prints سڵاو جیهان\n\n# Or Call statically\nGoogleTranslator::translate($text,'ckb'); \n\n# Translate from Arabic to English \nGoogleTranslator::translate('مرحبا بالعالم','en','ar'); // will returns Hello World\n\n\n```\n\u003cbr\u003e\n\nThe class `GoogleTranslator` by default the source language is set to Auto, also you can override and provide target language on initiation.\n```php\nnew GoogleTranslator(string $sourceLanguage = 'auto', string $targetLanguage = '')\n```\n\u003cbr\u003e\n\nThe `translate` method can be called statically or non statically, and it accepts three parameters, which are:\n```php\npublic function _translate(string $text, string $targetLanguage = '', string $sourceLanguage = ''): string;\n```\n\n\n\n## Testing\n\n```bash\ncomposer test\n```\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Credits\n\n- [Dr Pshtiwan](https://github.com/drpshtiwan)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthejano%2Ftext-translator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthejano%2Ftext-translator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthejano%2Ftext-translator/lists"}