xtd
1.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
culture_info_parent.cpp
Shows how to use
xtd::globalization::culture_info::parent
property.
#include <xtd/xtd>
using namespace
xtd::globalization
;
auto
main() ->
int
{
for
(
auto
ci :
culture_info::get_cultures
(
culture_types::specific_cultures
)) {
if
(ci.two_letter_iso_language_name() ==
"zh"
) {
console::write
(
"0x{:X4} {} {,-40}"
, ci.lcid(), ci.name(), ci.english_name());
console::write_line
(
"0x{:X4} {} {}"
, ci.parent().lcid(), ci.parent().name(), ci.parent().english_name());
}
}
}
// This code produces the following output :
//
// 0x1000 zh-Hans-CN Chinese, Simplified (China mainland) 0x0004 zh-Hans Chinese, Simplified
// 0x1000 zh-Hans-HK Chinese, Simplified (Hong Kong) 0x0004 zh-Hans Chinese, Simplified
// 0x1000 zh-Hans-JP Chinese, Simplified (Japan) 0x0004 zh-Hans Chinese, Simplified
// 0x1000 zh-Hans-MO Chinese, Simplified (Macao) 0x0004 zh-Hans Chinese, Simplified
// 0x1000 zh-Hans-MY Chinese, Simplified (Malaysia) 0x0004 zh-Hans Chinese, Simplified
// 0x1000 zh-Hans-SG Chinese, Simplified (Singapore) 0x0004 zh-Hans Chinese, Simplified
// 0x1000 zh-Hant-CN Chinese, Traditional (China mainland) 0x7C04 zh-Hant Chinese, Traditional
// 0x1000 zh-Hant-HK Chinese, Traditional (Hong Kong) 0x7C04 zh-Hant Chinese, Traditional
// 0x1000 zh-Hant-JP Chinese, Traditional (Japan) 0x7C04 zh-Hant Chinese, Traditional
// 0x1000 zh-Hant-MO Chinese, Traditional (Macao) 0x7C04 zh-Hant Chinese, Traditional
// 0x1000 zh-Hant-MY Chinese, Traditional (Malaysia) 0x7C04 zh-Hant Chinese, Traditional
// 0x1000 zh-Hant-TW Chinese, Traditional (Taiwan) 0x7C04 zh-Hant Chinese, Traditional
xtd::console::write
static auto write(arg_t &&value) -> void
Writes the text representation of the specified value to the standard output stream.
Definition
console.hpp:480
xtd::console::write_line
static auto write_line() -> void
Writes the current line terminator to the standard output stream using the specified format informati...
xtd::globalization::culture_info::get_cultures
static auto get_cultures(xtd::globalization::culture_types types) -> xtd::array< xtd::globalization::culture_info >
Gets the list of supported cultures filtered by the specified xtd::globalization::culture_types param...
xtd::globalization::culture_types::specific_cultures
@ specific_cultures
Cultures that are specific to a country/region.
Definition
culture_types.hpp:25
xtd::globalization
Contains classes that define culture-related information, including language, country/region,...
Definition
culture_info.hpp:19
Generated on
for xtd by
Gammasoft
. All rights reserved.