Support the ongoing development of Laravel.io →
Views
Last updated 3 months ago.
0

You can use the lang files. You don't want to translate the html. You want to translate text nodes. Check the Laravel docs on localization.

eg.

<h1>{{ Lang::get('forms.contact-form.first-name') }}</h1>

It would be better if you could do the translation in a dedicated translator class rather than in the view as well. Then the view is just passed strings that were already translated.

Last updated 3 months ago.
0

Sign in to participate in this thread!

LaraJobs

Your banner here too?

dmitry-php dmitry-php dmitry-php Joined 26 May 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.