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

Fixes #31361 - Mark strings translatable for infrastructure page #8420

Merged
merged 1 commit into from
Mar 30, 2021

Conversation

upadhyeammit
Copy link
Contributor

No description provided.

@theforeman-bot
Copy link
Member

Issues: #31361

@@ -1,9 +1,9 @@
<% origin = @data.settings[:origin] %>
<h4 class="header">
<% if origin %>
<%= N_('Run Distribution Chart for %s') % origin %>
<%= _('Run Distribution Chart for %s') % origin %>
Copy link
Member

Choose a reason for hiding this comment

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

This is going to be for my understanding because I couldn't find it (_ and N_ are hard search terms): what's the difference between N_() and _()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hello,

The wiki page says To mark something for translation (but not translate) use N_("String"). As per my understanding we should only skip translations on product names, specific technical terms etc. I also checked if we have any guidelines on which strings should not be translated but didn't get anything specific. Accordingly this should be translated and should not be skipped.

https://projects.theforeman.org/projects/foreman/wiki/Translating

Copy link
Member

Choose a reason for hiding this comment

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

N_() is used to mark strings that should be translated (i.e. extracted to the translation team), but can't be translated at runtime due to no locale present when they are accessed (think for example inside models). Generally, strings inside controllers, helpers, and views should use _(), while strings elsewhere (for the most part) should use N_().

Copy link
Member

@tbrisker tbrisker left a comment

Choose a reason for hiding this comment

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

Thanks @upadhyeammit !

@tbrisker tbrisker merged commit 329c17d into theforeman:develop Mar 30, 2021
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.

4 participants