Skip to content

Internationalization in Symfony

Learn how to create a basic implementation of field-level translation in an Astro project.

Alternatively, go to Settings > Internationalization > Languages and add es (Spanish).

  • In the article content type block schema, set the title and content fields as translatable.
  • Go to each article, select the Spanish language, and provide translated content. You can also use AI Translations.

Update the route configuration to support language paths.

config/routes/storyblok.yaml storyblok_webhook
resource: '@StoryblokBundle/config/routes/webhook.php'
storyblok_content_type:
resource: '@StoryblokBundle/config/routes/content_type.php'
+ prefix:
+ es: '/es'
+ en: ''

The Storyblok Symfony bundle will automatically handle the multilingual routing and will fetch the content based on the locale prefix.

Use the language in your controller logic or in your templates, by accessing the current locale using the request object.