Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7704739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:44:54+00:00 2026-05-31T23:44:54+00:00

Since a few weeks I started playing with Symfony2. It seems a very powerful

  • 0

Since a few weeks I started playing with Symfony2.
It seems a very powerful framework, but there are some things I cannot still understand.

In documentation I see that i18n (i.e. Translations) is managed by the Translator service. If I correctly understood, the main way to have a website translated is to put the collection of messages I want to translate inside the different files messages.XX.yml (XX=en,fr,it,etc...), one for each language.

This could be perfect for short texts, which possibly do not include any HTML markup. But how do you deal with long text? For instance, how can I manage the translation of a Terms Of Service or an About page?

I guess I should include different templates for each locale I want to use. Am I right?

Thanks for your help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T23:44:56+00:00Added an answer on May 31, 2026 at 11:44 pm

    You can have long texts in .yml translation file as well as html tags. Put your Terms Of Service text in messages.xx.yml file like this:

    TermsOfServiceText: >
      <p>Here goes my Terms of service code</p>
      <p>It can be put in several lines and <strong>can include html tags!</strong></p>
      <p>It can also include <a href="http://symfony.com/doc/current/book/translation.html" rel="nofollow">links</a></p>
      <p>Just make sure that you put '>' sign after your translation keyword like in the first line of this example code 
      and start your message in next line with double space indentation</p>
    

    Now, in your twig template call translation with this:

    {{ 'TermsOfServiceText'|trans|raw }}
    

    raw is used to skip escaping html tags.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been playing with nservicebus for a few weeks now and since everything
I have some bugs with Chrome. Since a few weeks ago the placeholders don't
A few weeks ago I started noticing that my VS displays some warnings twice.
Silverstripe is running on my since a few weeks. Recently, I get an Internal
Since it came out a few days ago, I am sure at least some
We're getting a very intermittent (like every few weeks someone complains about this) primary
A few weeks ago, I was assigned to evaluate all our programmers. I'm very
hey, Since a few weeks I'm try to program a PHP-Application with the smarty
I'm pretty new with Android programming, started a few weeks ago. Stackoverflow it's my
A few weeks ago I started making a change in my SVN repository's trunk

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.