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

amoktar's avatar

How to use laravel built-in translations

Hello, How can I use the built-in translations like if I need to show words like yes, do I have to add it to my lang/text.php

__('text.yes')

I mean it is already stored somewhrere in laravel translation.

Thanks

0 likes
5 replies
amoktar's avatar

@Nakov Thanks for respond, I'm asking if I want to use the built-in translations, for strings like yes or no do I have to add to lang/en/text.php ?

Snapey's avatar
Snapey
Best Answer
Level 122

@amoktar There are no built-in translations like 'yes' and 'no'. You can see all the shipped translations in the resources/lang folder

1 like
imranafzal02's avatar

Create a file under lang/en/text.php and return an array from this like this

	<?php 
	return [
			'yes' => 'Yes'
	];

Then create the files with the same name in every language directory with the same array containing same keys but different translated value.

Please or to participate in this conversation.