Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.x] Fix for empty fallback_locale #34136

Merged
merged 1 commit into from
Sep 4, 2020
Merged

[6.x] Fix for empty fallback_locale #34136

merged 1 commit into from
Sep 4, 2020

Conversation

ahmedsayedabdelsalam
Copy link
Contributor

// ar
'foo' => ''
// en
'foo', => 'bar'

before
trans('file.foo',[],'ar') // ''

after
trans('file.foo',[],'ar') // 'bar'

#34128

@GrahamCampbell GrahamCampbell changed the title fallback to fallback_locale translation when empty string [6.x] Fix for empty fallback_locale Sep 4, 2020
@taylorotwell taylorotwell merged commit 02e983e into laravel:6.x Sep 4, 2020
@ahmedsayedabdelsalam
Copy link
Contributor Author

I tried to update laravel version but I think this fix is not released yet.

@driesvints
Copy link
Member

@ahmedsayedabdelsalam releases are done on Tuesdays.

@ahmedsayedabdelsalam
Copy link
Contributor Author

Great! Thanks.

driesvints referenced this pull request in illuminate/translation Sep 9, 2020
driesvints added a commit that referenced this pull request Sep 9, 2020
taylorotwell pushed a commit that referenced this pull request Sep 9, 2020
@driesvints
Copy link
Member

We've reverted this as this was a breaking change.

@ahmedsayedabdelsalam
Copy link
Contributor Author

Is there any plan to fix that or this is not an issue?

@driesvints
Copy link
Member

This was the expected behavior and it's unlikely that we'll ever change this.

@ahmedsayedabdelsalam
Copy link
Contributor Author

ahmedsayedabdelsalam commented Sep 9, 2020

Hmmm. Most of Excel Sheet Translation packages pull the not translated languages as an empty string value and I think it's logic because the data type for translations is designed to be strings

For me I'll fix it in my project but I suggest making a config key determines when the translator should fallback if an empty strings or null.

Like: 'fallback_when_empty' => true, // translations.php config file

Anyway thanks for your time.

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.

3 participants