Methods summary
protected
|
#
__construct( string $key, array $replacements = array(), string $language = null )
Create a new Lang instance.
Create a new Lang instance.
Parameters
- $key
string $key
- $replacements
array $replacements
- $language
string $language
|
public static
Laravel\Lang
|
#
line( string $key, array $replacements = array(), string $language = null )
Create a new language line instance.
Create a new language line instance.
$line = Lang::line('validation.required');
$line = Lang::line('admin::messages.welcome');
$line = Lang::line('validation.required', array('attribute' => 'email'));
Parameters
- $key
string $key
- $replacements
array $replacements
- $language
string $language
Returns
|
public static
boolean
|
#
has( string $key, string $language = null )
Determine if a language line exists.
Determine if a language line exists.
Parameters
- $key
string $key
- $language
string $language
Returns
boolean
|
public
string
|
#
get( string $language = null, string $default = null )
Get the language line as a string.
Get the language line as a string.
$line = Lang::line('validation.required')->get();
$line = Lang::line('validation.required')->get('sp');
$line = Lang::line('validation.required')->get(null, 'Default');
Parameters
- $language
string $language
- $default
string $default
Returns
string
|
protected
array
|
#
parse( string $key )
Parse a language key into its bundle, file, and line segments.
Parse a language key into its bundle, file, and line segments.
Language lines follow a {bundle}::{file}.{line} naming convention.
Parameters
Returns
array
|
public static
boolean
|
#
load( string $bundle, string $language, string $file )
Load all of the language lines from a language file.
Load all of the language lines from a language file.
Parameters
- $bundle
string $bundle
- $language
string $language
- $file
string $file
Returns
boolean
|
public static
array
|
#
file( string $bundle, string $language, string $file )
Load a language array from a language file.
Load a language array from a language file.
Parameters
- $bundle
string $bundle
- $language
string $language
- $file
string $file
Returns
array
|
protected static
string
|
#
path( string $bundle, string $language, string $file )
Get the path to a bundle's language file.
Get the path to a bundle's language file.
Parameters
- $bundle
string $bundle
- $language
string $language
- $file
string $file
Returns
string
|
public
string
|
#
__toString( )
Get the string content of the language line.
Get the string content of the language line.
Returns
string
|