Changeset 92372 in vbox for trunk/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp
- Timestamp:
- Nov 11, 2021 2:45:18 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp
r92143 r92372 59 59 using namespace com; 60 60 61 61 DECLARE_TRANSLATION_CONTEXT(Misc); 62 62 63 63 RTEXITCODE handleRegisterVM(HandlerArg *a) … … 66 66 67 67 if (a->argc != 1) 68 return errorSyntax(USAGE_REGISTERVM, "Incorrect number of parameters");68 return errorSyntax(USAGE_REGISTERVM, Misc::tr("Incorrect number of parameters")); 69 69 70 70 ComPtr<IMachine> machine; … … 79 79 int vrc = RTPathAbs(a->argv[0], szVMFileAbs, sizeof(szVMFileAbs)); 80 80 if (RT_FAILURE(vrc)) 81 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Cannot convert filename \"%s\" to absolute path: %Rrc", a->argv[0], vrc); 81 return RTMsgErrorExit(RTEXITCODE_FAILURE, Misc::tr("Cannot convert filename \"%s\" to absolute path: %Rrc"), 82 a->argv[0], vrc); 82 83 CHECK_ERROR(a->virtualBox, OpenMachine(Bstr(szVMFileAbs).raw(), 83 84 machine.asOutParam())); … … 124 125 VMName = ValueUnion.psz; 125 126 else 126 return errorSyntax(USAGE_UNREGISTERVM, "Invalid parameter '%s'", ValueUnion.psz);127 return errorSyntax(USAGE_UNREGISTERVM, Misc::tr("Invalid parameter '%s'"), ValueUnion.psz); 127 128 break; 128 129 … … 131 132 { 132 133 if (RT_C_IS_PRINT(c)) 133 return errorSyntax(USAGE_UNREGISTERVM, "Invalid option -%c", c);134 return errorSyntax(USAGE_UNREGISTERVM, "Invalid option case %i", c);134 return errorSyntax(USAGE_UNREGISTERVM, Misc::tr("Invalid option -%c"), c); 135 return errorSyntax(USAGE_UNREGISTERVM, Misc::tr("Invalid option case %i"), c); 135 136 } 136 137 if (c == VERR_GETOPT_UNKNOWN_OPTION) 137 return errorSyntax(USAGE_UNREGISTERVM, "unknown option: %s\n", ValueUnion.psz);138 return errorSyntax(USAGE_UNREGISTERVM, Misc::tr("unknown option: %s\n"), ValueUnion.psz); 138 139 if (ValueUnion.pDef) 139 140 return errorSyntax(USAGE_UNREGISTERVM, "%s: %Rrs", ValueUnion.pDef->pszLong, c); 140 return errorSyntax(USAGE_UNREGISTERVM, "error: %Rrs", c);141 return errorSyntax(USAGE_UNREGISTERVM, Misc::tr("error: %Rrs"), c); 141 142 } 142 143 } … … 144 145 /* check for required options */ 145 146 if (!VMName) 146 return errorSyntax(USAGE_UNREGISTERVM, "VM name required");147 return errorSyntax(USAGE_UNREGISTERVM, Misc::tr("VM name required")); 147 148 148 149 ComPtr<IMachine> machine; … … 161 162 162 163 rc = showProgress(pProgress); 163 CHECK_PROGRESS_ERROR_RET(pProgress, ( "Machine delete failed"), RTEXITCODE_FAILURE);164 CHECK_PROGRESS_ERROR_RET(pProgress, (Misc::tr("Machine delete failed")), RTEXITCODE_FAILURE); 164 165 } 165 166 else … … 255 256 /* check for required options */ 256 257 if (bstrName.isEmpty()) 257 return errorSyntax(USAGE_CREATEVM, "Parameter --name is required");258 return errorSyntax(USAGE_CREATEVM, Misc::tr("Parameter --name is required")); 258 259 259 260 do … … 297 298 Bstr settingsFile; 298 299 CHECK_ERROR_BREAK(machine, COMGETTER(SettingsFilePath)(settingsFile.asOutParam())); 299 RTPrintf( "Virtual machine '%ls' is created%s.\n"300 "UUID: %s\n"301 "Settings file: '%ls'\n",302 bstrName.raw(), fRegister ? " and registered": "",300 RTPrintf(Misc::tr("Virtual machine '%ls' is created%s.\n" 301 "UUID: %s\n" 302 "Settings file: '%ls'\n"), 303 bstrName.raw(), fRegister ? Misc::tr(" and registered") : "", 303 304 Utf8Str(uuid).c_str(), settingsFile.raw()); 304 305 } … … 342 343 vrc = RTPathAbs(ValueUnion.psz, szTargetFolder, sizeof(szTargetFolder)); 343 344 if (RT_FAILURE(vrc)) 344 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTPathAbs(%s,,) failed with rc=%Rrc", ValueUnion.psz, vrc); 345 return RTMsgErrorExit(RTEXITCODE_FAILURE, Misc::tr("RTPathAbs(%s,,) failed with rc=%Rrc"), 346 ValueUnion.psz, vrc); 345 347 } else { 346 348 szTargetFolder[0] = '\0'; … … 352 354 pszSrcName = ValueUnion.psz; 353 355 else 354 return errorSyntax(USAGE_MOVEVM, "Invalid parameter '%s'", ValueUnion.psz);356 return errorSyntax(USAGE_MOVEVM, Misc::tr("Invalid parameter '%s'"), ValueUnion.psz); 355 357 break; 356 358 … … 368 370 /* Check for required options */ 369 371 if (!pszSrcName) 370 return errorSyntax(USAGE_MOVEVM, "VM name required");372 return errorSyntax(USAGE_MOVEVM, Misc::tr("VM name required")); 371 373 372 374 /* Get the machine object */ … … 392 394 RTEXITCODE_FAILURE); 393 395 rc = showProgress(progress); 394 CHECK_PROGRESS_ERROR_RET(progress, ( "Move VM failed"), RTEXITCODE_FAILURE);396 CHECK_PROGRESS_ERROR_RET(progress, (Misc::tr("Move VM failed")), RTEXITCODE_FAILURE); 395 397 396 398 sessionMachine.setNull(); 397 399 CHECK_ERROR_RET(a->session, UnlockMachine(), RTEXITCODE_FAILURE); 398 400 399 RTPrintf("Machine has been successfully moved into %s\n", szTargetFolder[0] != '\0' ? szTargetFolder : "the same location"); 401 RTPrintf(Misc::tr("Machine has been successfully moved into %s\n"), 402 szTargetFolder[0] != '\0' ? szTargetFolder : Misc::tr("the same location")); 400 403 } 401 404 … … 507 510 case 'm': // --mode 508 511 if (RT_FAILURE(parseCloneMode(ValueUnion.psz, &mode))) 509 return errorArgument( "Invalid clone mode '%s'\n", ValueUnion.psz);512 return errorArgument(Misc::tr("Invalid clone mode '%s'\n"), ValueUnion.psz); 510 513 break; 511 514 512 515 case 'o': // --options 513 516 if (RT_FAILURE(parseCloneOptions(ValueUnion.psz, &options))) 514 return errorArgument( "Invalid clone options '%s'\n", ValueUnion.psz);517 return errorArgument(Misc::tr("Invalid clone options '%s'\n"), ValueUnion.psz); 515 518 break; 516 519 … … 527 530 pszSrcName = ValueUnion.psz; 528 531 else 529 return errorSyntax( "Invalid parameter '%s'", ValueUnion.psz);532 return errorSyntax(Misc::tr("Invalid parameter '%s'"), ValueUnion.psz); 530 533 break; 531 534 … … 537 540 /* Check for required options */ 538 541 if (!pszSrcName) 539 return errorSyntax( "VM name required");542 return errorSyntax(Misc::tr("VM name required")); 540 543 541 544 /* Get the machine object */ … … 559 562 /* Default name necessary? */ 560 563 if (!pszTrgName) 561 pszTrgName = RTStrAPrintf2( "%s Clone", pszSrcName);564 pszTrgName = RTStrAPrintf2(Misc::tr("%s Clone"), pszSrcName); 562 565 563 566 Bstr createFlags; … … 593 596 RTEXITCODE_FAILURE); 594 597 rc = showProgress(progress); 595 CHECK_PROGRESS_ERROR_RET(progress, ( "Clone VM failed"), RTEXITCODE_FAILURE);598 CHECK_PROGRESS_ERROR_RET(progress, (Misc::tr("Clone VM failed")), RTEXITCODE_FAILURE); 596 599 597 600 if (fRegister) … … 600 603 Bstr bstrNewName; 601 604 CHECK_ERROR_RET(trgMachine, COMGETTER(Name)(bstrNewName.asOutParam()), RTEXITCODE_FAILURE); 602 RTPrintf( "Machine has been successfully cloned as \"%ls\"\n", bstrNewName.raw());605 RTPrintf(Misc::tr("Machine has been successfully cloned as \"%ls\"\n"), bstrNewName.raw()); 603 606 604 607 return RTEXITCODE_SUCCESS; … … 669 672 aBstrEnv.push_back(Bstr(ValueUnion.psz).raw()); 670 673 else 671 return errorSyntax(USAGE_STARTVM, "Parameter to option --putenv must not contain any newline character"); 674 return errorSyntax(USAGE_STARTVM, 675 Misc::tr("Parameter to option --putenv must not contain any newline character")); 672 676 break; 673 677 … … 680 684 { 681 685 if (RT_C_IS_PRINT(c)) 682 return errorSyntax(USAGE_STARTVM, "Invalid option -%c", c);686 return errorSyntax(USAGE_STARTVM, Misc::tr("Invalid option -%c"), c); 683 687 else 684 return errorSyntax(USAGE_STARTVM, "Invalid option case %i", c);688 return errorSyntax(USAGE_STARTVM, Misc::tr("Invalid option case %i"), c); 685 689 } 686 690 else if (c == VERR_GETOPT_UNKNOWN_OPTION) 687 return errorSyntax(USAGE_STARTVM, "unknown option: %s\n", ValueUnion.psz);691 return errorSyntax(USAGE_STARTVM, Misc::tr("unknown option: %s\n"), ValueUnion.psz); 688 692 else if (ValueUnion.pDef) 689 693 return errorSyntax(USAGE_STARTVM, "%s: %Rrs", ValueUnion.pDef->pszLong, c); 690 694 else 691 return errorSyntax(USAGE_STARTVM, "error: %Rrs", c);695 return errorSyntax(USAGE_STARTVM, Misc::tr("error: %Rrs"), c); 692 696 } 693 697 } … … 695 699 /* check for required options */ 696 700 if (VMs.empty()) 697 return errorSyntax(USAGE_STARTVM, "at least one VM name or uuid required");701 return errorSyntax(USAGE_STARTVM, Misc::tr("at least one VM name or uuid required")); 698 702 699 703 for (std::list<const char *>::const_iterator it = VMs.begin(); … … 713 717 if (SUCCEEDED(rc) && !progress.isNull()) 714 718 { 715 RTPrintf( "Waiting for VM \"%s\" to power on...\n", pszVM);719 RTPrintf(Misc::tr("Waiting for VM \"%s\" to power on...\n"), pszVM); 716 720 CHECK_ERROR(progress, WaitForCompletion(-1)); 717 721 if (SUCCEEDED(rc)) … … 728 732 { 729 733 if (SUCCEEDED(iRc)) 730 RTPrintf( "VM \"%s\" has been successfully started.\n", pszVM);734 RTPrintf(Misc::tr("VM \"%s\" has been successfully started.\n"), pszVM); 731 735 else 732 736 { … … 757 761 758 762 if (a->argc != 1) 759 return errorSyntax(USAGE_DISCARDSTATE, "Incorrect number of parameters");763 return errorSyntax(USAGE_DISCARDSTATE, Misc::tr("Incorrect number of parameters")); 760 764 761 765 ComPtr<IMachine> machine; … … 786 790 787 791 if (a->argc != 2) 788 return errorSyntax(USAGE_ADOPTSTATE, "Incorrect number of parameters");792 return errorSyntax(USAGE_ADOPTSTATE, Misc::tr("Incorrect number of parameters")); 789 793 790 794 ComPtr<IMachine> machine; … … 796 800 int vrc = RTPathAbs(a->argv[1], szStateFileAbs, sizeof(szStateFileAbs)); 797 801 if (RT_FAILURE(vrc)) 798 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Cannot convert filename \"%s\" to absolute path: %Rrc", a->argv[0], vrc); 802 return RTMsgErrorExit(RTEXITCODE_FAILURE, Misc::tr("Cannot convert filename \"%s\" to absolute path: %Rrc"), 803 a->argv[0], vrc); 799 804 800 805 do … … 820 825 821 826 if (a->argc > 2 || a->argc < 1) 822 return errorSyntax(USAGE_GETEXTRADATA, "Incorrect number of parameters");827 return errorSyntax(USAGE_GETEXTRADATA, Misc::tr("Incorrect number of parameters")); 823 828 824 829 /* global data? */ … … 840 845 bstrValue.asOutParam())); 841 846 842 RTPrintf( "Key: %ls, Value: %ls\n", bstrKey.raw(), bstrValue.raw());847 RTPrintf(Misc::tr("Key: %ls, Value: %ls\n"), bstrKey.raw(), bstrValue.raw()); 843 848 } 844 849 } … … 849 854 value.asOutParam())); 850 855 if (!value.isEmpty()) 851 RTPrintf( "Value: %ls\n", value.raw());856 RTPrintf(Misc::tr("Value: %ls\n"), value.raw()); 852 857 else 853 RTPrintf( "No value set!\n");858 RTPrintf(Misc::tr("No value set!\n")); 854 859 } 855 860 } … … 876 881 bstrValue.asOutParam())); 877 882 878 RTPrintf( "Key: %ls, Value: %ls\n", bstrKey.raw(), bstrValue.raw());883 RTPrintf(Misc::tr("Key: %ls, Value: %ls\n"), bstrKey.raw(), bstrValue.raw()); 879 884 } 880 885 } … … 885 890 value.asOutParam())); 886 891 if (!value.isEmpty()) 887 RTPrintf( "Value: %ls\n", value.raw());892 RTPrintf(Misc::tr("Value: %ls\n"), value.raw()); 888 893 else 889 RTPrintf( "No value set!\n");894 RTPrintf(Misc::tr("No value set!\n")); 890 895 } 891 896 } … … 899 904 900 905 if (a->argc < 2) 901 return errorSyntax(USAGE_SETEXTRADATA, "Not enough parameters");906 return errorSyntax(USAGE_SETEXTRADATA, Misc::tr("Not enough parameters")); 902 907 903 908 /* global data? */ … … 912 917 Bstr(a->argv[2]).raw())); 913 918 else 914 return errorSyntax(USAGE_SETEXTRADATA, "Too many parameters");919 return errorSyntax(USAGE_SETEXTRADATA, Misc::tr("Too many parameters")); 915 920 } 916 921 else … … 934 939 Bstr(a->argv[2]).raw())); 935 940 else 936 return errorSyntax(USAGE_SETEXTRADATA, "Too many parameters");941 return errorSyntax(USAGE_SETEXTRADATA, Misc::tr("Too many parameters")); 937 942 } 938 943 } … … 946 951 /* there must be two arguments: property name and value */ 947 952 if (a->argc != 2) 948 return errorSyntax(USAGE_SETPROPERTY, "Incorrect number of parameters");953 return errorSyntax(USAGE_SETPROPERTY, Misc::tr("Incorrect number of parameters")); 949 954 950 955 ComPtr<ISystemProperties> systemProperties; … … 968 973 fHwVirtExclusive = false; 969 974 else 970 return errorArgument( "Invalid hwvirtexclusive argument '%s'", a->argv[1]);975 return errorArgument(Misc::tr("Invalid hwvirtexclusive argument '%s'"), a->argv[1]); 971 976 CHECK_ERROR(systemProperties, COMSETTER(ExclusiveHwVirt)(fHwVirtExclusive)); 972 977 } … … 975 980 { 976 981 if (!strcmp(a->argv[0], "vrdpauthlibrary")) 977 RTStrmPrintf(g_pStdErr, "Warning: 'vrdpauthlibrary' is deprecated. Use 'vrdeauthlibrary'.\n");982 RTStrmPrintf(g_pStdErr, Misc::tr("Warning: 'vrdpauthlibrary' is deprecated. Use 'vrdeauthlibrary'.\n")); 978 983 979 984 /* reset to default? */ … … 1005 1010 vrc = RTStrToUInt32Ex(a->argv[1], NULL, 0, &uVal); 1006 1011 if (vrc != VINF_SUCCESS) 1007 return errorArgument( "Error parsing Log history count '%s'", a->argv[1]);1012 return errorArgument(Misc::tr("Error parsing Log history count '%s'"), a->argv[1]); 1008 1013 CHECK_ERROR(systemProperties, COMSETTER(LogHistoryCount)(uVal)); 1009 1014 } … … 1040 1045 enmProxyMode = ProxyMode_Manual; 1041 1046 else 1042 return errorArgument( "Unknown proxy mode: '%s'", a->argv[1]);1047 return errorArgument(Misc::tr("Unknown proxy mode: '%s'"), a->argv[1]); 1043 1048 CHECK_ERROR(systemProperties, COMSETTER(ProxyMode)(enmProxyMode)); 1044 1049 } … … 1071 1076 #endif 1072 1077 else 1073 return errorSyntax(USAGE_SETPROPERTY, "Invalid parameter '%s'", a->argv[0]);1078 return errorSyntax(USAGE_SETPROPERTY, Misc::tr("Invalid parameter '%s'"), a->argv[0]); 1074 1079 1075 1080 return SUCCEEDED(rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; … … 1134 1139 case VINF_GETOPT_NOT_OPTION: 1135 1140 if (pszMachineName) 1136 return errorArgument( "Machine name is given more than once: first '%s', then '%s'",1141 return errorArgument(Misc::tr("Machine name is given more than once: first '%s', then '%s'"), 1137 1142 pszMachineName, ValueUnion.psz); 1138 1143 pszMachineName = ValueUnion.psz; … … 1144 1149 1145 1150 if (!pszMachineName) 1146 return errorSyntax( "No machine was specified");1151 return errorSyntax(Misc::tr("No machine was specified")); 1147 1152 1148 1153 if (!pszName) 1149 return errorSyntax( "No shared folder name (--name) was given");1154 return errorSyntax(Misc::tr("No shared folder name (--name) was given")); 1150 1155 if (strchr(pszName, ' ')) 1151 return errorSyntax( "Invalid shared folder name '%s': contains space", pszName);1156 return errorSyntax(Misc::tr("Invalid shared folder name '%s': contains space"), pszName); 1152 1157 if (strchr(pszName, '\t')) 1153 return errorSyntax( "Invalid shared folder name '%s': contains tabs", pszName);1158 return errorSyntax(Misc::tr("Invalid shared folder name '%s': contains tabs"), pszName); 1154 1159 if (strchr(pszName, '\n') || strchr(pszName, '\r')) 1155 return errorSyntax( "Invalid shared folder name '%s': contains newline", pszName);1160 return errorSyntax(Misc::tr("Invalid shared folder name '%s': contains newline"), pszName); 1156 1161 1157 1162 if (!pszHostPath) 1158 return errorSyntax( "No host path (--hostpath) was given");1163 return errorSyntax(Misc::tr("No host path (--hostpath) was given")); 1159 1164 char szAbsHostPath[RTPATH_MAX]; 1160 1165 int vrc = RTPathAbs(pszHostPath, szAbsHostPath, sizeof(szAbsHostPath)); 1161 1166 if (RT_FAILURE(vrc)) 1162 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTAbsPath failed on '%s': %Rrc", pszHostPath, vrc);1167 return RTMsgErrorExit(RTEXITCODE_FAILURE, Misc::tr("RTAbsPath failed on '%s': %Rrc"), pszHostPath, vrc); 1163 1168 1164 1169 /* … … 1183 1188 CHECK_ERROR2I_RET(a->session, COMGETTER(Console)(ptrConsole.asOutParam()), RTEXITCODE_FAILURE); 1184 1189 if (ptrConsole.isNull()) 1185 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Machine '%s' is not currently running.", pszMachineName);1190 return RTMsgErrorExit(RTEXITCODE_FAILURE, Misc::tr("Machine '%s' is not currently running."), pszMachineName); 1186 1191 1187 1192 CHECK_ERROR2(hrc, ptrConsole, CreateSharedFolder(Bstr(pszName).raw(), Bstr(szAbsHostPath).raw(), … … 1246 1251 case VINF_GETOPT_NOT_OPTION: 1247 1252 if (pszMachineName) 1248 return errorArgument( "Machine name is given more than once: first '%s', then '%s'",1253 return errorArgument(Misc::tr("Machine name is given more than once: first '%s', then '%s'"), 1249 1254 pszMachineName, ValueUnion.psz); 1250 1255 pszMachineName = ValueUnion.psz; … … 1256 1261 1257 1262 if (!pszMachineName) 1258 return errorSyntax( "No machine was specified");1263 return errorSyntax(Misc::tr("No machine was specified")); 1259 1264 if (!pszName) 1260 return errorSyntax( "No shared folder name (--name) was given");1265 return errorSyntax(Misc::tr("No shared folder name (--name) was given")); 1261 1266 1262 1267 /* … … 1279 1284 CHECK_ERROR2I_RET(a->session, COMGETTER(Console)(ptrConsole.asOutParam()), RTEXITCODE_FAILURE); 1280 1285 if (ptrConsole.isNull()) 1281 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Machine '%s' is not currently running.\n", pszMachineName);1286 return RTMsgErrorExit(RTEXITCODE_FAILURE, Misc::tr("Machine '%s' is not currently running.\n"), pszMachineName); 1282 1287 1283 1288 CHECK_ERROR2(hrc, ptrConsole, RemoveSharedFolder(Bstr(pszName).raw())); … … 1311 1316 { 1312 1317 if (a->argc < 1) 1313 return errorSyntax( "Not enough parameters");1318 return errorSyntax(Misc::tr("Not enough parameters")); 1314 1319 1315 1320 if (!strcmp(a->argv[0], "add")) … … 1370 1375 case VINF_GETOPT_NOT_OPTION: 1371 1376 if (pszName) 1372 return errorSyntax( "Too many extension pack names given to \"extpack uninstall\"");1377 return errorSyntax(Misc::tr("Too many extension pack names given to \"extpack uninstall\"")); 1373 1378 pszName = ValueUnion.psz; 1374 1379 break; … … 1379 1384 } 1380 1385 if (!pszName) 1381 return errorSyntax( "No extension pack name was given to \"extpack install\"");1386 return errorSyntax(Misc::tr("No extension pack name was given to \"extpack install\"")); 1382 1387 1383 1388 char szPath[RTPATH_MAX]; 1384 1389 int vrc = RTPathAbs(pszName, szPath, sizeof(szPath)); 1385 1390 if (RT_FAILURE(vrc)) 1386 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTPathAbs(%s,,) failed with rc=%Rrc", pszName, vrc);1391 return RTMsgErrorExit(RTEXITCODE_FAILURE, Misc::tr("RTPathAbs(%s,,) failed with rc=%Rrc"), pszName, vrc); 1387 1392 1388 1393 Bstr bstrTarball(szPath); … … 1408 1413 AssertRCStmt(vrc, szDigest[0] = '\0'); 1409 1414 if (lstLicenseHashes.contains(szDigest)) 1410 RTPrintf( "License accepted.\n");1415 RTPrintf(Misc::tr("License accepted.\n")); 1411 1416 else 1412 1417 { 1413 1418 RTPrintf("%s\n", strLicense.c_str()); 1414 RTPrintf( "Do you agree to these license terms and conditions (y/n)? ");1419 RTPrintf(Misc::tr("Do you agree to these license terms and conditions (y/n)? ")); 1415 1420 ch = RTStrmGetCh(g_pStdIn); 1416 1421 RTPrintf("\n"); 1417 1422 if (ch != 'y' && ch != 'Y') 1418 1423 { 1419 RTPrintf( "Installation of \"%ls\" aborted.\n", bstrName.raw());1424 RTPrintf(Misc::tr("Installation of \"%ls\" aborted.\n"), bstrName.raw()); 1420 1425 return RTEXITCODE_FAILURE; 1421 1426 } 1422 1427 if (szDigest[0]) 1423 RTPrintf( "License accepted. For batch installation add\n"1424 "--accept-license=%s\n"1425 "to the VBoxManage command line.\n\n", szDigest);1428 RTPrintf(Misc::tr("License accepted. For batch installation add\n" 1429 "--accept-license=%s\n" 1430 "to the VBoxManage command line.\n\n"), szDigest); 1426 1431 } 1427 1432 } … … 1429 1434 CHECK_ERROR2I_RET(ptrExtPackFile, Install(fReplace, NULL, ptrProgress.asOutParam()), RTEXITCODE_FAILURE); 1430 1435 hrc = showProgress(ptrProgress); 1431 CHECK_PROGRESS_ERROR_RET(ptrProgress, ( "Failed to install \"%s\"", szPath), RTEXITCODE_FAILURE);1432 1433 RTPrintf( "Successfully installed \"%ls\".\n", bstrName.raw());1436 CHECK_PROGRESS_ERROR_RET(ptrProgress, (Misc::tr("Failed to install \"%s\""), szPath), RTEXITCODE_FAILURE); 1437 1438 RTPrintf(Misc::tr("Successfully installed \"%ls\".\n"), bstrName.raw()); 1434 1439 } 1435 1440 else if (!strcmp(a->argv[0], "uninstall")) … … 1455 1460 case VINF_GETOPT_NOT_OPTION: 1456 1461 if (pszName) 1457 return errorSyntax( "Too many extension pack names given to \"extpack uninstall\"");1462 return errorSyntax(Misc::tr("Too many extension pack names given to \"extpack uninstall\"")); 1458 1463 pszName = ValueUnion.psz; 1459 1464 break; … … 1464 1469 } 1465 1470 if (!pszName) 1466 return errorSyntax( "No extension pack name was given to \"extpack uninstall\"");1471 return errorSyntax(Misc::tr("No extension pack name was given to \"extpack uninstall\"")); 1467 1472 1468 1473 Bstr bstrName(pszName); … … 1470 1475 CHECK_ERROR2I_RET(ptrExtPackMgr, Uninstall(bstrName.raw(), fForced, NULL, ptrProgress.asOutParam()), RTEXITCODE_FAILURE); 1471 1476 hrc = showProgress(ptrProgress); 1472 CHECK_PROGRESS_ERROR_RET(ptrProgress, ( "Failed to uninstall \"%s\"", pszName), RTEXITCODE_FAILURE);1473 1474 RTPrintf( "Successfully uninstalled \"%s\".\n", pszName);1477 CHECK_PROGRESS_ERROR_RET(ptrProgress, (Misc::tr("Failed to uninstall \"%s\""), pszName), RTEXITCODE_FAILURE); 1478 1479 RTPrintf(Misc::tr("Successfully uninstalled \"%s\".\n"), pszName); 1475 1480 } 1476 1481 else if (!strcmp(a->argv[0], "cleanup")) … … 1480 1485 return errorTooManyParameters(&a->argv[1]); 1481 1486 CHECK_ERROR2I_RET(ptrExtPackMgr, Cleanup(), RTEXITCODE_FAILURE); 1482 RTPrintf( "Successfully performed extension pack cleanup\n");1487 RTPrintf(Misc::tr("Successfully performed extension pack cleanup\n")); 1483 1488 } 1484 1489 else … … 1522 1527 vrc = RTPathAbs(ValueUnion.psz, szIsoPath, sizeof(szIsoPath)); 1523 1528 if (RT_FAILURE(vrc)) 1524 return errorSyntax( "RTPathAbs failed on '%s': %Rrc", ValueUnion.psz, vrc);1529 return errorSyntax(Misc::tr("RTPathAbs failed on '%s': %Rrc"), ValueUnion.psz, vrc); 1525 1530 break; 1526 1531 … … 1538 1543 */ 1539 1544 if (szIsoPath[0] == '\0') 1540 return errorSyntax( "No ISO specified");1545 return errorSyntax(Misc::tr("No ISO specified")); 1541 1546 1542 1547 /* … … 1575 1580 else 1576 1581 { 1577 RTMsgInfo( "Detected '%s' to be:\n", szIsoPath);1578 RTPrintf( " OS TypeId = %ls\n"1579 " OS Version = %ls\n"1580 " OS Flavor = %ls\n"1581 " OS Languages = %ls\n"1582 " OS Hints = %ls\n",1582 RTMsgInfo(Misc::tr("Detected '%s' to be:\n"), szIsoPath); 1583 RTPrintf(Misc::tr(" OS TypeId = %ls\n" 1584 " OS Version = %ls\n" 1585 " OS Flavor = %ls\n" 1586 " OS Languages = %ls\n" 1587 " OS Hints = %ls\n"), 1583 1588 bstrDetectedOSTypeId.raw(), 1584 1589 bstrDetectedVersion.raw(), … … 1657 1662 case VINF_GETOPT_NOT_OPTION: 1658 1663 if (ptrMachine.isNotNull()) 1659 return errorSyntax( "VM name/UUID given more than once!");1664 return errorSyntax(Misc::tr("VM name/UUID given more than once!")); 1660 1665 CHECK_ERROR2_RET(hrc, a->virtualBox, FindMachine(Bstr(ValueUnion.psz).raw(), ptrMachine.asOutParam()), RTEXITCODE_FAILURE); 1661 1666 CHECK_ERROR2_RET(hrc, ptrUnattended, COMSETTER(Machine)(ptrMachine), RTEXITCODE_FAILURE); … … 1665 1670 vrc = RTPathAbs(ValueUnion.psz, szAbsPath, sizeof(szAbsPath)); 1666 1671 if (RT_FAILURE(vrc)) 1667 return errorSyntax( "RTPathAbs failed on '%s': %Rrc", ValueUnion.psz, vrc);1672 return errorSyntax(Misc::tr("RTPathAbs failed on '%s': %Rrc"), ValueUnion.psz, vrc); 1668 1673 CHECK_ERROR2_RET(hrc, ptrUnattended, COMSETTER(IsoPath)(Bstr(szAbsPath).raw()), RTEXITCODE_FAILURE); 1669 1674 break; … … 1704 1709 vrc = RTPathAbs(ValueUnion.psz, szAbsPath, sizeof(szAbsPath)); 1705 1710 if (RT_FAILURE(vrc)) 1706 return errorSyntax( "RTPathAbs failed on '%s': %Rrc", ValueUnion.psz, vrc);1711 return errorSyntax(Misc::tr("RTPathAbs failed on '%s': %Rrc"), ValueUnion.psz, vrc); 1707 1712 CHECK_ERROR2_RET(hrc, ptrUnattended, COMSETTER(AdditionsIsoPath)(Bstr(szAbsPath).raw()), RTEXITCODE_FAILURE); 1708 1713 break; … … 1717 1722 vrc = RTPathAbs(ValueUnion.psz, szAbsPath, sizeof(szAbsPath)); 1718 1723 if (RT_FAILURE(vrc)) 1719 return errorSyntax( "RTPathAbs failed on '%s': %Rrc", ValueUnion.psz, vrc);1724 return errorSyntax(Misc::tr("RTPathAbs failed on '%s': %Rrc"), ValueUnion.psz, vrc); 1720 1725 CHECK_ERROR2_RET(hrc, ptrUnattended, COMSETTER(ValidationKitIsoPath)(Bstr(szAbsPath).raw()), RTEXITCODE_FAILURE); 1721 1726 break; … … 1752 1757 vrc = RTPathAbs(ValueUnion.psz, szAbsPath, sizeof(szAbsPath)); 1753 1758 if (RT_FAILURE(vrc)) 1754 return errorSyntax( "RTPathAbs failed on '%s': %Rrc", ValueUnion.psz, vrc);1759 return errorSyntax(Misc::tr("RTPathAbs failed on '%s': %Rrc"), ValueUnion.psz, vrc); 1755 1760 CHECK_ERROR2_RET(hrc, ptrUnattended, COMSETTER(AuxiliaryBasePath)(Bstr(szAbsPath).raw()), RTEXITCODE_FAILURE); 1756 1761 break; … … 1763 1768 vrc = RTPathAbs(ValueUnion.psz, szAbsPath, sizeof(szAbsPath)); 1764 1769 if (RT_FAILURE(vrc)) 1765 return errorSyntax( "RTPathAbs failed on '%s': %Rrc", ValueUnion.psz, vrc);1770 return errorSyntax(Misc::tr("RTPathAbs failed on '%s': %Rrc"), ValueUnion.psz, vrc); 1766 1771 CHECK_ERROR2_RET(hrc, ptrUnattended, COMSETTER(ScriptTemplatePath)(Bstr(szAbsPath).raw()), RTEXITCODE_FAILURE); 1767 1772 break; … … 1770 1775 vrc = RTPathAbs(ValueUnion.psz, szAbsPath, sizeof(szAbsPath)); 1771 1776 if (RT_FAILURE(vrc)) 1772 return errorSyntax( "RTPathAbs failed on '%s': %Rrc", ValueUnion.psz, vrc);1777 return errorSyntax(Misc::tr("RTPathAbs failed on '%s': %Rrc"), ValueUnion.psz, vrc); 1773 1778 CHECK_ERROR2_RET(hrc, ptrUnattended, COMSETTER(PostInstallScriptTemplatePath)(Bstr(szAbsPath).raw()), RTEXITCODE_FAILURE); 1774 1779 break; … … 1799 1804 */ 1800 1805 if (ptrMachine.isNull()) 1801 return errorSyntax( "Missing VM name/UUID");1806 return errorSyntax(Misc::tr("Missing VM name/UUID")); 1802 1807 1803 1808 /* … … 1851 1856 return RTEXITCODE_FAILURE; 1852 1857 if (ptrConsole.isNotNull()) 1853 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Machine '%ls' is currently running", bstrMachineName.raw());1858 return RTMsgErrorExit(RTEXITCODE_FAILURE, Misc::tr("Machine '%ls' is currently running"), bstrMachineName.raw()); 1854 1859 } 1855 1860 … … 1857 1862 * Do the work. 1858 1863 */ 1859 RTMsgInfo( "%s unattended installation of %s in machine '%ls' (%ls).\n",1860 RTStrICmp(pszSessionType, "none") == 0 ? "Preparing" : "Starting",1864 RTMsgInfo(Misc::tr("%s unattended installation of %s in machine '%ls' (%ls).\n"), 1865 RTStrICmp(pszSessionType, "none") == 0 ? Misc::tr("Preparing") : Misc::tr("Starting"), 1861 1866 strInstalledOS.c_str(), bstrMachineName.raw(), bstrUuid.raw()); 1862 1867 … … 1871 1876 * Retrieve and display the parameters actually used. 1872 1877 */ 1873 RTMsgInfo( "Using values:\n");1878 RTMsgInfo(Misc::tr("Using values:\n")); 1874 1879 #define SHOW_ATTR(a_Attr, a_szText, a_Type, a_szFmt) do { \ 1875 1880 a_Type Value; \ … … 1878 1883 RTPrintf(" %32s = " a_szFmt "\n", a_szText, Value); \ 1879 1884 else \ 1880 RTPrintf( " %32s = failed: %Rhrc\n", a_szText, hrc2); \1885 RTPrintf(Misc::tr(" %32s = failed: %Rhrc\n"), a_szText, hrc2); \ 1881 1886 } while (0) 1882 1887 #define SHOW_STR_ATTR(a_Attr, a_szText) do { \ … … 1886 1891 RTPrintf(" %32s = %ls\n", a_szText, bstrString.raw()); \ 1887 1892 else \ 1888 RTPrintf( " %32s = failed: %Rhrc\n", a_szText, hrc2); \1893 RTPrintf(Misc::tr(" %32s = failed: %Rhrc\n"), a_szText, hrc2); \ 1889 1894 } while (0) 1890 1895 … … 1930 1935 { 1931 1936 if (!fDryRun) 1932 RTMsgInfo( "VM '%ls' (%ls) is ready to be started (e.g. VBoxManage startvm).\n", bstrMachineName.raw(), bstrUuid.raw());1937 RTMsgInfo(Misc::tr("VM '%ls' (%ls) is ready to be started (e.g. VBoxManage startvm).\n"), bstrMachineName.raw(), bstrUuid.raw()); 1933 1938 hrc = S_OK; 1934 1939 } … … 1949 1954 if (SUCCEEDED(hrc) && !ptrProgress.isNull()) 1950 1955 { 1951 RTMsgInfo( "Waiting for VM '%ls' to power on...\n", bstrMachineName.raw());1956 RTMsgInfo(Misc::tr("Waiting for VM '%ls' to power on...\n"), bstrMachineName.raw()); 1952 1957 CHECK_ERROR2(hrc, ptrProgress, WaitForCompletion(-1)); 1953 1958 if (SUCCEEDED(hrc)) … … 1964 1969 { 1965 1970 if (SUCCEEDED(iRc)) 1966 RTMsgInfo("VM '%ls' (%ls) has been successfully started.\n", bstrMachineName.raw(), bstrUuid.raw()); 1971 RTMsgInfo(Misc::tr("VM '%ls' (%ls) has been successfully started.\n"), 1972 bstrMachineName.raw(), bstrUuid.raw()); 1967 1973 else 1968 1974 { … … 2095 2101 /* check for required options */ 2096 2102 if (bstrProvider.isEmpty()) 2097 return errorSyntax(USAGE_CLOUDPROFILE, "Parameter --provider is required");2103 return errorSyntax(USAGE_CLOUDPROFILE, Misc::tr("Parameter --provider is required")); 2098 2104 if (bstrProfile.isEmpty()) 2099 return errorSyntax(USAGE_CLOUDPROFILE, "Parameter --profile is required");2105 return errorSyntax(USAGE_CLOUDPROFILE, Misc::tr("Parameter --profile is required")); 2100 2106 2101 2107 ComPtr<IVirtualBox> pVirtualBox = a->virtualBox; … … 2126 2132 CHECK_ERROR2(hrc, pCloudProvider, SaveProfiles()); 2127 2133 2128 RTPrintf( "Provider %ls: profile '%ls' was updated.\n",bstrProvider.raw(), bstrProfile.raw());2134 RTPrintf(Misc::tr("Provider %ls: profile '%ls' was updated.\n"),bstrProvider.raw(), bstrProfile.raw()); 2129 2135 2130 2136 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; … … 2145 2151 /* check for required options */ 2146 2152 if (bstrProvider.isEmpty()) 2147 return errorSyntax(USAGE_CLOUDPROFILE, "Parameter --provider is required");2153 return errorSyntax(USAGE_CLOUDPROFILE, Misc::tr("Parameter --provider is required")); 2148 2154 if (bstrProfile.isEmpty()) 2149 return errorSyntax(USAGE_CLOUDPROFILE, "Parameter --profile is required");2155 return errorSyntax(USAGE_CLOUDPROFILE, Misc::tr("Parameter --profile is required")); 2150 2156 2151 2157 ComPtr<IVirtualBox> pVirtualBox = a->virtualBox; … … 2168 2174 Bstr bstrProviderID; 2169 2175 pCloudProfile->COMGETTER(ProviderId)(bstrProviderID.asOutParam()); 2170 RTPrintf( "Provider GUID: %ls\n", bstrProviderID.raw());2176 RTPrintf(Misc::tr("Provider GUID: %ls\n"), bstrProviderID.raw()); 2171 2177 2172 2178 com::SafeArray<BSTR> names; … … 2184 2190 value = values[k]; 2185 2191 RTPrintf("%s%ls=%ls\n", 2186 fFirst ? "Property: ": " ",2192 fFirst ? Misc::tr("Property: ") : " ", 2187 2193 names[k], value.raw()); 2188 2194 fFirst = false; … … 2205 2211 /* check for required options */ 2206 2212 if (bstrProvider.isEmpty()) 2207 return errorSyntax(USAGE_CLOUDPROFILE, "Parameter --provider is required");2213 return errorSyntax(USAGE_CLOUDPROFILE, Misc::tr("Parameter --provider is required")); 2208 2214 if (bstrProfile.isEmpty()) 2209 return errorSyntax(USAGE_CLOUDPROFILE, "Parameter --profile is required");2215 return errorSyntax(USAGE_CLOUDPROFILE, Misc::tr("Parameter --profile is required")); 2210 2216 2211 2217 /* … … 2289 2295 CHECK_ERROR2(hrc, pCloudProvider, SaveProfiles()); 2290 2296 2291 RTPrintf( "Provider %ls: profile '%ls' was added.\n",bstrProvider.raw(), bstrProfile.raw());2297 RTPrintf(Misc::tr("Provider %ls: profile '%ls' was added.\n"),bstrProvider.raw(), bstrProfile.raw()); 2292 2298 2293 2299 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; … … 2303 2309 /* check for required options */ 2304 2310 if (bstrProvider.isEmpty()) 2305 return errorSyntax(USAGE_CLOUDPROFILE, "Parameter --provider is required");2311 return errorSyntax(USAGE_CLOUDPROFILE, Misc::tr("Parameter --provider is required")); 2306 2312 if (bstrProfile.isEmpty()) 2307 return errorSyntax(USAGE_CLOUDPROFILE, "Parameter --profile is required");2313 return errorSyntax(USAGE_CLOUDPROFILE, Misc::tr("Parameter --profile is required")); 2308 2314 2309 2315 ComPtr<IVirtualBox> pVirtualBox = a->virtualBox; … … 2332 2338 RTEXITCODE_FAILURE); 2333 2339 2334 RTPrintf( "Provider %ls: profile '%ls' was deleted.\n",bstrProvider.raw(), bstrProfile.raw());2340 RTPrintf(Misc::tr("Provider %ls: profile '%ls' was deleted.\n"), bstrProvider.raw(), bstrProfile.raw()); 2335 2341 } 2336 2342
Note:
See TracChangeset
for help on using the changeset viewer.