CHAR8 *SupportedLanguages\r
);\r
\r
+\r
+/**\r
+ Determine what is the current language setting. The space reserved for Lang\r
+ must be at least RFC_3066_ENTRY_SIZE bytes;\r
+\r
+ If Lang is NULL, then ASSERT.\r
+\r
+ @param Lang Pointer of system language. Lang will always be filled with \r
+ a valid RFC 3066 language string. If "PlatformLang" is not\r
+ set in the system, the default language specifed by PcdUefiVariableDefaultPlatformLang\r
+ is returned.\r
+\r
+ @return EFI_SUCCESS If the EFI Variable with "PlatformLang" is set and return in Lang.\r
+ @return EFI_NOT_FOUND If the EFI Variable with "PlatformLang" is not set, but a valid default language is return in Lang.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+GetCurrentLanguage (\r
+ OUT CHAR8 *Lang\r
+ );\r
+\r
#endif\r
}\r
\r
\r
+/**\r
+ Determine what is the current language setting. The space reserved for Lang\r
+ must be at least RFC_3066_ENTRY_SIZE bytes;\r
+\r
+ If Lang is NULL, then ASSERT.\r
+\r
+ @param Lang Pointer of system language. Lang will always be filled with \r
+ a valid RFC 3066 language string. If "PlatformLang" is not\r
+ set in the system, the default language specifed by PcdUefiVariableDefaultPlatformLang\r
+ is returned.\r
+\r
+ @return EFI_SUCCESS If the EFI Variable with "PlatformLang" is set and return in Lang.\r
+ @return EFI_NOT_FOUND If the EFI Variable with "PlatformLang" is not set, but a valid default language is return in Lang.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+GetCurrentLanguage (\r
+ OUT CHAR8 *Lang\r
+ )\r
+{\r
+ EFI_STATUS Status;\r
+ UINTN Size;\r
+\r
+ ASSERT (Lang != NULL);\r
+\r
+ //\r
+ // Get current language setting\r
+ //\r
+ Size = RFC_3066_ENTRY_SIZE;\r
+ Status = gRT->GetVariable (\r
+ L"PlatformLang",\r
+ &gEfiGlobalVariableGuid,\r
+ NULL,\r
+ &Size,\r
+ Lang\r
+ );\r
+\r
+ if (EFI_ERROR (Status)) {\r
+ AsciiStrCpy (Lang, (CHAR8 *) PcdGetPtr (PcdUefiVariableDefaultPlatformLang));\r
+ }\r
+\r
+ return Status;\r
+}\r
+\r
+\r
+\r
#include <Protocol/HiiString.h>\r
#include <Protocol/DevicePath.h>\r
\r
+#include <Guid/GlobalVariable.h>\r
+\r
#include <Library/BaseLib.h>\r
#include <Library/BaseMemoryLib.h>\r
#include <Library/HiiLib.h>\r
#include <Library/UefiBootServicesTableLib.h>\r
#include <Library/DevicePathLib.h>\r
#include <Library/UefiLib.h>\r
+#include <Library/PcdLib.h>\r
+#include <Library/UefiRuntimeServicesTableLib.h>\r
\r
#define HII_LIB_DEFAULT_STRING_SIZE 0x200\r
\r
UefiBootServicesTableLib\r
DevicePathLib\r
UefiLib\r
+ PcdLib\r
+ UefiRuntimeServicesTableLib\r
\r
[Protocols]\r
gEfiHiiDatabaseProtocolGuid # ALWAYS_CONSUMED\r
gEfiHiiStringProtocolGuid # ALWAYS_CONSUMED\r
gEfiDevicePathProtocolGuid \r
\r
+[Pcd]\r
+ gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang\r
+\r
+[Guids] \r
+ gEfiGlobalVariableGuid \r
+\r
[Depex]\r
gEfiHiiDatabaseProtocolGuid AND\r
gEfiHiiStringProtocolGuid\r
#include <Library/IfrSupportLib.h>\r
#include <Library/UefiLib.h>\r
#include <Library/PcdLib.h>\r
+#include <Library/HiiLib.h>\r
\r
#define HII_DATABASE_NOTIFY_GUID \\r
{ \\r
DebugLib\r
IfrSupportLib\r
UefiLib\r
+ HiiLib\r
\r
[Protocols]\r
gEfiConsoleControlProtocolGuid \r