Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Sylius Gemini Local Translate Plugin Laravel Package

barth/sylius-gemini-local-translate-plugin

View on GitHub
Deep Wiki
Context7

SyliusGeminiLocalTranslatePlugin

This plugin adds a translation button to every translatable field in the Sylius admin. It uses Chrome's built-in Gemini Nano model via the Prompt API — all inference runs on-device, no data ever leaves the browser.

Requirements

Installation

$ composer require barth/sylius-gemini-local-translate-plugin
$ yarn install --force
$ yarn build

Symfony configuration

The bundle registers itself automatically via Symfony Flex. Manual registration:

// config/bundles.php
return [
    Barth\SyliusGeminiLocalTranslatePlugin\BarthSyliusGeminiLocalTranslatePlugin::class => ['all' => true],
];

Routes registration

# config/routes.yaml
barth_gemini_local_translate_plugin:
    resource: "@BarthSyliusGeminiLocalTranslatePlugin/config/routes/admin_routing.yaml"

Usage

  1. Go to any Sylius admin translatable field.
  2. Select the target language and register (tone).
  3. Click Translate — the field content is sent to Chrome's local Gemini Nano model.
  4. The translated result replaces the field value.

No data leaves the browser. All inference runs on-device.

[!CAUTION] ⚠️ AI translation can contain errors. Do not rely blindly on the output; always review and verify the generated translations for accuracy and appropriate tone before saving.

Diagnostics

Visit /admin/gemini-local-translate-plugin/diagnostic in your admin to verify that the Chrome Prompt API is available.

Add it to custom translation field

If you added translated fields and the button does not appear, you may add a hook to your form:

sylius_twig_hooks:
  hooks:
    'sylius_admin.my_awesome_entity.create.content.sections.form.translations': 
      gemini_translate_button:
        template: '@BarthSyliusGeminiLocalTranslatePlugin/admin/form/translations/button.html.twig'
        priority: -10

Credits

This plugin was inspired by the GromNaN/local-browser-translator repository.

Demo

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package