Text glitch on group admin page

AI-generated summary

Text Glitch on Group Admin Page

A text glitch was discovered on the group admin page, where a non-admin member sees a placeholder text ([en.admin.groups.selector_placeholder]) instead of the actual text. ChrisBeach created a PR to fix this issue, assuming that customized text with an “admin.” prefix is not available to non-admin clients.

sam pointed out the oddity of having an admin client localization file but not a moderator client localization file, suggesting centralization or splitting into “staff” client/server locale files. eviltrout agreed that the admin locale should apply to moderators and proposed renaming it to “staff” for clarity.

The discussion revealed that the bug might be related to the path or the fact that the admin locale is not loaded for non-staff group owners. Mittineague provided an example of the issue on a local development environment.

sam reviewed the change again and confirmed that it is correct, explaining that the issue arises when a non-staff group owner needs to access the public group edit tab, which shares locale stuff with the staff locale file.

The issue was eventually fixed by tgxworld in a commit to the Discourse repository.

Update: [PR pending]

When logged in as admin, I see “enter username” on the group editor, but when logged in as a non-admin member, I see “[en.admin.groups.selector_placeholder]”:

I’ll see if I can create a PR to fix this - I’m assuming that customised text with “admin.” prefix is not available to non-admin clients.

إعجاب واحد (1)

I have created a PR with a fix:

https://github.com/discourse/discourse/pull/5473

11 إعجابًا

One odd thing here @eviltrout is that we have admin client localization file but do not have moderator client localization file. Would make sense either to centralize so we have “staff” client/server locale files, or split so there is both admin and moderator stuff.

إعجابَين (2)

I’ve always thought of the admin locale as “admin section” so it should apply to moderators too. I’m happy to rename it to staff if that makes it more clear. Either way if you are on an /admin path it should be loaded.

إعجابَين (2)

Hmm :thinking: so how is this bug possible?

It should be loaded but perhaps it is currently not.

It may be the path?

I see the missing translation on my localhost “goodguys” group when logged in as the non-Staff group owner.

http://localhost/groups/goodguys/edit

The “Add Members” input.

<input name="user-selector-renamed" 
 placeholder="[en.admin.groups.selector_placeholder]" 
 id="member-selector" class="ember-text-field ember-view" 
 style="width: 150px;" type="text"> 

These two are OK

<input name="flair_url" placeholder="(Optional) Image URL or Font Awesome class" id="ember1637" 
 class="ember-text-field ember-view" type="text"> 
<input name="flair_bg_color" placeholder="(Optional) Hex color value" id="ember1638" 
 class="group-flair-bg-color ember-text-field ember-view" type="text"> 
إعجابَين (2)

OH I just reviewed this again and think the change is correct (thought the github diff makes it very hard to understand)

What is happening is that you have a non staff group owner and need to allow the public group edit tab to work. It was sharing locale stuff with the staff locale file so it clearly fails.

@tgxworld can you review this and perhaps clean it up.

What we want to make sure is that we don’t have duplicate strings in admin/non-admin and duplicate templates here.

إعجابَين (2)

Fixed in

https://github.com/discourse/discourse/commit/3e1afbedc521a6687a9575b4319b821ada7f3bd1

8 إعجابات