Showing 7 of 1,216 result(s)
If we look in the resources/lang/en/validation.php resource file, we will see something similar to the following defined at the top of the file: We can retrieve the accepted line like so: $translatedText = __('validation.accepted'); If the above...
For the next example, we will create a new file at resources/lang/es.json to both showcase literal based language files as well as how the $locale parameter can be used. Note: with JSON based language files, there is only one file per locale...
The following examples demonstrate how we can retrieve language translations from within Blade templates:
The get method can be used to retrieve the translation line for the provided $key . This method can also process any replacements within the translation line itself (by passing an array argument for the $replace parameter). This method also...
The signature of the get method is:
In the following examples, we will look at the various ways we can invoke the get method. We will start with simple translation line retrieval and gradually work through using the remaining parameters.
The simplest way to use the get method is to simply ask it to get the value of a translation line. In the following example, we will retrieve the validation.accepted translation line (we will continue to reference the validation translation lines...