streamline topic_invite locale

This commit is contained in:
Arpit Jalan 2016-03-02 00:37:04 +05:30
parent fff119a554
commit 8349669f8e
2 changed files with 5 additions and 4 deletions

View File

@ -582,7 +582,7 @@ class Topic < ActiveRecord::Base
if private_message?
# If the user exists, add them to the message.
user = User.find_by_username_or_email(username_or_email)
raise StandardError.new I18n.t("topic_invite_user_exists") if user.present? && topic_allowed_users.where(user_id: user.id).exists?
raise StandardError.new I18n.t("topic_invite.user_exists") if user.present? && topic_allowed_users.where(user_id: user.id).exists?
if user && topic_allowed_users.create!(user_id: user.id)
# Create a small action message
@ -607,7 +607,7 @@ class Topic < ActiveRecord::Base
else
# invite existing member to a topic
user = User.find_by_username(username_or_email)
raise StandardError.new I18n.t("topic_invite_user_exists") if user.present? && topic_allowed_users.where(user_id: user.id).exists?
raise StandardError.new I18n.t("topic_invite.user_exists") if user.present? && topic_allowed_users.where(user_id: user.id).exists?
if user && topic_allowed_users.create!(user_id: user.id)
# rate limit topic invite

View File

@ -138,8 +138,6 @@ en:
reading_time: "Reading time"
likes: "Likes"
topic_invite_user_exists: "Sorry, that user has already been invited. You may only invite a user to a topic once."
too_many_replies:
one: "We're sorry, but new users are temporarily limited to 1 reply in the same topic."
other: "We're sorry, but new users are temporarily limited to %{count} replies in the same topic."
@ -2747,3 +2745,6 @@ en:
performance_report:
initial_post_raw: This topic includes daily performance reports for your site.
initial_topic_title: Website performance reports
topic_invite:
user_exists: "Sorry, that user has already been invited. You may only invite a user to a topic once."