-
Notifications
You must be signed in to change notification settings - Fork 235
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
I18n lazy lookup, closes #272 #279
base: master
Are you sure you want to change the base?
Conversation
To be more clear - adding my |
Ok - that's because the |
@mbajur Can you add a test for that in a separate |
lib/cell/i18n.rb
Outdated
def t(*args) | ||
options = args.last.is_a?(Hash) ? args.pop.dup : {} | ||
key = args.shift | ||
cell_name = self.class.to_s.delete('Cell').underscore |
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.
This is deleting too much from the name (e.g. 'MenuCell'.delete('Cell') # => 'Mnu'
) ... I'd suggest e.g. gsub(/Cell\Z/, '')
instead.
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.
yeah, that's exactly what i've done locally but forgot to send a PR for that. thanks
Yeah, i'd love to but i don't have much time for that right now. But i'll do that for sure in upcoming days. |
Great addition, too bad it stalled. 😢 |
Related to: #272
Ok, here is the raw module file. But still, after hundreds of attempts, i'm still not able to make it work as it should - using
t('.something')
is not being overwriten and produces an error. It would be great if you could advice me on how that module should be actually used with cells. Included by default? Included separately for each cell?Sorry but i just think i'm missing something simple in here; no matter what i try, my overwrite is not visible from a single cell perspective and results in error