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
Translate some texts from Dashboard Page #14963
Translate some texts from Dashboard Page #14963
Conversation
Signed-off-by: Bervianto Leo Pratama <bervianto.leo@gmail.com>
Signed-off-by: Bervianto Leo Pratama <bervianto.leo@gmail.com>
|
Thank you for opening this PR! We appreciate you! For all pull requests coming from third-party forks we will need to A Forem Team member will review this contribution and get back to |
|
@berviantoleo Hey there! Please resolve conflicts! 🙏🏾 |
|
Sure. |
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.
Left a note about the usage of pluralize, thank you @berviantoleo !
| @@ -4,7 +4,7 @@ | |||
| <a class="crayons-link crayons-link--block <%= "crayons-link--current" if params[:action] == "show" && (params[:which] == "organization" || params[:which].blank?) %>" | |||
| href="<%= dashboard_path %>" | |||
| <%= params[:action] == "show" && (params[:which] == "organization" || params[:which].blank?) ? ' aria-current="page"'.html_safe : "" %>> | |||
| Posts | |||
| <%= t("core.post").pluralize %> | |||
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.
You could take a look at https://guides.rubyonrails.org/i18n.html#pluralization for this?
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.
Hi @rhymes , Thank you.
May you elaborate more about this. I'm new at Ruby. Do you mean to use count?
Example:
t("core.post", count: @user.articles_count)
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.
Actually, I follow this thing.
https://github.com/forem/forem/blob/main/app/views/notifications/_nav_menu.html.erb#L10
But if you mean to consider the count too. I will update it.
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.
In this specific case I would just use core.posts and keep the translation pluralized. If ever we ever need counts we're better off adding a separate key. This is what we settled on for tags as well.
| @@ -22,7 +22,7 @@ | |||
| <a class="crayons-link crayons-link--block <%= "crayons-link--current" if params[:action] == "followers" %>" | |||
| href="/dashboard/user_followers" | |||
| <%= params[:action] == "followers" ? ' aria-current="page"'.html_safe : "" %>> | |||
| Followers | |||
| <%= t("core.follower").pluralize %> | |||
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.
same about not using pluralize directly
| @@ -4,7 +4,7 @@ | |||
| <a class="crayons-link crayons-link--block <%= "crayons-link--current" if params[:action] == "show" && (params[:which] == "organization" || params[:which].blank?) %>" | |||
| href="<%= dashboard_path %>" | |||
| <%= params[:action] == "show" && (params[:which] == "organization" || params[:which].blank?) ? ' aria-current="page"'.html_safe : "" %>> | |||
| Posts | |||
| <%= t("core.post").pluralize %> | |||
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.
In this specific case I would just use core.posts and keep the translation pluralized. If ever we ever need counts we're better off adding a separate key. This is what we settled on for tags as well.
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.
Thank you @berviantoleo!
What type of PR is this? (check all applicable)
Description
Translate some texts from Dashboard Page
Related Tickets & Documents
#14888
https://dev.to/devteam/forem-hacktoberfest-let-s-internationalize-404n
QA Instructions, Screenshots, Recordings
Added/updated tests?
[optional] What gif best describes this PR or how it makes you feel?