1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
{
rstconv -i tnlshello.rst -o tnlshello_ru_UTF8.pot
msgfmt tnlshello_ru_UTF8.pot
mv messages.mo ru
}
program nlshello;
{$mode objfpc}
uses
gettext, libc, ncurses;
resourcestring
hello_world = 'Hello world!';
press_key = 'Press any key to continue!';
var
win : pWINDOW;
begin
setlocale(LC_ALL, '');
try
initscr();
start_color;
noecho;
win:= newwin ( 10, COLS - 20, 5, 10);
init_pair(1,COLOR_WHITE,COLOR_BLUE);
init_pair(2,COLOR_RED,COLOR_BLUE);
wbkgd(win, COLOR_PAIR(1));
erase;
refresh;
box(win, ACS_VLINE, ACS_HLINE);
wrefresh(win);
mvwaddstr(win,1,3, curses_version);
TranslateResourcestrings('%s/messages.mo');
wattron(win,A_BLINK OR A_BOLD OR COLOR_PAIR(2));
mvwaddstr(win,3,3, PChar(hello_world));
wattroff(win,A_BLINK OR A_BOLD OR COLOR_PAIR(2));
mvwaddstr(win,5,3, PChar(press_key));
wrefresh(win);
getch();
finally
endwin();
end;
end.
|