Texts per language
$LANGUAGE en
$MESSAGE Inbox
@ count int
"You have {$count} new messages."
[tr]
"{$count} yeni mesajınız var."
[de]
"Sie haben {$count} neue Nachrichten."
Text lines before any header are in the $LANGUAGE; a [tr] header starts the Turkish text. Each language may put the parameters wherever its grammar wants them.
Which text is used
The generated code reads the name of a locale and matches it against the languages:
[tr]matchestr,tr_TR,tr_TR.UTF-8,tr_TR@euro;- a more specific
[tr_TR]is tried before[tr]; - nothing matches → the
$LANGUAGEtext.
Passing the locale
std::locale const tr( "tr_TR.UTF-8" );
InboxStr( 3, tr ); // a string function — explicit locale
InboxStr( 3 ); // … or the global locale
std::cout.imbue( tr );
std::cout << InboxStreamable( 3 ); // a streamable — the stream's locale
ThrowInbox( 3, tr ); // the exception keeps the locale
Three things to know:
std::locale( "tr_TR.UTF-8" )throws if the system does not have that locale. On a minimal container that is common — catchstd::runtime_errorand fall back.- The global locale is
Cunless the program callsstd::locale::global( std::locale( "" ) ), which takes the user'sLANG/LC_ALL. - The locale formats numbers too.
{$size}withde_DEwrites1,5; if you want only the language, pass the language's locale and format numbers explicitly.
One language only
A module with a single language has no selection code at all. The std::locale overloads still exist (they control number formatting); drop them with LOCALE EXTRA DISABLE if you do not need them.

