Showing 7 of 1,216 result(s)
In the previous example, we looked at how to retrieve individual translation lines. In this section, we will look at how to process replacements with the translator. Replacements are supplied as a key/value pair. The replacement keys will be...
By default, the get method will look for the translation lines using the locale specified as the default with the translation service. However, we can specify a locale by supplying an argument for the $locale parameter. For the following example,...
The signature of the getFromJson is:
For the following examples, we will create a new JSON-based language file at resources/lang/example.json : In the following example, we will use the getFromJson method to first retrieve the translation line as well as process replacements: You...
The trans method is similar to the get method, and can be used in a similar way. The difference between the two methods is that the trans method does not allow you to change the fallback locale behavior, and defaults to always using the fallback...
The following examples will demonstrate how to make equivalent calls between the trans and the get method. For more detailed explanation of each of the parameters, see the section on the get method. In the following example, we will use the trans...
The has method determines if a translation line exists for the specified locale. It accepts a $key , which corresponds to an array key within the translation group file, i.e., user . The method also accepts a $locale , which can be used to...