Opened 13 years ago

Closed 13 years ago

#7767 closed enhancement (fixed)

Change "Do it" to a proper verb in Tracker Dialogs

Reported by: jscipione Owned by: jscipione
Priority: normal Milestone: R1
Component: Applications/Tracker Version: R1/Development
Keywords: UI Cc:
Blocked By: Blocking:
Platform: All

Description

In Tracker there are a couple of dialogs that have the label "Do it" on the button. This is bad UI because it can be confused with the word "Dolt" and is just non-standard and strange. Unless their is a really good reason for this we should just use the international standard "OK".

Reference to "Do it => Dolt": http://folklore.org/StoryView.py?project=Macintosh&story=Do_It.txt&sortOrder=Sort%20by%20Date&detail=medium&search=Do%20it

And here is a reference on "OK" being an international standard: http://www.bbc.co.uk/news/magazine-12503686

Attached is an example of such a dialog pulled from the User Guide:

Tracker Alert Dialog showing the "Do it" button from the User Guide

Also, I made a patch.

Attachments (8)

achtung-user.png (5.9 KB ) - added by jscipione 13 years ago.
Tracker Alert Dialog showing the "Do it" button from the User Guide
Tracker_Do_it_to_OK.diff (3.1 KB ) - added by jscipione 13 years ago.
Patch to change instances of "Do it" to "OK" in Tracker dialogs
Tracker_alert_label_to_verb.diff (5.2 KB ) - added by jscipione 13 years ago.
Several people on the mailing list commented that they didn't like the word "OK" and would prefer a properly descriptive verb instead. This patch changes "Do It" to an action verb such as "Rename". I did my darndest to make sure that this would still translate correctly. I also did some 80 char limit fixes. Lastly I got rid of the OS_NAME #define and just use the word "Haiku" in the messages.
Tracker_alert_label_to_verb_2.diff (5.5 KB ) - added by jscipione 13 years ago.
Change ToDoAction to ToConfirmAction
Tracker_alert_label_to_verb_3.diff (5.5 KB ) - added by jscipione 13 years ago.
Change instances of %toConfirmAction to %ifYouDoAction where it makes sense to put the name of the action e.g. rename instead of the name of the button label e.g. Rename.
Tracker_alert_label_to_verb_4.diff (9.2 KB ) - added by jscipione 13 years ago.
Update ConfirmChangeIfWellKnownDirectory to take 3 string arguments instead of 2, the extra one is accept verb translations in languages (like German) where there is a different word for the verb in different contexts. Also add German examples to help translators. I had some help from DeadYak to get these translation examples right but they could still be off a bit, I have no way to know since I don't speak German.
Tracker_alert_label_to_verb_4_updated.diff (9.2 KB ) - added by humdinger 13 years ago.
_4.diff with updated German comment.
FSUtils.diff (681 bytes ) - added by humdinger 13 years ago.
Removing translation of a button

Download all attachments as: .zip

Change History (26)

by jscipione, 13 years ago

Attachment: achtung-user.png added

Tracker Alert Dialog showing the "Do it" button from the User Guide

by jscipione, 13 years ago

Attachment: Tracker_Do_it_to_OK.diff added

Patch to change instances of "Do it" to "OK" in Tracker dialogs

comment:1 by jscipione, 13 years ago

patch: 01

by jscipione, 13 years ago

Several people on the mailing list commented that they didn't like the word "OK" and would prefer a properly descriptive verb instead. This patch changes "Do It" to an action verb such as "Rename". I did my darndest to make sure that this would still translate correctly. I also did some 80 char limit fixes. Lastly I got rid of the OS_NAME #define and just use the word "Haiku" in the messages.

comment:2 by jscipione, 13 years ago

Summary: Change "Do it" to "OK" in Tracker DialogsChange "Do it" to a proper verb in Tracker Dialogs

comment:3 by humdinger, 13 years ago

As is, the patch would break some translations. At least in German the %toDoAction is translated as "Umzubenennen", which wouldn't work as a button label. I'm afraid we need another variable for this. Something like %toConfirmAction. Can you update your patch, John?

by jscipione, 13 years ago

Change ToDoAction to ToConfirmAction

in reply to:  3 comment:4 by jscipione, 13 years ago

Replying to humdinger:

As is, the patch would break some translations. At least in German the %toDoAction is translated as "Umzubenennen", which wouldn't work as a button label. I'm afraid we need another variable for this. Something like %toConfirmAction. Can you update your patch, John?

I am glad to update my patch. Who am I to stand in the way of German Tracker users?

comment:5 by humdinger, 13 years ago

Thanks John. I suspect it's not *only* German translations... :)

It looks like you always replaced "%toDoAction" with "%toConfirmAction", see:

@@ -638,21 +633,22 @@ ConfirmChangeIfWellKnownDirectory(const BEntry *entry, const char *ifYouDoAction
 	if (DirectoryMatchesOrContains(entry, B_SYSTEM_DIRECTORY)) {
 		warning.SetTo(
 			B_TRANSLATE("If you %ifYouDoAction the system folder or its "
-			"contents, you won't be able to boot " OS_NAME "! Are you sure you "
-			"want to do this? To %toDoAction the system folder or its contents "
-			"anyway, hold down the Shift key and click \"Do it\"."));
+			"contents, you won't be able to boot Haiku! Are you sure you "
+			"want to do this? To %toConfirmAction the system folder or its "
+			"contents anyway, hold down the Shift key and click "
+			"\"%toConfirmAction\"."));

I think the "%toConfirmAction" should only be used for the button label:

B_TRANSLATE("If you %ifYouDoAction the system folder or its "
	"contents, you won't be able to boot " OS_NAME "! Are you sure you "
	"want to do this? To %toDoAction the system folder or its contents "
	"anyway, hold down the Shift key and click \"%toConfirmAction\"."));

BTW, even after having PulkoMandy try to explain things to me, I have the hardest time creating the catalogs/catkeys files to create a sample translation to test this without having to commit and have conveniently BOM/HTA help with that...

comment:6 by pulkomandy, 13 years ago

Writing down the explanations so it's available to everyone:

  • To extract the catkeys for something, use jam -q <mimesignature>en.catkeys, replacing mimesignature with the actual signature.
  • The result is an en.catkeys file in generated/objects/catalogs folder
  • From this file you can build your translation. It is possible to merge it with the original translation if one exists, but it's a painful process (lines get swapped, not just added/removed).
  • Then, you can put your new catkey file in place in the buildtree and use jam -q <mimesignature>language.catalog to build it. (or you can run linkcatkeys by hand)

HTA helps with the merging process, maybe we should have a native app (or a web app or whatever) for that...

by jscipione, 13 years ago

Change instances of %toConfirmAction to %ifYouDoAction where it makes sense to put the name of the action e.g. rename instead of the name of the button label e.g. Rename.

in reply to:  5 comment:7 by jscipione, 13 years ago

Replying to humdinger:

I think the "%toConfirmAction" should only be used for the button label:

B_TRANSLATE("If you %ifYouDoAction the system folder or its "
	"contents, you won't be able to boot " OS_NAME "! Are you sure you "
	"want to do this? To %toDoAction the system folder or its contents "
	"anyway, hold down the Shift key and click \"%toConfirmAction\"."));

I replaced %toDoAction with %ifYouDoAction in the above example in my lastest patch. That way the translation will become

"If you %ifYouDoAction the system folder or its contents, you won't be able to boot Haiku! Are you sure you want to do this? To %ifYouDoAction the system folder or its contents anyway, hold down the Shift key and click \"%toConfirmAction\"."

Is that right? I'm sorry if I misread what you wanted me to change. I am a bit confused now.

comment:8 by humdinger, 13 years ago

Sorry for dragging this out so long, and thanks for trying to keep up with it John. :)

It's basically what I wrote in the example at the end of comment:5. We need 3 variables. Here's the English text with the German words for the 3 variables:

If you "umbenannt" (%ifYouDoAction) the common folder, Haiku may not behave properly! Are you sure you want to do this? To "umzubenennen" (%toDoAction) the common folder anyway, hold down the Shift key and click "Umbenennen" (%toConfirmAction).
Version 0, edited 13 years ago by humdinger (next)

by jscipione, 13 years ago

Update ConfirmChangeIfWellKnownDirectory to take 3 string arguments instead of 2, the extra one is accept verb translations in languages (like German) where there is a different word for the verb in different contexts. Also add German examples to help translators. I had some help from DeadYak to get these translation examples right but they could still be off a bit, I have no way to know since I don't speak German.

in reply to:  8 comment:9 by jscipione, 13 years ago

Replying to humdinger:

Sorry for dragging this out so long, and thanks for trying to keep up with it John. :)

It's okay, I want to get this right.

It's basically what I wrote in the example at the end of comment:5. We need 3 variables.

As I wrote in the patch description for _4.diff file I changed ConfirmChangeIfWellKnownDirectory() to take 3 string arguments instead of 2, one for %ifYouDoAction, one for %toDoAction, and one for %toConfirmAction.

I also added German examples in the comment for translators. For the rename instances I used the German words you provided for the different translations of "rename", but, since I am not a German-speaker, I probably messed something subtle up. Can you fix the German translation examples or tell me how to?

comment:10 by humdinger, 13 years ago

I have corrected the German comment parts (see the _4_updated.diff), though it might be more helpful for the translators to just give the variable, e.g. "%toDoAction". Then they can use the browser's find function to see where it is used.
Also, the generated en.catkeys don't seem to like the linebreaks in the comments. Those are shown as:
"As in 'if you rename this folder...' (en) \t\t\t\t'Wird dieser Ordner umbenannt...' (de)"
If HTA can deal with "\n" try to use that instead...

One more thing:

+	buttonLabel.ReplaceFirst("%toConfirmAction",
+		BString(toConfirmAction).Capitalize().String());

This would only change the capitalization of the button text, not in the alert text telling the user to "hold down the Shift key and click "%toConfirmAction". Maybe the code-wise capitalization can be removed completely and the to be translated string is capitalized directly.

I can't find the time (and frankly the will :) ) to mess around with the unsorted catkeys to build up a de.catkeys by hand. @PulkoMandy: Yes, a little tool to automate translation tests would be very much appreciated.
But it does compile, so I'd say commit it and I'll see if what pops up in HTA is correct.

by humdinger, 13 years ago

_4.diff with updated German comment.

in reply to:  10 ; comment:11 by jscipione, 13 years ago

Replying to humdinger:

I have corrected the German comment parts (see the _4_updated.diff), though it might be more helpful for the translators to just give the variable, e.g. "%toDoAction". Then they can use the browser's find function to see where it is used.

I'll add the variable name to the comment for translators since it is helpful.

Also, the generated en.catkeys don't seem to like the linebreaks in the comments. Those are shown as:
"As in 'if you rename this folder...' (en) \t\t\t\t'Wird dieser Ordner umbenannt...' (de)"
If HTA can deal with "\n" try to use that instead...

I only put line breaks in so that the source would not violate the 80-char line limit coding style rule. I think I can split the string up across lines without inserting extra tabs into HTA.

One more thing:

+	buttonLabel.ReplaceFirst("%toConfirmAction",
+		BString(toConfirmAction).Capitalize().String());

This would only change the capitalization of the button text, not in the alert text telling the user to "hold down the Shift key and click "%toConfirmAction". Maybe the code-wise capitalization can be removed completely and the to be translated string is capitalized directly.

I'll add .Capitalize().String() to the all instances of %toConfirmAction because button labels are mixed-case by convention no matter how your language normally works right?

Last edited 13 years ago by jscipione (previous) (diff)

comment:12 by jscipione, 13 years ago

Resolution: fixed
Status: newclosed

Fixed in hrev43175. @humdinger let me know if there are any more translation issues with this code.

in reply to:  11 ; comment:13 by axeld, 13 years ago

Replying to jscipione:

I'll add .Capitalize().String() to the all instances of %toConfirmAction because button labels are mixed-case by convention no matter how your language normally works right?

Well, no. When dealing with this sort of stuff, the rules are simple:

  • Don't assume anything about a certain language.
  • What you can do in the translation, don't do in code.

FWIW Capitalize() definitely won't work correctly with right-to-left strings, just to give you a heads up :-)

in reply to:  13 comment:14 by jscipione, 13 years ago

Replying to axeld:

Replying to jscipione:

I'll add .Capitalize().String() to the all instances of %toConfirmAction because button labels are mixed-case by convention no matter how your language normally works right?

Well, no. When dealing with this sort of stuff, the rules are simple:

  • Don't assume anything about a certain language.
  • What you can do in the translation, don't do in code.

FWIW Capitalize() definitely won't work correctly with right-to-left strings, just to give you a heads up :-)

Okay, no longer calling Capitalize() on the Button Label strings as of hrev43181.

comment:15 by humdinger, 13 years ago

Resolution: fixed
Status: closedreopened

Hi John, I'm sorry to bother you again...
At HTA, there's now an entry

%toConfirmAction
Note: Action label for the button, e.g. Rename

coming from this code:

BString buttonLabel(B_TRANSLATE_COMMENT("%toConfirmAction",
	"Action label for the button, e.g. Rename"));
buttonLabel.ReplaceFirst("%toConfirmAction", toConfirmAction);

Shouldn't this be simply:

BString buttonLabel(toConfirmAction);

I attached the change as diff.

comment:16 by humdinger, 13 years ago

Owner: changed from axeld to jscipione
Status: reopenedassigned

by humdinger, 13 years ago

Attachment: FSUtils.diff added

Removing translation of a button

in reply to:  15 comment:17 by jscipione, 13 years ago

Replying to humdinger:

Hi John, I'm sorry to bother you again...
At HTA, there's now an entry

%toConfirmAction
Note: Action label for the button, e.g. Rename

coming from this code:

BString buttonLabel(B_TRANSLATE_COMMENT("%toConfirmAction",
	"Action label for the button, e.g. Rename"));
buttonLabel.ReplaceFirst("%toConfirmAction", toConfirmAction);

Shouldn't this be simply:

BString buttonLabel(toConfirmAction);

I attached the change as diff.

Applied in hrev43200. Thanks humdinger!

comment:18 by jscipione, 13 years ago

Resolution: fixed
Status: assignedclosed

Fixed in hrev43200

Note: See TracTickets for help on using tickets.