-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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 "'s Room" in default room #5313
Conversation
@@ -63,7 +63,8 @@ def create_default_room(user) | |||
return unless user.rooms.count <= 0 | |||
return unless PermissionsChecker.new(permission_names: 'CreateRoom', user_id: user.id, current_user: user, current_provider:).call | |||
|
|||
Room.create(name: "#{user.name}'s Room", user_id: user.id) | |||
locale = I18n.default_locale unless valid_locale?(user.language.to_sym) | |||
Room.create(name: t('room.new_room_name', username: user.name, locale:), user_id: user.id) |
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.
I believe that we can assume the user's language is always valid - why the extra check here?
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.
I added the check because the tests were failing due to the user's language being set to "language". I don't know whether or not it's possible for a user's language to exist without a corresponding locale file, but if not I can also change the tests to pass a valid language
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.
Yeah I would update the tests instead
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Closes #5255