balooctl status: translatable message
ClosedPublic

Authored by michaelh on Jan 7 2018, 5:16 PM.

Details

Summary

Wrapped output messages of 'balooctl status ...' in i18n*
Sent error messages to stderr

Test Plan

compile & run

Diff Detail

Repository
R293 Baloo
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
michaelh requested review of this revision.Jan 7 2018, 5:16 PM
michaelh created this revision.
michaelh added inline comments.
src/tools/balooctl/statuscommand.cpp
108

Question: Is this ever going to be translated?

michaelh edited the summary of this revision. (Show Details)Jan 7 2018, 5:18 PM
michaelh edited the summary of this revision. (Show Details)
lueck added a subscriber: lueck.Jan 7 2018, 7:36 PM
lueck added inline comments.
src/tools/balooctl/statuscommand.cpp
108

german translator here:
balooctl has a Messages.sh and extracts 52 messages into the catalog balooctl5.pot
a lot of messages in statuscommand.cpp, main.cpp, monitorcommand.cpp configcommand.cpp 98 - 52 = 48 are not extracted due to missing i18n() calls
we translate description of cammandline options in all application, therefore we should translate all missing messages here as well

michaelh added inline comments.Jan 7 2018, 7:55 PM
src/tools/balooctl/statuscommand.cpp
108

I see. Thank you for the info.
The only thing translated in this function is the filename. I am new to this, but I think that is the only item that does not need translation.
It should be exactly the other way round, right?
Regarding my patch:
To ease translation, should I break up the strings a little bit?
Like

out << i18n("Basic indexing") << " " <<i18n("done");
elvisangelaccio added inline comments.
src/tools/balooctl/statuscommand.cpp
108
lueck added inline comments.Jan 7 2018, 9:21 PM
src/tools/balooctl/statuscommand.cpp
108

The only thing translated in this function is the filename. I am new to this, but I think that is the only item that does not need translation.
It should be exactly the other way round, right?

"File: %1"will be translated e.g. in german to "Datei: %1" and at runtime %1 is replaced by the string value of filePath

To ease translation, should I break up the strings a little bit?

Please no, word puzzles are evil for translators

michaelh updated this revision to Diff 24943.Jan 8 2018, 2:34 PM
  • Localized messages
  • Sending error messages to stderr
michaelh marked 2 inline comments as done.Jan 8 2018, 2:43 PM
michaelh added inline comments.
src/tools/balooctl/statuscommand.cpp
108

Just installed baloo5-lang. Now I see the difference

lbeltrame added inline comments.
src/tools/balooctl/statuscommand.cpp
111

If we want output of balooctl status <path> to be parseable, then IMO it shouldn't be translated.
However the translations in the status command without arguments are instead desirable IMO.

May I observe that relying on the command line output is fragile in the best case?
Unless the command can produce the output in some formatted way (like the openstack CLI, which can enable a special mode to produce output in various formats like csv, table-formatted, or direct values, and select the columns).

May I observe that relying on the command line output is fragile in the best case?
Unless the command can produce the output in some formatted way (like the openstack CLI, which can enable a special mode to produce output in various formats like csv, table-formatted, or direct values, and select the columns).

I agree. Having a special mode which gives json/csv or some other machine readable output is a far better option.

michaelh updated this revision to Diff 25459.Jan 16 2018, 1:24 PM

Reverted parseablity in preparation for a --format switch
Sending error messages to stderr
i18n'ed all messages

michaelh added inline comments.Jan 16 2018, 1:27 PM
src/tools/balooctl/statuscommand.cpp
109

<filename> ... overkill?

michaelh updated this revision to Diff 25466.Jan 16 2018, 2:14 PM
michaelh marked 2 inline comments as done.

Removed <command> and <filename> tags

michaelh retitled this revision from balooctl status: produce parseable output to balooctl status: translatable message.Jan 17 2018, 5:26 PM
michaelh edited the summary of this revision. (Show Details)
michaelh added a reviewer: lueck.
lueck added a comment.Jan 18 2018, 6:00 AM

i18n looks ok, thanks

lbeltrame accepted this revision.Jan 18 2018, 6:13 AM
This revision is now accepted and ready to land.Jan 18 2018, 6:13 AM
This revision was automatically updated to reflect the committed changes.