-
Notifications
You must be signed in to change notification settings - Fork 445
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
Allow implicit locale in component file names #2118
Conversation
Thanks for the PR! I should have time to look at this tomorrow and flesh out some edge cases ❤️ |
You're very welcome! Let me know how/if I can help! |
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.
I tweaked this a little to keep the changes within Compiler
. Thanks for your help in solving this bug! We should probably revisit this change to make a more robust fix, but I'm going to ship what we have here to unblock you ❤️
What are you trying to accomplish?
I'm proposing a fix for Issue#2113.
The refactor of the compiler in v.3.15 changed the way the format is used to define
@call_method_name
, used in the template to compile to component.What approach did you choose and why?
Once I had understood what the problem was, I tried to see why it was working in previous versions (<3.15). The method name was not defined in the same way back then, and it didn't use the format at all, only the variant.
From this I assessed that it would be enough to exclude the locale from the format when building the
@call_method_name
. I created a new method that excludes anything before the.
in formats received from the controller, and I use it to define if something needs to be appended tocall_
.What might be a bit clumsy is this new
format_without_locale
method, as it literally takes the format symbol from@this_format
, looks for a.
character and assumes the format is at the end.I chose this solution however because it does not modify
@this_format
, which keeps the locale in if there is any.