mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2026-06-03 06:24:39 -04:00
Squashed 'boost/' content from commit b4feb19f2
git-subtree-dir: boost git-subtree-split: b4feb19f287ee92d87a9624b5d36b7cf46aeadeb
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
# Copyright 2003, 2006 Vladimir Prus
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
# Declare a main target.
|
||||
exe main : main.cpp ;
|
||||
|
||||
# Declare an action for updating translations
|
||||
# After changing main.cpp, invocation of
|
||||
#
|
||||
# bjam update-russian
|
||||
#
|
||||
# will update translations in russian.po
|
||||
gettext.update update-russian : russian.po main ;
|
||||
|
||||
# Compiled message catalog.
|
||||
gettext.catalog russian : russian.po ;
|
||||
|
||||
# A stage rule which installs message catalog to the
|
||||
# location gettext expects.
|
||||
stage messages-russian : russian
|
||||
: <location>messages/ru_RU.KOI8-R/LC_MESSAGES
|
||||
<name>main.mo
|
||||
;
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
# Copyright 2003 Vladimir Prus
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
using gettext ;
|
||||
@@ -0,0 +1,28 @@
|
||||
// Copyright Vladimir Prus 2003.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt
|
||||
// or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <locale.h>
|
||||
#include <libintl.h>
|
||||
#define i18n(s) gettext(s)
|
||||
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
// Specify that translations are stored in directory
|
||||
// "messages".
|
||||
bindtextdomain("main", "messages");
|
||||
textdomain("main");
|
||||
|
||||
// Switch to russian locale.
|
||||
setlocale(LC_MESSAGES, "ru_RU.KOI8-R");
|
||||
|
||||
// Output localized message.
|
||||
std::cout << i18n("hello") << "\n";
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
Copyright 2003 Vladimir Prus
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
This example shows how it is possible to use GNU gettext utilities with
|
||||
Boost.Build.
|
||||
|
||||
A simple translation file is compiled and installed as message catalog for
|
||||
russian. The main application explicitly switches to russian locale and outputs
|
||||
the translation of "hello".
|
||||
|
||||
To test:
|
||||
|
||||
bjam
|
||||
bin/gcc/debug/main
|
||||
|
||||
To test even more:
|
||||
|
||||
- add more localized strings to "main.cpp"
|
||||
- run "bjam update-russian"
|
||||
- edit "russian.po"
|
||||
- run bjam
|
||||
- run "main"
|
||||
@@ -0,0 +1,21 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2003-07-01 15:45+0400\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=CHARSET\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: main.cpp:16
|
||||
msgid "hello"
|
||||
msgstr "international hello"
|
||||
Reference in New Issue
Block a user