FIX: Replace hard-coded string with translation (#20245)

This commit is contained in:
Gerhard Schlager
2023-02-11 14:50:53 +01:00
committed by GitHub
parent 8bc9acc414
commit d84d38cbe7
2 changed files with 4 additions and 1 deletions

View File

@@ -542,7 +542,9 @@ class PostsController < ApplicationController
post_revision.modifications["category_id"][0] != topic.category.id
end
return render_json_error(I18n.t("revert_version_same")) unless changes.length > 0
changes[:edit_reason] = "reverted to version ##{post_revision.number.to_i - 1}"
changes[:edit_reason] = I18n.with_locale(SiteSetting.default_locale) do
I18n.t("reverted_to_version", version: post_revision.number.to_i - 1)
end
revisor = PostRevisor.new(post, topic)
revisor.revise!(current_user, changes)