Changeset 91314 in vbox for trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
- Timestamp:
- Sep 20, 2021 12:29:18 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 146975
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
r91312 r91314 599 599 600 600 char szNlsPath[RTPATH_MAX]; 601 rc = RTPathAppPrivateNoArch(szNlsPath, sizeof(szNlsPath)); 602 if (RT_SUCCESS(rc)) 603 rc = RTPathAppend(szNlsPath, sizeof(szNlsPath), "nls" RTPATH_SLASH_STR "VirtualBoxAPI"); 604 605 int vrc = m->pVBoxTranslator->registerTranslation(szNlsPath, true, &m->pTrComponent); 601 int vrc = RTPathAppPrivateNoArch(szNlsPath, sizeof(szNlsPath)); 602 if (RT_SUCCESS(vrc)) 603 vrc = RTPathAppend(szNlsPath, sizeof(szNlsPath), "nls" RTPATH_SLASH_STR "VirtualBoxAPI"); 604 606 605 if (RT_SUCCESS(vrc)) 607 606 { 608 com::Utf8Str strLocale; 609 HRESULT hrc = m->pSystemProperties->getLanguageId(strLocale); 610 if (SUCCEEDED(hrc)) 607 vrc = m->pVBoxTranslator->registerTranslation(szNlsPath, true, &m->pTrComponent); 608 if (RT_SUCCESS(vrc)) 611 609 { 612 vrc = m->pVBoxTranslator->i_loadLanguage(strLocale.c_str()); 613 if (RT_FAILURE(vrc)) 610 com::Utf8Str strLocale; 611 HRESULT hrc = m->pSystemProperties->getLanguageId(strLocale); 612 if (SUCCEEDED(hrc)) 614 613 { 615 hrc = Global::vboxStatusCodeToCOM(vrc); 616 LogRel(("Load language failed (%Rhrc).\n", hrc)); 614 vrc = m->pVBoxTranslator->i_loadLanguage(strLocale.c_str()); 615 if (RT_FAILURE(vrc)) 616 { 617 hrc = Global::vboxStatusCodeToCOM(vrc); 618 LogRel(("Load language failed (%Rhrc).\n", hrc)); 619 } 620 } 621 else 622 { 623 LogRel(("Getting language settings failed (%Rhrc).\n", hrc)); 624 m->pVBoxTranslator->release(); 625 m->pVBoxTranslator = NULL; 626 m->pTrComponent = NULL; 617 627 } 618 628 } 619 629 else 620 630 { 621 LogRel(("Getting language settings failed (%Rhrc).\n", hrc)); 631 HRESULT hrc = Global::vboxStatusCodeToCOM(vrc); 632 LogRel(("Register translation failed (%Rhrc).\n", hrc)); 622 633 m->pVBoxTranslator->release(); 623 634 m->pVBoxTranslator = NULL; … … 628 639 { 629 640 HRESULT hrc = Global::vboxStatusCodeToCOM(vrc); 630 LogRel((" Register translationfailed (%Rhrc).\n", hrc));641 LogRel(("Path constructing failed (%Rhrc).\n", hrc)); 631 642 m->pVBoxTranslator->release(); 632 643 m->pVBoxTranslator = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.