diff options
author | Eric Dong <eric.dong@intel.com> | 2013-09-05 05:39:57 +0000 |
---|---|---|
committer | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-09-05 05:39:57 +0000 |
commit | 10516d293f5734504adce90c6136440beb4dab6f (patch) | |
tree | 4f62f90975cf2d354fbe72001ac9dfc5d1f048f7 /PerformancePkg | |
parent | a71003f2491a26b96b808064d35c8fd01d6422ed (diff) | |
download | edk2-platforms-10516d293f5734504adce90c6136440beb4dab6f.tar.xz |
Refine the select language logic.
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14630 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'PerformancePkg')
-rw-r--r-- | PerformancePkg/Dp_App/DpUtilities.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/PerformancePkg/Dp_App/DpUtilities.c b/PerformancePkg/Dp_App/DpUtilities.c index 4daca0b853..65efb80c80 100644 --- a/PerformancePkg/Dp_App/DpUtilities.c +++ b/PerformancePkg/Dp_App/DpUtilities.c @@ -218,8 +218,12 @@ GetNameFromHandle ( CHAR16 *NameString;
UINTN StringSize;
CHAR8 *PlatformLanguage;
+ CHAR8 *BestLanguage;
EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2;
+ BestLanguage = NULL;
+ PlatformLanguage = NULL;
+
//
// Method 1: Get the name string from image PDB
//
@@ -269,13 +273,23 @@ GetNameFromHandle ( // Get the current platform language setting
//
GetEfiGlobalVariable2 (L"PlatformLang", (VOID**)&PlatformLanguage, NULL);
+
+ BestLanguage = GetBestLanguage(
+ ComponentName2->SupportedLanguages,
+ FALSE,
+ PlatformLanguage,
+ ComponentName2->SupportedLanguages,
+ NULL
+ );
+
+ SafeFreePool (PlatformLanguage);
Status = ComponentName2->GetDriverName (
ComponentName2,
- PlatformLanguage != NULL ? PlatformLanguage : "en-US",
+ BestLanguage,
&StringPtr
);
+ SafeFreePool (BestLanguage);
if (!EFI_ERROR (Status)) {
- SafeFreePool (PlatformLanguage);
StrnCpy (mGaugeString, StringPtr, DP_GAUGE_STRING_LENGTH);
mGaugeString[DP_GAUGE_STRING_LENGTH] = 0;
return;
|