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

Fix translations loaded when not needed #4955

Merged

Conversation

MrCrayon
Copy link
Collaborator

This PR only moves translations loading after check $default == $locale that has a return and does not need translations to be loaded.

This because when current locale is the default one we don't need to load translations when getTranslateAttribute is called.

This PR only moves translations loading after check `$default == $locale` that has a return and does not need translations to be loaded.

This because when current locale is the default one we don't to load translations when getTranslateAttribute is called.
@codecov
Copy link

codecov bot commented May 26, 2020

Codecov Report

Merging #4955 into 1.4 will not change coverage.
The diff coverage is 75.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##                1.4    #4955   +/-   ##
=========================================
  Coverage     62.96%   62.96%           
  Complexity     1372     1372           
=========================================
  Files           194      194           
  Lines          4007     4007           
=========================================
  Hits           2523     2523           
  Misses         1484     1484           
Impacted Files Coverage Δ Complexity Δ
src/Traits/Translatable.php 37.65% <75.00%> (ø) 61.00 <0.00> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cbf9cee...9467137. Read the comment docs.

@emptynick emptynick merged commit b099792 into thedevdojo:1.4 May 31, 2020
rozaverta added a commit to rozaverta/voyager that referenced this pull request Jul 7, 2020
@MrCrayon MrCrayon deleted the fix-translations-loaded-when-not-needed branch August 10, 2020 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants