Category edit dialog: default groups sometimes not translated

AI-generated summary

A discussion is taking place about the translation of default group names in the category edit dialog. claas has identified an issue where the group names (everyone, admins, moderators, staff) are not consistently translated, and has provided images to illustrate the problem.

claas has also dug deeper into the issue and found that:

  • The category details come from app/controllers/categories_controller.rb#show
  • Group names are translated in app/models/group.rb
  • The everyone group is a special group
  • The security tab in the category edit dialog comes from app/assets/javascripts/discourse/templates/components/edit-category-security.hbs

claas suggests that the solution could be to have the CategoriesController return permissions with two keys group_name and group_name_localized.

Thamer is also experiencing issues with translating the “Staff” group and related notifications, and is looking for a solution.

When creating or editing a category, the default group names (everyone, admins, moderators, staff) should be translated. However, sometimes this is not the case:

1. Create a new category Test (without changing any permission):

:white_check_mark: Group name everyone (jeder) is translated in permission list.
:x: Group names are not translated in group selection (e.g. staff should be Mitarbeiter).

2. Edit the created category Test

:x: Group name everyone is not translated in permission list.
:x: Group names are not translated in group selection, except everyone (jeder).

3. Set permissions explicitly

Same as 2.

PS: Interestingly, the trust_level group names are translated.

2개의 좋아요

Here’s what I found out:

  1. The category details for the dialog comes from app/controllers/categories_controller.rb#show, which gets the permissions from app/models/category.rb#scoped_to_permissions
  2. Group names are translated in app/models/group.rb.
  3. The everyone group is a special group.
  4. The security tab in the category edit dialog comes from app/assets/javascripts/discourse/templates/components/edit-category-security.hbs and the group name is inserted here (as it comes from the controller/ajax request).

Maybe the best solution would be to have the CategoriesController return permission with two keys group_name and group_name_localized? We would probably need to make sure that group_name_localized is equal to the group_name for custom/user-created groups.

2개의 좋아요

안녕하세요, 친구.

이 문제에 대해 좋은 해결책을 찾아 주실 수 있을까요?

저도 제 페이지에서 “Staff” 그룹과 관련된 모든 알림 및 관련 항목을 번역하고 있습니다. 그룹 이름은 번역할 수 있지만, 포럼 주변 다른 문장들에서 "staff"라는 단어 자체는 정확히 번역하기가 어렵네요.

이 오래된 스레드가 사라지지 않기를 바랍니다.