mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-29 16:44:10 +02:00
Add GetCurrentLanguage() to HiiLib in MdeModulePkg
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6758 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
aad6137d5c
commit
11e9250309
@ -497,4 +497,26 @@ Rfc3066ToIso639 (
|
|||||||
CHAR8 *SupportedLanguages
|
CHAR8 *SupportedLanguages
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Determine what is the current language setting. The space reserved for Lang
|
||||||
|
must be at least RFC_3066_ENTRY_SIZE bytes;
|
||||||
|
|
||||||
|
If Lang is NULL, then ASSERT.
|
||||||
|
|
||||||
|
@param Lang Pointer of system language. Lang will always be filled with
|
||||||
|
a valid RFC 3066 language string. If "PlatformLang" is not
|
||||||
|
set in the system, the default language specifed by PcdUefiVariableDefaultPlatformLang
|
||||||
|
is returned.
|
||||||
|
|
||||||
|
@return EFI_SUCCESS If the EFI Variable with "PlatformLang" is set and return in Lang.
|
||||||
|
@return EFI_NOT_FOUND If the EFI Variable with "PlatformLang" is not set, but a valid default language is return in Lang.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
GetCurrentLanguage (
|
||||||
|
OUT CHAR8 *Lang
|
||||||
|
);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -204,3 +204,50 @@ HiiLibGetSupportedSecondaryLanguages (
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Determine what is the current language setting. The space reserved for Lang
|
||||||
|
must be at least RFC_3066_ENTRY_SIZE bytes;
|
||||||
|
|
||||||
|
If Lang is NULL, then ASSERT.
|
||||||
|
|
||||||
|
@param Lang Pointer of system language. Lang will always be filled with
|
||||||
|
a valid RFC 3066 language string. If "PlatformLang" is not
|
||||||
|
set in the system, the default language specifed by PcdUefiVariableDefaultPlatformLang
|
||||||
|
is returned.
|
||||||
|
|
||||||
|
@return EFI_SUCCESS If the EFI Variable with "PlatformLang" is set and return in Lang.
|
||||||
|
@return EFI_NOT_FOUND If the EFI Variable with "PlatformLang" is not set, but a valid default language is return in Lang.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
GetCurrentLanguage (
|
||||||
|
OUT CHAR8 *Lang
|
||||||
|
)
|
||||||
|
{
|
||||||
|
EFI_STATUS Status;
|
||||||
|
UINTN Size;
|
||||||
|
|
||||||
|
ASSERT (Lang != NULL);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Get current language setting
|
||||||
|
//
|
||||||
|
Size = RFC_3066_ENTRY_SIZE;
|
||||||
|
Status = gRT->GetVariable (
|
||||||
|
L"PlatformLang",
|
||||||
|
&gEfiGlobalVariableGuid,
|
||||||
|
NULL,
|
||||||
|
&Size,
|
||||||
|
Lang
|
||||||
|
);
|
||||||
|
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
AsciiStrCpy (Lang, (CHAR8 *) PcdGetPtr (PcdUefiVariableDefaultPlatformLang));
|
||||||
|
}
|
||||||
|
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,6 +21,8 @@
|
|||||||
#include <Protocol/HiiString.h>
|
#include <Protocol/HiiString.h>
|
||||||
#include <Protocol/DevicePath.h>
|
#include <Protocol/DevicePath.h>
|
||||||
|
|
||||||
|
#include <Guid/GlobalVariable.h>
|
||||||
|
|
||||||
#include <Library/BaseLib.h>
|
#include <Library/BaseLib.h>
|
||||||
#include <Library/BaseMemoryLib.h>
|
#include <Library/BaseMemoryLib.h>
|
||||||
#include <Library/HiiLib.h>
|
#include <Library/HiiLib.h>
|
||||||
@ -29,6 +31,8 @@
|
|||||||
#include <Library/UefiBootServicesTableLib.h>
|
#include <Library/UefiBootServicesTableLib.h>
|
||||||
#include <Library/DevicePathLib.h>
|
#include <Library/DevicePathLib.h>
|
||||||
#include <Library/UefiLib.h>
|
#include <Library/UefiLib.h>
|
||||||
|
#include <Library/PcdLib.h>
|
||||||
|
#include <Library/UefiRuntimeServicesTableLib.h>
|
||||||
|
|
||||||
#define HII_LIB_DEFAULT_STRING_SIZE 0x200
|
#define HII_LIB_DEFAULT_STRING_SIZE 0x200
|
||||||
|
|
||||||
|
@ -48,12 +48,20 @@
|
|||||||
UefiBootServicesTableLib
|
UefiBootServicesTableLib
|
||||||
DevicePathLib
|
DevicePathLib
|
||||||
UefiLib
|
UefiLib
|
||||||
|
PcdLib
|
||||||
|
UefiRuntimeServicesTableLib
|
||||||
|
|
||||||
[Protocols]
|
[Protocols]
|
||||||
gEfiHiiDatabaseProtocolGuid # ALWAYS_CONSUMED
|
gEfiHiiDatabaseProtocolGuid # ALWAYS_CONSUMED
|
||||||
gEfiHiiStringProtocolGuid # ALWAYS_CONSUMED
|
gEfiHiiStringProtocolGuid # ALWAYS_CONSUMED
|
||||||
gEfiDevicePathProtocolGuid
|
gEfiDevicePathProtocolGuid
|
||||||
|
|
||||||
|
[Pcd]
|
||||||
|
gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang
|
||||||
|
|
||||||
|
[Guids]
|
||||||
|
gEfiGlobalVariableGuid
|
||||||
|
|
||||||
[Depex]
|
[Depex]
|
||||||
gEfiHiiDatabaseProtocolGuid AND
|
gEfiHiiDatabaseProtocolGuid AND
|
||||||
gEfiHiiStringProtocolGuid
|
gEfiHiiStringProtocolGuid
|
||||||
|
@ -40,6 +40,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
#include <Library/IfrSupportLib.h>
|
#include <Library/IfrSupportLib.h>
|
||||||
#include <Library/UefiLib.h>
|
#include <Library/UefiLib.h>
|
||||||
#include <Library/PcdLib.h>
|
#include <Library/PcdLib.h>
|
||||||
|
#include <Library/HiiLib.h>
|
||||||
|
|
||||||
#define HII_DATABASE_NOTIFY_GUID \
|
#define HII_DATABASE_NOTIFY_GUID \
|
||||||
{ \
|
{ \
|
||||||
|
@ -59,6 +59,7 @@
|
|||||||
DebugLib
|
DebugLib
|
||||||
IfrSupportLib
|
IfrSupportLib
|
||||||
UefiLib
|
UefiLib
|
||||||
|
HiiLib
|
||||||
|
|
||||||
[Protocols]
|
[Protocols]
|
||||||
gEfiConsoleControlProtocolGuid
|
gEfiConsoleControlProtocolGuid
|
||||||
|
Loading…
x
Reference in New Issue
Block a user