Defect #35248
openHard-coded error messages in IssueStatus
0%
Description
Untranslated hard-coded string exists in source:trunk/app/models/issue_status.rb@20897#L113
def check_integrity if Issue.where(:status_id => id).any? raise "This status is used by some issues" elsif Tracker.where(:default_status_id => id).any? raise "This status is used as the default status by some trackers" end end
Files
Updated by salman mp over 3 years ago
Also in:
models/role.rb:301: raise "Cannot delete role" if members.any? models/role.rb:302: raise "Cannot delete builtin role" if builtin? models/role.rb:311: raise "Unable to create the #{name} role (#{role.errors.full_messages.join(',')})." if role.new_record? models/setting.rb:330: raise "There's no setting named #{name}" unless available_settings.has_key?(name) models/tracker.rb:147: raise "Cannot delete tracker" if Issue.where(:tracker_id => self.id).any? models/query.rb:1096: raise "Unknown #{queried_class.name} association #{assoc}" unless customized_class models/query.rb:1310: raise "Unknown query operator #{operator}" models/enumeration.rb:135: raise "Cannot delete enumeration" if self.in_use?
Updated by Holger Just over 3 years ago
- Status changed from New to Needs feedback
The descriptions of those raised exceptions generally do not show up in the user interface. They are either handled by higher layers of the code (which may then render an appropriate translated error message in the response to the user) or if unhandled result in a 500 error which also doesn't show any further information to the user.
Generally, those exception descriptions only turn up in the application logs (e..g logs/production.log
. Here, it is entirely fine to only use english messages (given that the entire code and database scheme uses english).
With that being said, if you can reproduce a case where those error messages do show up in the user interface unchanged, this might be considered for a fix.
Updated by Kam Nazir over 3 years ago
Thank you for your reply, Holger.
This error is shown to the user when he/she try to delete a status that has been used in some issues. something like:
Unable to delete issue status (This status is used by some issues)
I reproduce the scenario and check the Redmine log. There wasn't this error in the log.
Updated by Go MAEDA over 3 years ago
- File Screenshot_2021-05-18.png Screenshot_2021-05-18.png added
- Status changed from Needs feedback to Confirmed
Kam Nazir wrote:
This error is shown to the user when he/she try to delete a status that has been used in some issues. something like:
Unable to delete issue status (This status is used by some issues)
Confirmed the issue. In the screenshot below, you can see an untranslated English sentence in a Japanese error message.