Skip to content

[9.x] Fixes unable to use trans()->has() on JSON language files#47582

Merged
taylorotwell merged 5 commits into
laravel:9.xfrom
crynobone:patch-has-json-lang-string-9
Jun 27, 2023
Merged

[9.x] Fixes unable to use trans()->has() on JSON language files#47582
taylorotwell merged 5 commits into
laravel:9.xfrom
crynobone:patch-has-json-lang-string-9

Conversation

@crynobone

Copy link
Copy Markdown
Member

Using trans()->has() on JSON file is not 100% reliable when the $key and $replacement is the same value.

e.g:

{
    "30 Days": "30 Days"
}
// Before
trans()->has('30 Days') // return false

// After
trans()->has('30 Days') // return true

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
@crynobone crynobone changed the title [9.x] Fixes unable to use tran()->has() on JSON language files. [9.x] Fixes unable to use trans()->has() on JSON language files. Jun 27, 2023
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
@taylorotwell taylorotwell merged commit a6ed3e6 into laravel:9.x Jun 27, 2023
@GrahamCampbell GrahamCampbell changed the title [9.x] Fixes unable to use trans()->has() on JSON language files. [9.x] Fixes unable to use trans()->has() on JSON language files Jun 27, 2023
@crynobone crynobone deleted the patch-has-json-lang-string-9 branch September 20, 2023 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants