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

Add i18n configuration for system installed captions #4011

Merged
merged 5 commits into from
Dec 17, 2024

Conversation

ahmed-mgd
Copy link
Contributor

Fixes #1198

@ahmed-mgd
Copy link
Contributor Author

Several entries are commented out in zh-CN.yml (including captions for development and user-shared apps) and I was wondering why that is

Comment on lines 3 to 9
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"
Copy link
Contributor

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_readers 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.

@johrstrom johrstrom self-requested a review December 17, 2024 15:22
Copy link
Contributor

@johrstrom johrstrom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@johrstrom johrstrom merged commit f26058b into master Dec 17, 2024
25 checks passed
@johrstrom johrstrom deleted the sys-captions-i18n branch December 17, 2024 15:23
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.

System installed captions are not i18n configurable
3 participants