MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / InitializeLanguage

Function InitializeLanguage

CloverEFI/OsxBdsDxe/Language.c:448–491  ·  view source on GitHub ↗

Determine the current language that will be used based on language related EFI Variables. @param LangCodesSettingRequired - If required to set LangCodes variable **/

Source from the content-addressed store, hash-verified

446
447**/
448VOID
449InitializeLanguage (
450 BOOLEAN LangCodesSettingRequired
451 )
452{
453// EFI_STATUS Status;
454 CHAR8 *LangCodes;
455 CHAR8 *PlatformLangCodes;
456
457 ExportFonts ();
458
459 LangCodes = (CHAR8 *)PcdGetPtr (PcdUefiVariableDefaultLangCodes);
460 PlatformLangCodes = (CHAR8 *)PcdGetPtr (PcdUefiVariableDefaultPlatformLangCodes);
461 if (LangCodesSettingRequired) {
462 if (!FeaturePcdGet (PcdUefiVariableDefaultLangDeprecate)) {
463 //
464 // UEFI 2.0 depricated this variable so we support turning it off
465 //
466 /*Status = */gRT->SetVariable (
467 L"LangCodes",
468 &gEfiGlobalVariableGuid,
469 EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
470 AsciiStrSize (LangCodes),
471 LangCodes
472 );
473 }
474
475 /*Status = */gRT->SetVariable (
476 L"PlatformLangCodes",
477 &gEfiGlobalVariableGuid,
478 EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
479 AsciiStrSize (PlatformLangCodes),
480 PlatformLangCodes
481 );
482 }
483
484 if (!FeaturePcdGet (PcdUefiVariableDefaultLangDeprecate)) {
485 //
486 // UEFI 2.0 depricated this variable so we support turning it off
487 //
488 InitializeLangVariable (L"Lang", LangCodes, (CHAR8 *) PcdGetPtr (PcdUefiVariableDefaultLang), TRUE);
489 }
490 InitializeLangVariable (L"PlatformLang", PlatformLangCodes, (CHAR8 *) PcdGetPtr (PcdUefiVariableDefaultPlatformLang), FALSE);
491}

Callers 1

BdsEntryFunction · 0.70

Calls 3

AsciiStrSizeFunction · 0.85
ExportFontsFunction · 0.70
InitializeLangVariableFunction · 0.70

Tested by

no test coverage detected