{"id":26229611,"url":"https://github.com/sharpapi/nova-ai-translator","last_synced_at":"2026-02-21T12:01:25.914Z","repository":{"id":262109470,"uuid":"886199740","full_name":"sharpapi/nova-ai-translator","owner":"sharpapi","description":"Laravel Nova 4 AI-powered translation Action with SharpAPI.com","archived":false,"fork":false,"pushed_at":"2025-04-08T05:17:49.000Z","size":338,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-28T10:45:48.136Z","etag":null,"topics":["ai","composer-package","laravel","laravel-package","nova","nova-extension","nova-pack","package","translation"],"latest_commit_sha":null,"homepage":"https://sharpapi.com/en/blog/post/effortless-translations-with-ai-in-laravel-nova","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/sharpapi.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":"2024-11-10T13:18:01.000Z","updated_at":"2025-04-08T05:17:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"900fa334-06ce-4b4d-8453-faaedf8565c9","html_url":"https://github.com/sharpapi/nova-ai-translator","commit_stats":null,"previous_names":["sharpapi/nova-ai-translator"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/sharpapi/nova-ai-translator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharpapi%2Fnova-ai-translator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharpapi%2Fnova-ai-translator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharpapi%2Fnova-ai-translator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharpapi%2Fnova-ai-translator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sharpapi","download_url":"https://codeload.github.com/sharpapi/nova-ai-translator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharpapi%2Fnova-ai-translator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29680147,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T11:29:27.227Z","status":"ssl_error","status_checked_at":"2026-02-21T11:29:20.292Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["ai","composer-package","laravel","laravel-package","nova","nova-extension","nova-pack","package","translation"],"created_at":"2025-03-12T22:17:04.754Z","updated_at":"2026-02-21T12:01:25.908Z","avatar_url":"https://github.com/sharpapi.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SharpAPI AI Translator for Laravel Nova\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/sharpapi/nova-ai-translator.svg?style=flat-square)](https://packagist.org/packages/sharpapi/nova-ai-translator)\n[![Total Downloads](https://img.shields.io/packagist/dt/sharpapi/nova-ai-translator.svg?style=flat-square)](https://packagist.org/packages/sharpapi/nova-ai-translator)\n\nWelcome to **SharpAPI AI Translator for Laravel Nova** – the package that’s here to make your content translation smoother and smarter with the power of SharpAPI's [Advanced Text Translator AI API](https://sharpapi.com/en/catalog/ai/content-marketing-automation/advanced-text-translator) and to leverage [AI for Laravel](https://SharpAPI.com/). This package extends the already-awesome [Spatie's `laravel-translatable`](https://spatie.be/docs/laravel-translatable/) with a Nova action you can trigger from your resource’s edit or list views.\n\n`🤖 Initiate AI Translation` can be run from either:\n- **The Nova resources list view:**\n  \u003e \u003cimg src=\"images/form-open-list.png\" title=\"Form Open From the List\"  style=\"max-width: 700px;\" /\u003e\n\n- **Or from the edit screen of an individual resource:**\n  \u003e \u003cimg src=\"images/form-open.png\" title=\"Form Open Menu\"  style=\"max-width: 700px;\"/\u003e\n\nHere's the form you’ll use to dispatch the translation:\n\u003e \u003cimg src=\"images/form.png\" title=\"Form PopUp\"  style=\"max-width: 500px;\" /\u003e\n\n## Requirements\n\n- **Laravel**: ^10.48.29+\n- **Laravel Nova**: 4.0+\n- **PHP**: 8.1+\n- **spatie/laravel-translatable**: used for detecting translatable fields\n\n## Installation \u0026 Configuration\n\n### 1. Install the package via Composer\n\n```bash\ncomposer require sharpapi/nova-ai-translator\n```\n\n### 2. API Key Configuration\n\nYou’ll need an API key from [SharpAPI.com](https://SharpAPI.com/). Add it to your `.env` file like so:\n\n```\nSHARP_API_KEY=your-sharp-api-key\n```\n\n### 3. Supported Locales Configuration\n\nAdd your supported locales in `config/app.php` under the `locales` key:\n\n```php\nreturn [\n   'locales' =\u003e [\n       'en' =\u003e 'English',\n       'es' =\u003e 'Spanish',\n       'fr' =\u003e 'French',\n       // Add other supported languages here\n   ],\n];\n```\n\n### 4. Add to Nova Resource Models\n\nFor any model you want to translate, make sure it:\n- Uses Spatie’s `HasTranslations` trait.\n- Specifies which attributes are `translatable`.\n- **[OPTIONAL], yet Highly Recommended**: Use `Actionable` and `Notifiable` traits to track actions and notifications. This ensures you can log and monitor translation progress effectively.\n\nExample:\n\n```php\nnamespace App;\n\nuse Laravel\\Nova\\Actions\\Actionable;\nuse Illuminate\\Notifications\\Notifiable;\nuse Spatie\\Translatable\\HasTranslations;\n\nclass BlogPost\n{\n   use Actionable, Notifiable, HasTranslations;\n\n   protected $translatable = ['title', 'subtitle', 'content'];\n}\n```\n\n### 5. Attach the Action in a Nova Resource\n\nAdd the `TranslateModel` action to any Nova resource, such as `BlogPost`:\n\n```php\nuse SharpAPI\\NovaAiTranslator\\Actions\\TranslateModel;\n\npublic function actions()\n{\n   return [\n       (new TranslateModel())-\u003eenabled(),\n   ];\n}\n```\n\n### 6. Queue Setup\n\nThe `TranslateModel` action runs as a queued job, which is essential for smooth, asynchronous processing. Make sure your app’s queue is up and running for best results.\n\n## Using the TranslateModel Action\n\n- From the resource’s edit screen, trigger the `TranslateModel` action.\n- A form will pop up where you can select the source and target languages and choose an optional tone.\n- **Note**: The action checks if all target language fields already contain content. If they do, you’ll be prompted to clear these fields first if you want a fresh AI-generated translation.\n- Once triggered, the action queues the job, and you can monitor its progress if your model uses the `Actionable` and `Notifiable` traits.\n\n### Tips\n\n- **Translation logs**: Helpful for tracking what was translated.\n  \u003e \u003cimg src=\"images/actions-log.png\" width=\"750\"/\u003e\n\n- **Error handling**: With `Laravel\\Nova\\Actions\\Actionable`, you get detailed logs if something goes awry.\n  \u003e \u003cimg src=\"images/actions-log-error.png\" width=\"750\"/\u003e\n\n## Changelog\n\nSee [CHANGELOG](CHANGELOG.md) for recent updates.\n\n## Credits\n\n- [A2Z WEB LTD](https://github.com/a2zwebltd)\n- [Dawid Makowski](https://github.com/makowskid)\n- Powered by [SharpAPI](https://sharpapi.com/) – your go-to for leveling up with [AI in Laravel](https://sharpapi.com/en/tag/laravel).\n\n## License\n\nLicensed under the MIT License – see the [License File](LICENSE.md) for details.\n\n## Follow SharpAPI for More!\n\nStay tuned for updates, tips, and tricks:\n- [SharpAPI X (formerly Twitter)](https://x.com/SharpAPI)\n- [SharpAPI YouTube](https://www.youtube.com/@SharpAPI)\n- [SharpAPI Vimeo](https://vimeo.com/SharpAPI)\n- [SharpAPI LinkedIn](https://www.linkedin.com/products/a2z-web-ltd-sharpapicom-automate-with-aipowered-api/)\n- [SharpAPI Facebook](https://www.facebook.com/profile.php?id=61554115896974)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharpapi%2Fnova-ai-translator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsharpapi%2Fnova-ai-translator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharpapi%2Fnova-ai-translator/lists"}