Translate big text in Laravel I have a TOS (terms of use) that I need to translate in two languages, how can I translate a text this big in Laravel? I'm using both language folders for en and pt-BR and also the pt-BR.json for strings as key for things like: "Verify Your Email Address", but now I got to a point where I need to translate a big TOS with several paragraphs, how can I do that?
You'd really be best off hiring a native speaker to do it if you care about accuracy, especially when it matters like something legal.
@cronix it's not the case here, I have that written already, I want to know how to display that using the translation feature of Laravel
Just insert two different views with a blade @if tag wrapping an @include
@if($lang == 'BR')
@include('_terms_br')
@else
@include('_terms_en')
@endif
@snapey Thank you, I think I will using a library called mcamara/laravel-localization and create a view for each term
i know its older but I figured i'd post my idea (it's a bit more dynamic). something along the lines of:
@if(session()->has('lang'))
@if(view()->exists('locale.includes.'.session()->get('lang').'.terms-of-use'))
@include('locale.includes.'.session()->get('lang').'.terms-of-use')
@else
@include('locale.includes.'.config('app.fallback_locale').'.terms-of-use')
@endif
@else
@include('locale.includes.'.config('app.fallback_locale').'.terms-of-use')
@endif
and then you just build the availability in your files directory. no need to touch the code again.
Please sign in or create an account to participate in this conversation.