Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

user_hkcl's avatar

Translating only a portion of page

Hii all,

I have to translate only a portion of page,not whole website.i am using google translate plugin but it translate whole application.How can i do this? \

Thanks in Advance :)

0 likes
6 replies
erezt's avatar
erezt
Best Answer
Level 1

I think you should read just a bit about localization. Then you can dispatch an event that would call the API and translate your localization folders and then in your blade wrap your text:

@lang('key.value')

user_hkcl's avatar

@erezt Yes I am new to this. I have to display my html form label in english .Whenever user select other language only some of the element of this page need to be translated, not entire page please suggest how this can be achieved.Thanks.

Sinnbeck's avatar

If you wish to use google translate I already told you how :)

<div class="notranslate">
Text in english
</div>
<div>
Text to translate
</div>
<div class="notranslate">
More text in english
</div>
1 like
user_hkcl's avatar

@resin01 But i don't want to use the class="notranslate" every where in the application .

Please or to participate in this conversation.