AO3-7409 Adjust header and page subtitle for managing invitations#5780
AO3-7409 Adjust header and page subtitle for managing invitations#5780jmalark wants to merge 1 commit intootwcode:masterfrom
Conversation
7c2db7e to
646a997
Compare
01ff6ed to
a560bbb
Compare
| @@ -1,5 +1,5 @@ | |||
| <!--Descriptive page name, messages and instructions--> | |||
| <h2 class="heading"><%= logged_in_as_admin? ? (@user.login + "'s") : "Your" %> Invitations</h2> | |||
| <h2 class="heading"><%= t(logged_in_as_admin? ? ".page_heading_admin" : ".page_heading_user", username: @user.login) %></h2> | |||
There was a problem hiding this comment.
Can you make these page_heading.admin and page_heading.user, please? It should look like this in the locale file:
manage:
page_heading:
admin: text
user: text
And apologies for not catching this before, but the current code will define the username variable even when we don't need it. It's not terrible, but it would be better to do something like
<h2 class="heading">
<% if logged_in_as_admin? %>
<%= t(".page_heading.admin", username: @user.login) %>
<% else %>
[etc]
That would also mean i18n-tasks unused -l en should pass without needing to add anything to ignore_unused.
There was a problem hiding this comment.
If we are adding an if / else condition, should I also be making the text more like displaying base text for user and base text + admin text for admin or would trying to name those things make the code less clear?
There was a problem hiding this comment.
Whoops, sorry, didn't see this question before I approved the pull request! But in general, it's a good idea to avoid doing that. Just because "Manage Invitations" and "for username" combine nicely into "Manage Invitations for username" English doesn't mean it will work across all languages. It's easier for the translation team to have the versions entirely separate like we've done here.
cbfab03 to
dee3ce8
Compare
6daa8e4 to
035bd12
Compare
Pull Request Checklist
as the first thing in your pull request title (e.g.
AO3-1234 Fix thing)until they are reviewed and merged before creating new pull requests.
Issue
https://otwarchive.atlassian.net/browse/AO3-7409
Purpose
On the manage invitations page, adjusts the browser subtitle and the header
Credit
Jesse Malark he/him