addweb/gtranslate-bundle
Symfony 7 bundle to integrate the GTranslate.io widget without copy‑pasting scripts. Configure via gtranslate.yaml, supports dropdown/float/dwf variants, provides a gtranslate_widget() Twig function with optional per-call overrides for script and settings.
<script> injection. This aligns well with Symfony’s templating and configuration paradigms.gtranslate.yaml) and may need runtime overrides (e.g., per-route language settings), which could complicate deployment pipelines.| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Symfony Version Lock | High | Test compatibility with target Symfony version; consider forking if needed. |
| Third-Party JS Dependency | High | Implement fallback mechanisms (e.g., local JS cache, polyfills) and monitor GTranslate.io’s uptime. |
| Twig Dependency | Medium | Ensure all templates use the Twig function (gtranslate_widget()) consistently. |
| Configuration Drift | Medium | Document config defaults and validate against production environments. |
| No Laravel Support | Critical | If using Laravel, evaluate alternatives (e.g., custom JS integration or Laravel-specific packages). |
gtranslate_widget() in templates (e.g., base layout).config/packages/gtranslate.yaml.<script> tags, i18n libraries).composer require addweb/gtranslate-bundle:"*@dev"
gtranslate.yaml with default settings.base.html.twig).{{ gtranslate_widget() }}.{{ gtranslate_widget({'languages': ['en', 'de']}) }}).feature() function).symfony/flex or symfony/requirements:
symfony check:requirements
gtranslate.yaml in pipelines.composer.json to avoid breaking changes:
"addweb/gtranslate-bundle": "^1.0.0"
GTRANSLATE_SCRIPT_SRC).defer or async attributes.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| GTranslate.io CDN down | Widget broken, translation UX | Fallback to static language links. |
| JavaScript disabled | Widget invisible | Provide a text-based language selector. |
| Configuration misalignment | Widget renders incorrectly | Validate config via tests. |
| Symfony/Twig upgrade | Bundle compatibility break | Test in staging before production. |
| GTranslate.io API changes | Widget stops working | Monitor their changelog. |
How can I help you explore Laravel packages today?