Internationalization in Symfony
Implement a basic field-level translation in a Symfony project.
Alternatively, open Settings → Internationalization → Languages and add Spanish (es).
- In the
articlecontent type block, set thetitleandcontentfields as Translatable. - Open each article, select the Spanish language, and add translations to every field. You can also use AI Translations.
Add the language prefix
Section titled “Add the language prefix”In the code editor, update the route configuration to support the language path.
resource: '@StoryblokBundle/config/routes/webhook.php'storyblok_content_type:resource: '@StoryblokBundle/config/routes/content_type.php' prefix: es: '/es' en: ''The Symfony bundle automatically handles the multilingual routing and fetches the content that matches the locale prefix.
To configure the language in the controller logic or the templates, access the current locale using the request object.
Related resources
Section titled “Related resources”Was this page helpful?
This site uses reCAPTCHA and Google's Privacy Policy. Terms of Service apply.
Get in touch with the Storyblok community