'How to get configured firmware keyboard layout in UEFI?

We can configure keyboard layout language in firmware settings. See the screenshot below

enter image description here

How can I get string name of this configured firmware keyboard layout in UEFI in form like "en_US" or "de_DE"?

I can use efilib or EDK-2



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source