Ticket #6063: mount_serverLocalization.patch
File mount_serverLocalization.patch, 5.7 KB (added by , 14 years ago) |
---|
-
src/servers/mount/AutoMounter.cpp
12 12 13 13 #include <Alert.h> 14 14 #include <AutoLocker.h> 15 #include <Catalog.h> 15 16 #include <Debug.h> 16 17 #include <Directory.h> 17 18 #include <DiskDevice.h> … … 22 23 #include <FindDirectory.h> 23 24 #include <fs_info.h> 24 25 #include <fs_volume.h> 26 #include <Locale.h> 25 27 #include <Message.h> 26 28 #include <Node.h> 27 29 #include <NodeMonitor.h> … … 34 36 #include "MountServer.h" 35 37 36 38 39 #define B_TRANSLATE_CONTEXT "AutoMounter" 40 41 37 42 static const char* kMountServerSettings = "mount_server"; 38 43 static const uint32 kMsgInitialScan = 'insc'; 39 44 static const char* kMountFlagsKeyExtension = " mount flags"; … … 328 333 switch (message->what) { 329 334 case B_EXECUTE_PROPERTY: 330 335 if (strcmp("InitialScan", property) == 0) { 331 printf("performing initial scan.\n");336 printf(B_TRANSLATE("performing initial scan.\n")); 332 337 _MountVolumes(fNormalMode, fRemovableMode, true); 333 err = reply.AddString("result", "Previous volumes mounted.");338 err = reply.AddString("result", B_TRANSLATE("Previous volumes mounted.")); 334 339 } 335 340 break; 336 341 } … … 378 383 if (askReadOnly) { 379 384 // Suggest to the user to mount read-only until Haiku is more mature. 380 385 BString string; 381 string << "Mounting volume "; 382 if (partition->ContentName() != NULL) 383 string << "'" << partition->ContentName() << "'\n\n"; 386 if (partition->ContentName() != NULL) { 387 char str1[127], str2[127]; 388 int len = 0; 389 len = sprintf(str1, "%s", B_TRANSLATE("Mounting volume '%s'\n\n")); 390 str1[len] = '\0'; 391 len = sprintf(str2, str1, partition->ContentName()); 392 str2[len] = '\0'; 393 string << str2; 394 } 384 395 else 385 string << "<unnamed volume>\n\n"; 396 string << B_TRANSLATE("Mounting volume <unnamed volume>\n\n"); 397 386 398 // TODO: Use distro name instead of "Haiku"... 387 399 if (!isBFS) { 388 string << "The file system on this volume is not the Haiku file " 389 "system. It is strongly suggested to mount it in read-only " 390 "mode. "; 400 string << B_TRANSLATE("The file system on this volume is not the " 401 "Haiku file system. It is strongly suggested to mount it in " 402 "read-only mode. This will prevent unintentional data loss " 403 "because of errors in Haiku."); 391 404 } else { 392 string << "It is suggested to mount all additional Haiku volumes " 393 "in read-only mode. "; 405 string << B_TRANSLATE("It is suggested to mount all additional " 406 "Haiku volumes in read-only mode. This will prevent " 407 "unintentional data loss because of errors in Haiku."); 394 408 } 395 string << "This will prevent unintentional data loss because of " 396 "errors in Haiku.";397 BAlert* alert = new BAlert("Mount warning", string.String(),398 "Mount read/write", "Cancel", "Mount read-only",409 410 BAlert* alert = new BAlert(B_TRANSLATE("Mount warning"), 411 string.String(), B_TRANSLATE("Mount read/write"), 412 B_TRANSLATE("Cancel"), B_TRANSLATE("Mount read-only"), 399 413 B_WIDTH_FROM_WIDEST, B_WARNING_ALERT); 400 414 alert->SetShortcut(1, B_ESCAPE); 401 415 int32 choice = alert->Go(); … … 547 561 status_t status = partition->Mount(NULL, mountFlags); 548 562 if (status < B_OK) { 549 563 BString string; 550 string << "Error mounting volume. (" << strerror(status) << ")"; 551 (new BAlert("", string.String(), "OK"))->Go(NULL); 564 string << B_TRANSLATE("Error mounting volume."); 565 string << " (" << strerror(status) << ")"; 566 (new BAlert("", string.String(), B_TRANSLATE("OK")))->Go(NULL); 552 567 } 553 568 } 554 569 … … 557 572 AutoMounter::_SuggestForceUnmount(const char* name, status_t error) 558 573 { 559 574 BString text; 560 text << "Could not unmount disk \"" << name << "\":\n\t"; 575 text << B_TRANSLATE("Could not unmount disk"); 576 text << " \"" << name << "\":\n\t"; 561 577 text << strerror(error); 562 text << "\n\nShould unmounting be forced?\n\n" 578 text << "\n\n"; 579 text << B_TRANSLATE("Should unmounting be forced?\n\n" 563 580 "Note: If an application is currently writing to the volume, " 564 "unmounting it now might result in loss of data.\n" ;581 "unmounting it now might result in loss of data.\n"); 565 582 566 BAlert* alert = new BAlert("", text.String(), "Cancel", "Force unmount",567 NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);583 BAlert* alert = new BAlert("", text.String(), B_TRANSLATE("Cancel"), 584 B_TRANSLATE("Force unmount"), NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); 568 585 alert->SetShortcut(0, B_ESCAPE); 569 586 int32 choice = alert->Go(); 570 587 … … 576 593 AutoMounter::_ReportUnmountError(const char* name, status_t error) 577 594 { 578 595 BString text; 579 text << "Could not unmount disk \"" << name << "\":\n\t"; 596 text << B_TRANSLATE("Could not unmount disk"); 597 text << " \"" << name << "\":\n\t"; 580 598 text << strerror(error); 581 599 582 (new BAlert("", text.String(), "OK", NULL, NULL, B_WIDTH_AS_USUAL,583 B_W ARNING_ALERT))->Go(NULL);600 (new BAlert("", text.String(), B_TRANSLATE("OK"), NULL, NULL, 601 B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(NULL); 584 602 } 585 603 586 604 … … 903 921 int 904 922 main(int argc, char* argv[]) 905 923 { 924 BCatalog fAppCatalog; 906 925 AutoMounter app; 926 927 be_locale->GetAppCatalog(&fAppCatalog); 928 907 929 app.Run(); 908 930 return 0; 909 931 } -
src/servers/mount/Jamfile
1 1 SubDir HAIKU_TOP src servers mount ; 2 2 3 SubDirHdrs HAIKU_TOP headers os locale ; 4 3 5 UsePrivateHeaders mount shared storage ; 4 6 5 7 Server mount_server … … 7 9 AutoMounter.cpp 8 10 # AutoMounterSettings.cpp 9 11 : 10 libbe.so 12 libbe.so liblocale.so 11 13 $(TARGET_LIBSTDC++) 12 14 : 13 15 mount_server.rdef 14 16 ; 17 18 DoCatalogs mount_server : 19 x-vnd.Haiku-mount_server 20 : 21 AutoMounter.cpp 22 : en.catkeys 23 ;