> Symfony 7 >

Course Overview

Login to bookmark this course

Bonjour-> Hello-> Hola: Traduce tu Sitio

Unleash the magic of Symfony's Translation component. Translate content, use localized routing, add a language switcher and connect to a translation provider!

  • intermediate
  • 158 students
  • EN/ES Captions
  • EN/ES Script
  • Certificate of Completion

Your Guides

About this course

What PHP libraries does this tutorial use?

// composer.json
{
    "require": {
        "php": ">=8.2",
        "ext-ctype": "*",
        "ext-iconv": "*",
        "doctrine/dbal": "^3.9.4", // 3.9.4
        "doctrine/doctrine-bundle": "^2.14", // 2.14.0
        "doctrine/doctrine-migrations-bundle": "^3.4.2", // 3.4.2
        "doctrine/orm": "^3.3.3", // 3.3.3
        "league/commonmark": "^2.7", // 2.7.0
        "symfony/asset": "7.2.*", // v7.2.0
        "symfony/asset-mapper": "7.2.*", // v7.2.5
        "symfony/console": "7.2.*", // v7.2.6
        "symfony/crowdin-translation-provider": "7.2.*", // v7.2.0
        "symfony/dotenv": "7.2.*", // v7.2.0
        "symfony/flex": "^2.5.1", // v2.5.1
        "symfony/framework-bundle": "7.2.*", // v7.2.5
        "symfony/runtime": "7.2.*", // v7.2.3
        "symfony/stimulus-bundle": "^2.25", // v2.25.2
        "symfony/translation": "7.2.*", // v7.2.7
        "symfony/twig-bundle": "7.2.*", // v7.2.0
        "symfony/yaml": "7.2.*", // v7.2.6
        "symfonycasts/tailwind-bundle": "^0.10.0", // v0.10.0
        "twig/extra-bundle": "^2.12|^3.21", // v3.21.0
        "twig/markdown-extra": "^3.21", // v3.21.0
        "twig/string-extra": "^3.21", // v3.21.0
        "twig/twig": "^2.12|^3.21.1" // v3.21.1
    },
    "require-dev": {
        "doctrine/doctrine-fixtures-bundle": "^4.1", // 4.1.0
        "phpunit/phpunit": "^9.6.23", // 9.6.23
        "symfony/browser-kit": "7.2.*", // v7.2.4
        "symfony/css-selector": "7.2.*", // v7.2.0
        "symfony/debug-bundle": "7.2.*", // v7.2.0
        "symfony/maker-bundle": "^1.63", // v1.63.0
        "symfony/monolog-bundle": "^3.0", // v3.10.0
        "symfony/phpunit-bridge": "^7.2.6", // v7.2.6
        "symfony/stopwatch": "7.2.*", // v7.2.4
        "symfony/web-profiler-bundle": "7.2.*", // v7.2.4
        "zenstruck/browser": "^1.9.1", // v1.9.1
        "zenstruck/foundry": "^2.5" // v2.5.0
    }
}

Toma una aplicación Symfony en un solo idioma y conviértela en una experiencia multilingüe utilizando el componente "Traducción". Tomaremos Spacebar, una plataforma de blogs con temática espacial, y haremos que que admita varios idiomas, sin complicar en exceso el código base.

Aprenderás a:

  • Instalar y configurar el componente Traducción de Symfony
  • Traducir rutas y URLs para una navegación adaptada a cada idioma
  • Añadir un conmutador de idiomas a tu interfaz de usuario
  • Organizar mensajes mediante catálogos y dominios
  • Traducir contenido tanto en PHP como en Twig
  • Conectarte a proveedores de traducción de terceros

¡Ya sea que estés preparando tu aplicación para usuarios de todo el mundo o si sólo estás añadiendo soporte para un segundo idioma, este curso te dará las herramientas para hacerlo correctamente!

Next courses in the Symfony 7: Learn More Tricks section of the Symfony 7 Track!

2 Comments

Sort By
Login or Register to join the conversation
Davide-S avatar Davide-S 2 months ago

Will you also talk about the translation of doctrine entities?
...and how to handle translations with the symfony form system?
...and how to generate translated slug for each object?
...and how to manage nested tree of translated objects with translated slug? (a super-pro problem)

I've always preferred the knplabs/doctrine-behaviors solution but sadly is now abandoned.
I know that gedmo/doctrine-extensions could be an alternative but I don't like the fact that the developer have to choose a default locale and the translations are stored in a single big table and the integration with the form system is a bit more difficult

I have no clear solution for that problem.
A tutorial on that wold help a lot.
Thanks

| Reply |

Hey @Davide-S!

We aren't covering database translations in this course.... but stay tuned... I have a followup course that will address at least some of what you discuss... in an interesting way!

--Kevin

1 | Reply |

Delete comment?

Share this comment

astronaut with balloons in space

"Houston: no signs of life"
Start the conversation!