Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/tools/build/v2/example/gettext/main.cpp @ 12

Last change on this file since 12 was 12, checked in by landauf, 17 years ago

added boost

File size: 628 bytes
Line 
1// Copyright Vladimir Prus 2003.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt
4// or copy at http://www.boost.org/LICENSE_1_0.txt)
5
6
7#include <locale.h>
8#include <libintl.h>
9#define i18n(s) gettext(s)
10
11#include <iostream>
12using namespace std;
13
14int main()
15{   
16    // Specify that translations are stored in directory
17    // "messages".
18    bindtextdomain("main", "messages");
19    textdomain("main");
20
21    // Switch to russian locale.
22    setlocale(LC_MESSAGES, "ru_RU.KOI8-R");
23
24    // Output localized message.
25    std::cout << i18n("hello") << "\n";
26
27    return 0;
28}
Note: See TracBrowser for help on using the repository browser.