-
Notifications
You must be signed in to change notification settings - Fork 108
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
Add i18n configuration for system installed captions #4011
Conversation
Several entries are commented out in zh-CN.yml (including captions for development and user-shared apps) and I was wondering why that is |
attr_reader :name, :owner, :caption, :category | ||
attr_reader :name, :owner | ||
|
||
def initialize(name, owner=OodSupport::Process.user.name) | ||
@name = name.to_s | ||
@owner = owner | ||
@caption = I18n.t('dashboard.development_apps_caption') | ||
@category = "Sandbox Apps" |
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 see why you made these changes, but thinking about it, I think I prefer the attr_reader
way. Which is to say, I think I prefer the way this was originally. Maybe we should refactor sys_router
to confirm to this pattern instead of the other way around?
I think I prefer this pattern because using attr_reader
s seems more idiomatic to me, though that could just be an opinion. The other reason I think is performance. @caption
being assigned in the initializer means we only have to do that hash lookup once. Subsequent calls to caption
will just return the value, no need to look it up.
The way you have it now, it has to make lookups all the time - even though the value is constant at this point.
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.
Thanks!
Fixes #1198