mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-31 01:24:12 +02:00
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
This commit is contained in:
parent
a71003f249
commit
10516d293f
@ -218,8 +218,12 @@ GetNameFromHandle (
|
|||||||
CHAR16 *NameString;
|
CHAR16 *NameString;
|
||||||
UINTN StringSize;
|
UINTN StringSize;
|
||||||
CHAR8 *PlatformLanguage;
|
CHAR8 *PlatformLanguage;
|
||||||
|
CHAR8 *BestLanguage;
|
||||||
EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2;
|
EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2;
|
||||||
|
|
||||||
|
BestLanguage = NULL;
|
||||||
|
PlatformLanguage = NULL;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Method 1: Get the name string from image PDB
|
// Method 1: Get the name string from image PDB
|
||||||
//
|
//
|
||||||
@ -269,13 +273,23 @@ GetNameFromHandle (
|
|||||||
// Get the current platform language setting
|
// Get the current platform language setting
|
||||||
//
|
//
|
||||||
GetEfiGlobalVariable2 (L"PlatformLang", (VOID**)&PlatformLanguage, NULL);
|
GetEfiGlobalVariable2 (L"PlatformLang", (VOID**)&PlatformLanguage, NULL);
|
||||||
|
|
||||||
|
BestLanguage = GetBestLanguage(
|
||||||
|
ComponentName2->SupportedLanguages,
|
||||||
|
FALSE,
|
||||||
|
PlatformLanguage,
|
||||||
|
ComponentName2->SupportedLanguages,
|
||||||
|
NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
SafeFreePool (PlatformLanguage);
|
||||||
Status = ComponentName2->GetDriverName (
|
Status = ComponentName2->GetDriverName (
|
||||||
ComponentName2,
|
ComponentName2,
|
||||||
PlatformLanguage != NULL ? PlatformLanguage : "en-US",
|
BestLanguage,
|
||||||
&StringPtr
|
&StringPtr
|
||||||
);
|
);
|
||||||
|
SafeFreePool (BestLanguage);
|
||||||
if (!EFI_ERROR (Status)) {
|
if (!EFI_ERROR (Status)) {
|
||||||
SafeFreePool (PlatformLanguage);
|
|
||||||
StrnCpy (mGaugeString, StringPtr, DP_GAUGE_STRING_LENGTH);
|
StrnCpy (mGaugeString, StringPtr, DP_GAUGE_STRING_LENGTH);
|
||||||
mGaugeString[DP_GAUGE_STRING_LENGTH] = 0;
|
mGaugeString[DP_GAUGE_STRING_LENGTH] = 0;
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user