Tracker: improved strings

* For these error messages, asking to try with another/shorter file name
  is unnecessary, because obvious.

* Distinguish file and folder name in alert text.

* Remove the "r" shortcut. There's only one OK button which already is
  the default and therefore triggered with ENTER. Why 'r' anyway...?

Change-Id: I608ea1505ae51605d4a1b644e5468990a4300683
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6437
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
This commit is contained in:
Humdinger 2023-05-13 17:34:20 +02:00 committed by waddlesplash
parent ae4d11a4d2
commit 80c9f890df

View File

@ -839,12 +839,15 @@ ShouldEditRefName(const entry_ref* ref, const char* name, size_t length)
// check if name is too long // check if name is too long
if (length >= B_FILE_NAME_LENGTH) { if (length >= B_FILE_NAME_LENGTH) {
BAlert* alert = new BAlert("", BString text;
B_TRANSLATE("That name is too long. Please type another one."), if (entry.IsDirectory())
B_TRANSLATE("OK"), text = B_TRANSLATE("The entered folder name is too long.");
else
text = B_TRANSLATE("The entered file name is too long.");
BAlert* alert = new BAlert("", text, B_TRANSLATE("OK"),
0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT); 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE); alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->SetShortcut(0, 'r');
alert->Go(); alert->Go();
return B_NAME_TOO_LONG; return B_NAME_TOO_LONG;
@ -865,13 +868,12 @@ ShouldEditRefName(const entry_ref* ref, const char* name, size_t length)
// check for name conflict // check for name conflict
if (parent.Contains(name)) { if (parent.Contains(name)) {
BAlert* alert = new BAlert("", BString text(B_TRANSLATE("An item named '%filename%' already exists."));
B_TRANSLATE("That name is already taken. " text.ReplaceFirst("%filename%", name);
"Please type another one."),
B_TRANSLATE("OK"), BAlert* alert = new BAlert("", text, B_TRANSLATE("OK"),
0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT); 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE); alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->SetShortcut(0, 'r');
alert->Go(); alert->Go();
return B_NAME_IN_USE; return B_NAME_IN_USE;