TianoCore EDK2 master
Loading...
Searching...
No Matches
Language.c File Reference
#include "Bds.h"

Go to the source code of this file.

Macros

#define ISO_639_2_ENTRY_SIZE   3
 

Functions

BOOLEAN IsLangInSupportedLangCodes (IN CHAR8 *SupportedLang, IN CHAR8 *Lang, IN BOOLEAN Iso639Language)
 
VOID InitializeLangVariable (IN CHAR16 *LangName, IN CHAR8 *SupportedLang, IN CHAR8 *DefaultLang, IN BOOLEAN Iso639Language)
 
VOID InitializeLanguage (BOOLEAN LangCodesSettingRequired)
 

Detailed Description

Language settings

Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Language.c.

Macro Definition Documentation

◆ ISO_639_2_ENTRY_SIZE

#define ISO_639_2_ENTRY_SIZE   3

Definition at line 10 of file Language.c.

Function Documentation

◆ InitializeLanguage()

VOID InitializeLanguage ( BOOLEAN  LangCodesSettingRequired)

Determine the current language that will be used based on language related EFI Variables.

Parameters
LangCodesSettingRequired- If required to set LangCodes variable

Definition at line 155 of file Language.c.

◆ InitializeLangVariable()

VOID InitializeLangVariable ( IN CHAR16 *  LangName,
IN CHAR8 *  SupportedLang,
IN CHAR8 *  DefaultLang,
IN BOOLEAN  Iso639Language 
)

Initialize Lang or PlatformLang variable, if Lang or PlatformLang variable is not found, or it has been set to an unsupported value(not one of platform supported language codes), set the default language code to it.

Parameters
LangNameLanguage name, L"Lang" or L"PlatformLang".
SupportedLangPlatform supported language codes.
DefaultLangDefault language code.
Iso639LanguageA bool value to signify if the handler is operated on ISO639 or RFC4646, TRUE for L"Lang" LangName or FALSE for L"PlatformLang" LangName.

Definition at line 109 of file Language.c.

◆ IsLangInSupportedLangCodes()

BOOLEAN IsLangInSupportedLangCodes ( IN CHAR8 *  SupportedLang,
IN CHAR8 *  Lang,
IN BOOLEAN  Iso639Language 
)

Check if lang is in supported language codes according to language string.

This code is used to check if lang is in in supported language codes. It can handle RFC4646 and ISO639 language tags. In ISO639 language tags, take 3-characters as a delimitation to find matched string. In RFC4646 language tags, take semicolon as a delimitation to find matched string.

For example: SupportedLang = "engfraengfra" Iso639Language = TRUE Lang = "eng", the return value is "TRUE", or Lang = "chs", the return value is "FALSE". Another example: SupportedLang = "en;fr;en-US;fr-FR" Iso639Language = FALSE Lang = "en", the return value is "TRUE", or Lang = "zh", the return value is "FALSE".

Parameters
SupportedLangPlatform supported language codes.
LangConfigured language.
Iso639LanguageA bool value to signify if the handler is operated on ISO639 or RFC4646.
Return values
TRUElang is in supported language codes.
FALSElang is not in supported language codes.

Definition at line 40 of file Language.c.