-
Notifications
You must be signed in to change notification settings - Fork 879
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
Translatable with fallbacks #4267
Conversation
[ci skip] [skip ci]
Thank you @pxpm . I'll take a look as soon as we're done with the MUSTs in the v5 board. Please take a look at the email I just sent for perspective 💪 Let's do this!!! |
Is there any way this fix be extended to the show.blade.php as well? It corrects the functionality on edit but you can still only preview/show the default locale. |
# Conflicts: # src/app/Http/Controllers/Operations/UpdateOperation.php
[ci skip] [skip ci]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Appologies for taking a long time to review this Pedro. But I gave it a look on Tuesday and my spidey-sense was triggered. Wanted to sleep on it. After I looked at it today, I think I know what triggered my spidey-sense, let's see if my concerns are valid:
Seems like this makes changes in other operations that UpdateOperation. Namely List and Show. Why? Is that really necessary? From my last comment on it I was under the impression we only needed to change the behaviour on the UpdateOperation, for translatable items. Which would be like 10% of users. The way this is coded now, it would affect 100% of all users. Some translatable methods are called even if they're not using translatable... for all major operations. Yikes! See my other inline comment where I ask if that's necessary to change ListOperation and ShowOperation, let's investigate a bit. Maybe I have my green light and don't remember it 🤷♂️
# Conflicts: # src/resources/lang/en/crud.php
[ci skip] [skip ci]
I've just gone through the bug report. To me it does NOT look like anybody has requested a Excellent screenshots, thank you Pedro 🙏 I have a much clearer picture of how it all looks and works now, thank you. The bubble/notification needs a little beautifying here:
I don't remember planning/agreeing to create this I don't think having
Help me figure out (1) please @pxpm . Let me know if you still this is worth doing after my objections above. And how this config came to be, I really don't remember. |
For me this PR streamlines the whole translation process. Every time we get a model, we set the appropriate locale on it, I really don't care if we called it show, update or list operation. We get a model (In CRUD), and we set the locale on that model.
I've proposed this solution on other situations and you never agreed to that solution. and IMO you were right and that's why we had other solution in place to don't recommend this. Basically our Plus, the settings Spatie provides, are either:
We use the later, so we have 3 layers of translation "per model".
I think there is no sense arguing this here. ################################ Regarding what we can actually change in this PR:
I personally I don't link the link, would have preferred the buttons, but 🤷 |
[ci skip] [skip ci]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'm happy with the implementation now. Thank you Pedro. Let's do a first round of polish please! I see quite a few things here that could use a second look.
[ci skip] [skip ci]
[ci skip] [skip ci]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gave it another look. Love it. Good to go imho!
Co-authored-by: Cristian Tăbăcitu <[email protected]>
WHY
BEFORE - What was wrong? What was happening before this PR?
replaces #4262
Applies the solution me and @tabacitu discussed detailed here: #4100 (comment)