VirtualBox

Changeset 91503 in vbox for trunk/src/VBox/Main/src-all


Ignore:
Timestamp:
Oct 1, 2021 8:57:59 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
147192
Message:

Main: bugref:1909: Added missed translation marks, removed redundant ones. Expanded one macro to make the lupdate get string correctly. Removed GuestBase::setErrorExternal and changed calls from it to setErrorBoth to handle translation correctly.

Location:
trunk/src/VBox/Main/src-all
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-all/AutoCaller.cpp

    r85929 r91503  
    2323#include "LoggingNew.h"
    2424
     25#include "VBoxNls.h"
     26
     27
     28DECLARE_TRANSLATION_CONTEXT(AutoCallerCtx);
    2529
    2630////////////////////////////////////////////////////////////////////////////////
     
    201205    {
    202206        if (mState == Limited)
    203             rc = mObj->setError(rc, "The object functionality is limited");
     207            rc = mObj->setError(rc, AutoCallerCtx::tr("The object functionality is limited"));
    204208        else if (FAILED(mFailedRC) && mFailedRC != E_ACCESSDENIED)
    205209        {
     
    210214        }
    211215        else
    212             rc = mObj->setError(rc, "The object is not ready");
     216            rc = mObj->setError(rc, AutoCallerCtx::tr("The object is not ready"));
    213217    }
    214218
  • trunk/src/VBox/Main/src-all/EventImpl.cpp

    r85300 r91503  
    12991299    STDMETHOD(HandleEvent)(IEvent *)
    13001300    {
    1301         ComAssertMsgRet(false, ("HandleEvent() of wrapper shall never be called"),
     1301        ComAssertMsgRet(false, (tr("HandleEvent() of wrapper shall never be called")),
    13021302                        E_FAIL);
    13031303    }
     
    14431443
    14441444    HRESULT rc = listener.createObject();
    1445     ComAssertMsgRet(SUCCEEDED(rc), ("Could not create wrapper object (%Rhrc)", rc),
     1445    ComAssertMsgRet(SUCCEEDED(rc), (tr("Could not create wrapper object (%Rhrc)"), rc),
    14461446                    E_FAIL);
    14471447    listener.queryInterfaceTo(aListener.asOutParam());
     
    14551455
    14561456    HRESULT rc = agg.createObject();
    1457     ComAssertMsgRet(SUCCEEDED(rc), ("Could not create aggregator (%Rhrc)", rc),
     1457    ComAssertMsgRet(SUCCEEDED(rc), (tr("Could not create aggregator (%Rhrc)"), rc),
    14581458                    E_FAIL);
    14591459
     
    14741474
    14751475    rc = mSource.createObject();
    1476     ComAssertMsgRet(SUCCEEDED(rc), ("Could not create source (%Rhrc)", rc),
     1476    ComAssertMsgRet(SUCCEEDED(rc), (tr("Could not create source (%Rhrc)"), rc),
    14771477                    E_FAIL);
    14781478    rc = mSource->init();
    1479     ComAssertMsgRet(SUCCEEDED(rc), ("Could not init source (%Rhrc)", rc),
     1479    ComAssertMsgRet(SUCCEEDED(rc), (tr("Could not init source (%Rhrc)"), rc),
    14801480                    E_FAIL);
    14811481
     
    16131613
    16141614    HRESULT rc = proxy.createObject();
    1615     ComAssertMsgRet(SUCCEEDED(rc), ("Could not create proxy (%Rhrc)", rc),
     1615    ComAssertMsgRet(SUCCEEDED(rc), (tr("Could not create proxy (%Rhrc)"), rc),
    16161616                    E_FAIL);
    16171617
  • trunk/src/VBox/Main/src-all/Global.cpp

    r91470 r91503  
    2424#include <iprt/errcore.h>
    2525
     26#include "VBoxNls.h"
     27
     28DECLARE_TRANSLATION_CONTEXT(GlobalCtx);
     29
     30
    2631/* static */
    2732const Global::OSType Global::sOSTypes[] =
     
    581586    switch (aState)
    582587    {
    583         case MachineState_Null:                 return "Null";
    584         case MachineState_PoweredOff:           return "PoweredOff";
    585         case MachineState_Saved:                return "Saved";
    586         case MachineState_Teleported:           return "Teleported";
    587         case MachineState_Aborted:              return "Aborted";
    588         case MachineState_AbortedSaved:         return "Aborted-Saved";
    589         case MachineState_Running:              return "Running";
    590         case MachineState_Paused:               return "Paused";
    591         case MachineState_Stuck:                return "GuruMeditation";
    592         case MachineState_Teleporting:          return "Teleporting";
    593         case MachineState_LiveSnapshotting:     return "LiveSnapshotting";
    594         case MachineState_Starting:             return "Starting";
    595         case MachineState_Stopping:             return "Stopping";
    596         case MachineState_Saving:               return "Saving";
    597         case MachineState_Restoring:            return "Restoring";
    598         case MachineState_TeleportingPausedVM:  return "TeleportingPausedVM";
    599         case MachineState_TeleportingIn:        return "TeleportingIn";
    600         case MachineState_DeletingSnapshotOnline: return "DeletingSnapshotOnline";
    601         case MachineState_DeletingSnapshotPaused: return "DeletingSnapshotPaused";
    602         case MachineState_OnlineSnapshotting:   return "OnlineSnapshotting";
    603         case MachineState_RestoringSnapshot:    return "RestoringSnapshot";
    604         case MachineState_DeletingSnapshot:     return "DeletingSnapshot";
    605         case MachineState_SettingUp:            return "SettingUp";
    606         case MachineState_Snapshotting:         return "Snapshotting";
     588        case MachineState_Null:                 return GlobalCtx::tr("Null");
     589        case MachineState_PoweredOff:           return GlobalCtx::tr("PoweredOff");
     590        case MachineState_Saved:                return GlobalCtx::tr("Saved");
     591        case MachineState_Teleported:           return GlobalCtx::tr("Teleported");
     592        case MachineState_Aborted:              return GlobalCtx::tr("Aborted");
     593        case MachineState_AbortedSaved:         return GlobalCtx::tr("Aborted-Saved");
     594        case MachineState_Running:              return GlobalCtx::tr("Running");
     595        case MachineState_Paused:               return GlobalCtx::tr("Paused");
     596        case MachineState_Stuck:                return GlobalCtx::tr("GuruMeditation");
     597        case MachineState_Teleporting:          return GlobalCtx::tr("Teleporting");
     598        case MachineState_LiveSnapshotting:     return GlobalCtx::tr("LiveSnapshotting");
     599        case MachineState_Starting:             return GlobalCtx::tr("Starting");
     600        case MachineState_Stopping:             return GlobalCtx::tr("Stopping");
     601        case MachineState_Saving:               return GlobalCtx::tr("Saving");
     602        case MachineState_Restoring:            return GlobalCtx::tr("Restoring");
     603        case MachineState_TeleportingPausedVM:  return GlobalCtx::tr("TeleportingPausedVM");
     604        case MachineState_TeleportingIn:        return GlobalCtx::tr("TeleportingIn");
     605        case MachineState_DeletingSnapshotOnline: return GlobalCtx::tr("DeletingSnapshotOnline");
     606        case MachineState_DeletingSnapshotPaused: return GlobalCtx::tr("DeletingSnapshotPaused");
     607        case MachineState_OnlineSnapshotting:   return GlobalCtx::tr("OnlineSnapshotting");
     608        case MachineState_RestoringSnapshot:    return GlobalCtx::tr("RestoringSnapshot");
     609        case MachineState_DeletingSnapshot:     return GlobalCtx::tr("DeletingSnapshot");
     610        case MachineState_SettingUp:            return GlobalCtx::tr("SettingUp");
     611        case MachineState_Snapshotting:         return GlobalCtx::tr("Snapshotting");
    607612        default:
    608613        {
    609614            AssertMsgFailed(("%d (%#x)\n", aState, aState));
    610615            static char s_szMsg[48];
    611             RTStrPrintf(s_szMsg, sizeof(s_szMsg), "InvalidState-0x%08x\n", aState);
     616            RTStrPrintf(s_szMsg, sizeof(s_szMsg), GlobalCtx::tr("InvalidState-0x%08x\n"), aState);
    612617            return s_szMsg;
    613618        }
     
    620625    switch (aState)
    621626    {
    622         case SessionState_Null:         return "Null";
    623         case SessionState_Unlocked:     return "Unlocked";
    624         case SessionState_Locked:       return "Locked";
    625         case SessionState_Spawning:     return "Spawning";
    626         case SessionState_Unlocking:    return "Unlocking";
     627        case SessionState_Null:         return GlobalCtx::tr("Null");
     628        case SessionState_Unlocked:     return GlobalCtx::tr("Unlocked");
     629        case SessionState_Locked:       return GlobalCtx::tr("Locked");
     630        case SessionState_Spawning:     return GlobalCtx::tr("Spawning");
     631        case SessionState_Unlocking:    return GlobalCtx::tr("Unlocking");
    627632        default:
    628633        {
    629634            AssertMsgFailed(("%d (%#x)\n", aState, aState));
    630635            static char s_szMsg[48];
    631             RTStrPrintf(s_szMsg, sizeof(s_szMsg), "InvalidState-0x%08x\n", aState);
     636            RTStrPrintf(s_szMsg, sizeof(s_szMsg), GlobalCtx::tr("InvalidState-0x%08x\n"), aState);
    632637            return s_szMsg;
    633638        }
     
    640645    switch (aType)
    641646    {
    642         case DeviceType_Null:         return "Null";
    643         case DeviceType_Floppy:       return "Floppy";
    644         case DeviceType_DVD:          return "DVD";
    645         case DeviceType_HardDisk:     return "HardDisk";
    646         case DeviceType_Network:      return "Network";
    647         case DeviceType_USB:          return "USB";
    648         case DeviceType_SharedFolder: return "ShardFolder";
     647        case DeviceType_Null:         return GlobalCtx::tr("Null");
     648        case DeviceType_Floppy:       return GlobalCtx::tr("Floppy");
     649        case DeviceType_DVD:          return GlobalCtx::tr("DVD");
     650        case DeviceType_HardDisk:     return GlobalCtx::tr("HardDisk");
     651        case DeviceType_Network:      return GlobalCtx::tr("Network");
     652        case DeviceType_USB:          return GlobalCtx::tr("USB");
     653        case DeviceType_SharedFolder: return GlobalCtx::tr("ShardFolder");
    649654        default:
    650655        {
    651656            AssertMsgFailed(("%d (%#x)\n", aType, aType));
    652657            static char s_szMsg[48];
    653             RTStrPrintf(s_szMsg, sizeof(s_szMsg), "InvalidType-0x%08x\n", aType);
     658            RTStrPrintf(s_szMsg, sizeof(s_szMsg), GlobalCtx::tr("InvalidType-0x%08x\n"), aType);
    654659            return s_szMsg;
    655660        }
     
    663668    switch (aReason)
    664669    {
    665         case Reason_Unspecified:      return "unspecified";
    666         case Reason_HostSuspend:      return "host suspend";
    667         case Reason_HostResume:       return "host resume";
    668         case Reason_HostBatteryLow:   return "host battery low";
    669         case Reason_Snapshot:         return "snapshot";
     670        case Reason_Unspecified:      return GlobalCtx::tr("unspecified");
     671        case Reason_HostSuspend:      return GlobalCtx::tr("host suspend");
     672        case Reason_HostResume:       return GlobalCtx::tr("host resume");
     673        case Reason_HostBatteryLow:   return GlobalCtx::tr("host battery low");
     674        case Reason_Snapshot:         return GlobalCtx::tr("snapshot");
    670675        default:
    671676        {
    672677            AssertMsgFailed(("%d (%#x)\n", aReason, aReason));
    673678            static char s_szMsg[48];
    674             RTStrPrintf(s_szMsg, sizeof(s_szMsg), "invalid reason %#010x\n", aReason);
     679            RTStrPrintf(s_szMsg, sizeof(s_szMsg), GlobalCtx::tr("invalid reason %#010x\n"), aReason);
    675680            return s_szMsg;
    676681        }
  • trunk/src/VBox/Main/src-all/TextScript.cpp

    r90828 r91503  
    194194HRESULT GeneralTextScript::parse()
    195195{
    196 //  AssertReturn(!mfDataParsed, mpSetError->setErrorBoth(E_FAIL, VERR_WRONG_ORDER, "parse called more than once"));
     196//  AssertReturn(!mfDataParsed, mpSetError->setErrorBoth(E_FAIL, VERR_WRONG_ORDER, tr("parse called more than once")));
    197197
    198198    /*
     
    215215HRESULT GeneralTextScript::saveToString(Utf8Str &rStrDst)
    216216{
    217     AssertReturn(mfDataParsed, mpSetError->setErrorBoth(E_FAIL, VERR_WRONG_ORDER, "saveToString() called before parse()"));
     217    AssertReturn(mfDataParsed, mpSetError->setErrorBoth(E_FAIL, VERR_WRONG_ORDER, tr("saveToString() called before parse()")));
    218218
    219219    /*
     
    264264{
    265265    AssertReturn(idxLine < mScriptContentByLines.size(),
    266                  mpSetError->setErrorBoth(E_FAIL, VERR_OUT_OF_RANGE, "attempting to set line %zu when there are only %zu lines",
     266                 mpSetError->setErrorBoth(E_FAIL, VERR_OUT_OF_RANGE, tr("attempting to set line %zu when there are only %zu lines"),
    267267                                          idxLine, mScriptContentByLines.size()));
    268268    try
     
    293293    AssertReturn(idxLine < mScriptContentByLines.size(),
    294294                 mpSetError->setErrorBoth(E_FAIL, VERR_OUT_OF_RANGE,
    295                                           "attempting search&replace in line %zu when there are only %zu lines",
     295                                          tr("attempting search&replace in line %zu when there are only %zu lines"),
    296296                                          idxLine, mScriptContentByLines.size()));
    297297
     
    320320{
    321321    AssertReturn(idxLine < mScriptContentByLines.size(),
    322                  mpSetError->setErrorBoth(E_FAIL, VERR_OUT_OF_RANGE, "appending to line %zu when there are only %zu lines",
     322                 mpSetError->setErrorBoth(E_FAIL, VERR_OUT_OF_RANGE, tr("appending to line %zu when there are only %zu lines"),
    323323                                          idxLine, mScriptContentByLines.size()));
    324324
     
    337337{
    338338    AssertReturn(idxLine < mScriptContentByLines.size(),
    339                  mpSetError->setErrorBoth(E_FAIL, VERR_OUT_OF_RANGE, "prepending to line %zu when there are only %zu lines",
     339                 mpSetError->setErrorBoth(E_FAIL, VERR_OUT_OF_RANGE, tr("prepending to line %zu when there are only %zu lines"),
    340340                                          idxLine, mScriptContentByLines.size()));
    341341
  • trunk/src/VBox/Main/src-all/VirtualBoxBase.cpp

    r91373 r91503  
    231231                                 true /* aLogIt */,
    232232                                 0 /* aResultDetail */,
    233                                  tr("%s.\n%s[%d] (%s)"),
     233                                 "%s.\n%s[%d] (%s)",
    234234                                 err.what(), pszFile, iLine, pszFunction);
    235235    }
     
    346346        switch (aResultCode)
    347347        {
    348             case E_INVALIDARG:                 strText = "A parameter has an invalid value"; break;
    349             case E_POINTER:                    strText = "A parameter is an invalid pointer"; break;
    350             case E_UNEXPECTED:                 strText = "The result of the operation is unexpected"; break;
    351             case E_ACCESSDENIED:               strText = "The access to an object is not allowed"; break;
    352             case E_OUTOFMEMORY:                strText = "The allocation of new memory failed"; break;
    353             case E_NOTIMPL:                    strText = "The requested operation is not implemented"; break;
    354             case E_NOINTERFACE:                strText = "The requested interface is not implemented"; break;
    355             case E_FAIL:                       strText = "A general error occurred"; break;
    356             case E_ABORT:                      strText = "The operation was canceled"; break;
    357             case VBOX_E_OBJECT_NOT_FOUND:      strText = "Object corresponding to the supplied arguments does not exist"; break;
    358             case VBOX_E_INVALID_VM_STATE:      strText = "Current virtual machine state prevents the operation"; break;
    359             case VBOX_E_VM_ERROR:              strText = "Virtual machine error occurred attempting the operation"; break;
    360             case VBOX_E_FILE_ERROR:            strText = "File not accessible or erroneous file contents"; break;
    361             case VBOX_E_IPRT_ERROR:            strText = "Runtime subsystem error"; break;
    362             case VBOX_E_PDM_ERROR:             strText = "Pluggable Device Manager error"; break;
    363             case VBOX_E_INVALID_OBJECT_STATE:  strText = "Current object state prohibits operation"; break;
    364             case VBOX_E_HOST_ERROR:            strText = "Host operating system related error"; break;
    365             case VBOX_E_NOT_SUPPORTED:         strText = "Requested operation is not supported"; break;
    366             case VBOX_E_XML_ERROR:             strText = "Invalid XML found"; break;
    367             case VBOX_E_INVALID_SESSION_STATE: strText = "Current session state prohibits operation"; break;
    368             case VBOX_E_OBJECT_IN_USE:         strText = "Object being in use prohibits operation"; break;
    369             case VBOX_E_PASSWORD_INCORRECT:    strText = "Incorrect password provided"; break;
    370             default:                           strText = "Unknown error"; break;
     348            case E_INVALIDARG:                 strText = tr("A parameter has an invalid value"); break;
     349            case E_POINTER:                    strText = tr("A parameter is an invalid pointer"); break;
     350            case E_UNEXPECTED:                 strText = tr("The result of the operation is unexpected"); break;
     351            case E_ACCESSDENIED:               strText = tr("The access to an object is not allowed"); break;
     352            case E_OUTOFMEMORY:                strText = tr("The allocation of new memory failed"); break;
     353            case E_NOTIMPL:                    strText = tr("The requested operation is not implemented"); break;
     354            case E_NOINTERFACE:                strText = tr("The requested interface is not implemented"); break;
     355            case E_FAIL:                       strText = tr("A general error occurred"); break;
     356            case E_ABORT:                      strText = tr("The operation was canceled"); break;
     357            case VBOX_E_OBJECT_NOT_FOUND:      strText = tr("Object corresponding to the supplied arguments does not exist"); break;
     358            case VBOX_E_INVALID_VM_STATE:      strText = tr("Current virtual machine state prevents the operation"); break;
     359            case VBOX_E_VM_ERROR:              strText = tr("Virtual machine error occurred attempting the operation"); break;
     360            case VBOX_E_FILE_ERROR:            strText = tr("File not accessible or erroneous file contents"); break;
     361            case VBOX_E_IPRT_ERROR:            strText = tr("Runtime subsystem error"); break;
     362            case VBOX_E_PDM_ERROR:             strText = tr("Pluggable Device Manager error"); break;
     363            case VBOX_E_INVALID_OBJECT_STATE:  strText = tr("Current object state prohibits operation"); break;
     364            case VBOX_E_HOST_ERROR:            strText = tr("Host operating system related error"); break;
     365            case VBOX_E_NOT_SUPPORTED:         strText = tr("Requested operation is not supported"); break;
     366            case VBOX_E_XML_ERROR:             strText = tr("Invalid XML found"); break;
     367            case VBOX_E_INVALID_SESSION_STATE: strText = tr("Current session state prohibits operation"); break;
     368            case VBOX_E_OBJECT_IN_USE:         strText = tr("Object being in use prohibits operation"); break;
     369            case VBOX_E_PASSWORD_INCORRECT:    strText = tr("Incorrect password provided"); break;
     370            default:                           strText = tr("Unknown error"); break;
    371371        }
    372372    }
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette