Ticket #3269 (closed defect: fixed)

Opened 10 years ago

Last modified 8 years ago

error message prefixed with "0:"

Reported by: egmont Owned by: andrew_b
Priority: trivial Milestone: 4.8.16
Component: mc-core Version: master
Keywords: Cc: mooffie@…
Blocked By: Blocking:
Branch state: merged Votes for changeset: committed-master

Description

Minor regression from 4.8.12 to 4.8.13:

When running in an 8/16 color environment (e.g. TERM=xterm) and trying to choose a 256-color skin (e.g. under F9->Options->Appearance), the error message goes like

0: Unable to use 'xoria256' skin with 256 colors support...

That "0:" prefix makes no sense to the user.

I'm not sure if some other dialogs are also affected.

Attachments

mc-3269-only-print-meaningful-error-code.patch (1023 bytes) - added by and 8 years ago.
mc-3269-use-meaningful-errno-or-0.patch (11.2 KB) - added by and 8 years ago.
mc-3269-only-print-meaningful-error-code-v2.patch (1.0 KB) - added by and 8 years ago.

Change History

comment:1 Changed 9 years ago by mooffie

  • Cc mooffie@… added

comment:2 Changed 8 years ago by and

yes this uninformative error code should be hide
patch attached

Changed 8 years ago by and

Changed 8 years ago by and

comment:3 Changed 8 years ago by and

  • Milestone changed from Future Releases to 4.8.16

comment:4 Changed 8 years ago by andrew_b

message (D_ERROR, MSG_ERROR, _("%s"), (*mcerror)->message);

This is pointless. Error message must be i18n'd at this point.

Update. I've mean _("%s"). In case if error message isn't translated, then

message (D_ERROR, MSG_ERROR, "%s", _((*mcerror)->message));
Last edited 8 years ago by andrew_b (previous) (diff)

comment:5 follow-up: ↓ 14 Changed 8 years ago by and

than

message (D_ERROR, MSG_ERROR, _("%d: %s"), (*mcerror)->code, (*mcerror)->message);

to

message (D_ERROR, MSG_ERROR, "%d: %s", (*mcerror)->code, _((*mcerror)->message));

as well, right?

comment:6 follow-up: ↓ 7 Changed 8 years ago by andrew_b

I'd prefer

message (D_ERROR, MSG_ERROR, "%s (%d)", _((*mcerror)->message), (*mcerror)->code);

comment:7 in reply to: ↑ 6 Changed 8 years ago by andrew_b

Replying to andrew_b:

message (D_ERROR, MSG_ERROR, "%s (%d)", _((*mcerror)->message), (*mcerror)->code);

Or get rid of extra i18n:

message (D_ERROR, MSG_ERROR, "%s (%d)", (*mcerror)->message, (*mcerror)->code);

comment:8 Changed 8 years ago by and

yes, makes more sense
v2 patch attached

comment:9 Changed 8 years ago by andrew_b

  • Status changed from new to accepted
  • Owner set to andrew_b
  • Branch state changed from no branch to on review

Branch: 3269_error_message
Initial changeset:56c45525b9c69269c8ba72370937b7b78160fc99

comment:10 Changed 8 years ago by andrew_b

  • Votes for changeset set to andrew_b
  • Branch state changed from on review to approved

comment:11 Changed 8 years ago by andrew_b

Merged to master: [2fa5952097f0775e06af80b9eca6b654f4d9b339].

git log --pretty=oneline 88b01bd..2fa5952

comment:12 Changed 8 years ago by andrew_b

  • Status changed from accepted to testing
  • Resolution set to fixed

comment:13 Changed 8 years ago by andrew_b

  • Status changed from testing to closed
  • Votes for changeset changed from andrew_b to committed-master
  • Branch state changed from approved to merged

comment:14 in reply to: ↑ 5 Changed 8 years ago by mooffie

Replying to and:

than

message (D_ERROR, MSG_ERROR, _("%d: %s"), (*mcerror)->code, (*mcerror)->message);

to

message (D_ERROR, MSG_ERROR, "%d: %s", (*mcerror)->code, _((*mcerror)->message));

as well, right?


Sorry for not chiming in earlier:

As a rule of thumb, anything but "%s" should be translated. This includes "%d: %s" and "%s (%d)". The French put a space before ":". The Japanese sometimes use some other characters for brackets.

Note: See TracTickets for help on using tickets.