Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
c2ed9e34
Commit
c2ed9e34
authored
May 03, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
return key instead of null when language line isn't found.
parent
74022cfa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
lang.php
laravel/lang.php
+7
-2
No files found.
laravel/lang.php
View file @
c2ed9e34
...
@@ -112,13 +112,18 @@ class Lang {
...
@@ -112,13 +112,18 @@ class Lang {
*/
*/
public
function
get
(
$language
=
null
,
$default
=
null
)
public
function
get
(
$language
=
null
,
$default
=
null
)
{
{
// If no default value is specified by the developer, we'll just return the
// key of the language line. This should indicate which language line we
// were attempting to render and is better than giving nothing back.
if
(
is_null
(
$default
))
$default
=
$this
->
key
;
if
(
is_null
(
$language
))
$language
=
$this
->
language
;
if
(
is_null
(
$language
))
$language
=
$this
->
language
;
list
(
$bundle
,
$file
,
$line
)
=
$this
->
parse
(
$this
->
key
);
list
(
$bundle
,
$file
,
$line
)
=
$this
->
parse
(
$this
->
key
);
// If the file does
n'
t exist, we'll just return the default value that was
// If the file does
no
t exist, we'll just return the default value that was
// given to the method. The default value is also returned even when the
// given to the method. The default value is also returned even when the
// file exists and th
e
file does not actually contain any lines.
// file exists and th
at
file does not actually contain any lines.
if
(
!
static
::
load
(
$bundle
,
$language
,
$file
))
if
(
!
static
::
load
(
$bundle
,
$language
,
$file
))
{
{
return
value
(
$default
);
return
value
(
$default
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment